mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-15 17:54:50 +00:00
Small fixes & changes (#523)
* fix hotkeys * code cleanup * fix recipe tooltip overlay * search item by original name * overlay button refactoring * fix subset filter * change keyname; issue 524 * cleanup code * move overlayformat logic --------- Co-authored-by: slprime <[email protected]>
This commit is contained in:
1 parent
bd5e991a84
commit
65652e5896
15 files changed
+166
-98
No files matched your search
@@ -243,18 +243,18 @@ public class SearchField extends TextField implements ItemFilterProvider {
|
||||
search = search.substring(2, search.length() - 1);
|
||||
} else {
|
||||
final Matcher matcher = Pattern.compile("(\\?|\\*)").matcher(search);
|
||||
String cleanedString = "";
|
||||
StringBuilder cleanedString = new StringBuilder();
|
||||
int lastEndIndex = 0;
|
||||
|
||||
while (matcher.find()) {
|
||||
cleanedString += Pattern.quote(search.substring(lastEndIndex, matcher.start()));
|
||||
cleanedString.append(Pattern.quote(search.substring(lastEndIndex, matcher.start())));
|
||||
|
||||
switch (matcher.group(0).charAt(0)) {
|
||||
case '?':
|
||||
cleanedString += ".";
|
||||
cleanedString.append(".");
|
||||
break;
|
||||
case '*':
|
||||
cleanedString += ".+?";
|
||||
cleanedString.append(".+?");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -266,6 +266,8 @@ public class SearchField extends TextField implements ItemFilterProvider {
|
||||
search = cleanedString + Pattern.quote(search.substring(lastEndIndex, search.length()));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (!search.isEmpty()) {
|
||||
@@ -300,6 +302,8 @@ public class SearchField extends TextField implements ItemFilterProvider {
|
||||
case 2:
|
||||
text = text.replaceAll("[{}()\\[\\].+*?^$\\\\|]", "\\\\$0");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (text.contains(" ") && NEIClientConfig.getBooleanSetting("inventory.search.quoteDropItemName")) {
|
||||
|
||||
Reference in new issue
Block a user