mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-16 10:44:45 +00:00
Create Bookmarks Groups; Search Recipe (#451)
* Create Bookmarks Groups; Search Recipe * fix crash after DnD; add remove group function * change hiddenhandler handlerId * Pull all Bookmarked Items: use groups * Optimize Chain Algorithm * remove println * fix input V in ME terminal * Add Search Recipe Icon * fix recipe extra information * Change Search Recipe Algorithm * fixed rounding in chain calculation * fix creating groups for 2-line recipes * fix fast DnD and recipe tooltip * Bookmarks Recipe Chains: fluid canner * Bookmarks Recipe Chains: fluid cell * Open GuiRecipe: normalizeItemStack --------- Co-authored-by: slprime <[email protected]>
This commit is contained in:
1 parent
e30f6a41ad
commit
adf2065305
38 files changed
+3135
-892
No files matched your search
@@ -101,7 +101,6 @@ public class SearchField extends TextField implements ItemFilterProvider {
|
||||
if (button == 0) {
|
||||
if (focused() && (System.currentTimeMillis() - lastclicktime < 400)) { // double click
|
||||
NEIClientConfig.world.nbt.setBoolean("searchinventories", !searchInventories());
|
||||
NEIClientConfig.world.saveNBT();
|
||||
}
|
||||
lastclicktime = System.currentTimeMillis();
|
||||
}
|
||||
@@ -123,11 +122,11 @@ public class SearchField extends TextField implements ItemFilterProvider {
|
||||
if (isVisible() && NEIClientConfig.isKeyHashDown("gui.search")) {
|
||||
setFocus(true);
|
||||
}
|
||||
if (NEIClientConfig.isKeyHashDown("gui.getprevioussearch") && focused()) {
|
||||
if (focused() && NEIClientConfig.isKeyHashDown("gui.getprevioussearch")) {
|
||||
handleNavigateHistory(TextHistory.Direction.PREVIOUS);
|
||||
}
|
||||
|
||||
if (NEIClientConfig.isKeyHashDown("gui.getnextsearch") && focused()) {
|
||||
if (focused() && NEIClientConfig.isKeyHashDown("gui.getnextsearch")) {
|
||||
handleNavigateHistory(TextHistory.Direction.NEXT);
|
||||
}
|
||||
}
|
||||
@@ -151,22 +150,33 @@ public class SearchField extends TextField implements ItemFilterProvider {
|
||||
try {
|
||||
pattern = Pattern.compile(search);
|
||||
} catch (PatternSyntaxException ignored) {}
|
||||
|
||||
return pattern == null || pattern.toString().length() == 0 ? null : pattern;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemFilter getFilter() {
|
||||
String s_filter = text().toLowerCase();
|
||||
return getFilter(text());
|
||||
}
|
||||
|
||||
public static ItemFilter getFilter(String s_filter) {
|
||||
List<ItemFilter> primary = new LinkedList<>();
|
||||
List<ItemFilter> secondary = new LinkedList<>();
|
||||
s_filter = s_filter.toLowerCase();
|
||||
|
||||
for (ISearchProvider p : searchProviders) {
|
||||
ItemFilter filter = p.getFilter(s_filter);
|
||||
if (filter != null) (p.isPrimary() ? primary : secondary).add(filter);
|
||||
}
|
||||
|
||||
if (!primary.isEmpty()) return new AnyMultiItemFilter(primary);
|
||||
if (!secondary.isEmpty()) return new AnyMultiItemFilter(secondary);
|
||||
if (!primary.isEmpty()) {
|
||||
return new AnyMultiItemFilter(primary);
|
||||
}
|
||||
|
||||
if (!secondary.isEmpty()) {
|
||||
return new AnyMultiItemFilter(secondary);
|
||||
}
|
||||
|
||||
return new EverythingItemFilter();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user