Skip to content

Commit

Permalink
Add Shortcut to KeyBinding (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
slprime authored Aug 21, 2022
1 parent 5be63a3 commit 84f2cf1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Add your dependencies here

dependencies {
compile('com.github.GTNewHorizons:NotEnoughItems:2.2.6-GTNH:dev')
compile('com.github.GTNewHorizons:NotEnoughItems:2.2.27-GTNH:dev')
compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.40.33:dev')
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.gtnh.findit.service.blockfinder;

import codechicken.nei.NEIClientUtils;
import codechicken.nei.api.API;
import codechicken.nei.guihook.GuiContainerManager;
import com.gtnh.findit.FindIt;
Expand All @@ -15,7 +16,7 @@
public class ClientBlockFindService extends BlockFindService {

public ClientBlockFindService() {
API.addKeyBind("gui.findit.find_block", Keyboard.KEY_Y);
API.addHashBind("gui.findit.find_block", Keyboard.KEY_Y + NEIClientUtils.SHIFT_HASH);
GuiContainerManager.addInputHandler(new BlockFindInputHandler());
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.gtnh.findit.service.itemfinder;

import codechicken.nei.NEIClientUtils;
import codechicken.nei.api.API;
import codechicken.nei.guihook.GuiContainerManager;
import com.gtnh.findit.FindIt;
Expand Down Expand Up @@ -32,7 +33,7 @@ public class ClientItemFindService extends ItemFindService {

public ClientItemFindService() {
if (!FindIt.isExtraUtilitiesLoaded()) {
API.addKeyBind("gui.findit.find_item", Keyboard.KEY_T);
API.addHashBind("gui.findit.find_item", Keyboard.KEY_T + NEIClientUtils.SHIFT_HASH);
}
GuiContainerManager.addInputHandler(new ItemFindInputHandler());

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/gtnh/findit/util/AbstractStackFinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public abstract class AbstractStackFinder implements IContainerInputHandler {

@Override
public boolean keyTyped(GuiContainer window, char c, int key) {
int keyBinding = NEIClientConfig.getKeyBinding(getKeyBindId());
if (key != keyBinding) {

if (!NEIClientConfig.isKeyHashDown(getKeyBindId())) {
return false;
}

Expand Down

0 comments on commit 84f2cf1

Please sign in to comment.