mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-20 04:09:45 +00:00
Create JEI-like Advanced Search (#485)
* Create JEI like Search * add subfilter * fix extended search pattern * fix search crash without prefixes * fix unicode case in search * add regexp to extended patternMode * move autofocus config to seatch widget panel * code refactoring * add matching language to searh parser * fix type * fix modname search * clean cache after add new provider --------- Co-authored-by: slprime <[email protected]> Co-authored-by: Martin Robertz <[email protected]>
This commit is contained in:
34 files changed
+1233
-291
No files matched your search
@@ -90,7 +90,8 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
public static PresetsWidget presetsPanel;
|
||||
public static SearchField searchField;
|
||||
public static boolean searchInitFocusedCancellable = false;
|
||||
public static int mousePriorX, mousePriorY;
|
||||
protected static int mousePriorX;
|
||||
protected static int mousePriorY;
|
||||
|
||||
public static ButtonCycled options;
|
||||
public static ButtonCycled bookmarksButton;
|
||||
@@ -167,7 +168,7 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
return getSideWidth(gui);
|
||||
}
|
||||
|
||||
public boolean isAllowedGuiAutoSearchFocus(GuiContainer gui) {
|
||||
protected boolean isAllowedGuiAutoSearchFocus(GuiContainer gui) {
|
||||
if (gui instanceof INEIAutoFocusSearchEnable) {
|
||||
return true;
|
||||
}
|
||||
@@ -182,9 +183,9 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
return false;
|
||||
}
|
||||
|
||||
public void searchFocusInitCancelCheck() {
|
||||
protected void searchFocusInitCancelCheck() {
|
||||
if (searchInitFocusedCancellable) {
|
||||
if (searchField.isVisible() && NEIClientConfig.isFocusSearchWidgetOnOpen()
|
||||
if (searchField.isVisible() && NEIClientConfig.searchWidgetAutofocus()
|
||||
&& getInputFocused() == searchField) {
|
||||
searchField.setFocus(false);
|
||||
setInputFocused(null);
|
||||
@@ -306,8 +307,7 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
if (mousePriorX == -1) {
|
||||
mousePriorX = mousex;
|
||||
mousePriorY = mousey;
|
||||
}
|
||||
if (mousePriorX != mousex || mousePriorY != mousey) {
|
||||
} else if (mousePriorX != mousex || mousePriorY != mousey) {
|
||||
searchFocusInitCancelCheck();
|
||||
mousePriorX = mousex;
|
||||
mousePriorY = mousey;
|
||||
@@ -676,7 +676,7 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
mousePriorX = -1;
|
||||
mousePriorY = -1;
|
||||
|
||||
if (searchField.isVisible() && NEIClientConfig.isFocusSearchWidgetOnOpen()
|
||||
if (searchField.isVisible() && NEIClientConfig.searchWidgetAutofocus()
|
||||
&& isAllowedGuiAutoSearchFocus(gui)) {
|
||||
searchField.setFocus(true);
|
||||
setInputFocused(searchField);
|
||||
|
||||
Reference in new issue
Block a user