mirror of
https://github.com/GTNewHorizons/FindIt.git
synced 2026-11-18 23:59:05 +00:00
findit/util/AbstractStackFinder: Add check for whether NEI Search is focused (#8)
* findit/util/AbstractStackFinder: Add check for whether NEI Search is focused This adds a check to make sure that FindIt doesn't start a search when searching in NEI Signed-off-by: Firenoo <[email protected]> * findit/util/AbstractStackFinder: Move key handling code to lastKeyTyped Moves FindIt's keyhandling code to lastKeyTyped to avoid conflicting with textfields. Signed-off-by: Firenoo <[email protected]> * findit/util/AbstractStackFinder: Code cleanup Signed-off-by: Firenoo <[email protected]> * findit/service: Revert default keybinds to T/Y. Signed-off-by: Firenoo <[email protected]> Signed-off-by: Firenoo <[email protected]>
This commit is contained in:
1 parent
84f2cf1182
commit
bdf41e7ed8
3 files changed
+18
-18
No files matched your search
@@ -16,7 +16,7 @@ import org.lwjgl.input.Keyboard;
|
||||
public class ClientBlockFindService extends BlockFindService {
|
||||
|
||||
public ClientBlockFindService() {
|
||||
API.addHashBind("gui.findit.find_block", Keyboard.KEY_Y + NEIClientUtils.SHIFT_HASH);
|
||||
API.addHashBind("gui.findit.find_block", Keyboard.KEY_Y);
|
||||
GuiContainerManager.addInputHandler(new BlockFindInputHandler());
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ public class ClientItemFindService extends ItemFindService {
|
||||
|
||||
public ClientItemFindService() {
|
||||
if (!FindIt.isExtraUtilitiesLoaded()) {
|
||||
API.addHashBind("gui.findit.find_item", Keyboard.KEY_T + NEIClientUtils.SHIFT_HASH);
|
||||
API.addHashBind("gui.findit.find_item", Keyboard.KEY_T);
|
||||
}
|
||||
GuiContainerManager.addInputHandler(new ItemFindInputHandler());
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.gtnh.findit.util;
|
||||
|
||||
import appeng.client.gui.implementations.*;
|
||||
import codechicken.nei.LayoutManager;
|
||||
import codechicken.nei.NEIClientConfig;
|
||||
import codechicken.nei.guihook.GuiContainerManager;
|
||||
@@ -15,21 +16,7 @@ public abstract class AbstractStackFinder implements IContainerInputHandler {
|
||||
|
||||
@Override
|
||||
public boolean keyTyped(GuiContainer window, char c, int key) {
|
||||
|
||||
if (!NEIClientConfig.isKeyHashDown(getKeyBindId())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
LayoutManager layout = LayoutManager.instance();
|
||||
if (layout == null || LayoutManager.itemPanel == null || NEIClientConfig.isHidden()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ItemStack stack = GuiContainerManager.getStackMouseOver(window);
|
||||
if (stack == null || stack.getItem() == null) {
|
||||
return false;
|
||||
}
|
||||
return findStack(stack);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -39,7 +26,20 @@ public abstract class AbstractStackFinder implements IContainerInputHandler {
|
||||
|
||||
@Override
|
||||
public boolean lastKeyTyped(GuiContainer guiContainer, char c, int i) {
|
||||
return false;
|
||||
if (!NEIClientConfig.isKeyHashDown(getKeyBindId())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
LayoutManager layout = LayoutManager.instance();
|
||||
if (layout == null || LayoutManager.itemPanel == null || NEIClientConfig.isHidden()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ItemStack stack = GuiContainerManager.getStackMouseOver(guiContainer);
|
||||
if (stack == null || stack.getItem() == null) {
|
||||
return false;
|
||||
}
|
||||
return findStack(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user