diff options
author | NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> | 2023-10-07 22:38:05 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-07 13:38:05 +0200 |
commit | e540823d2869323f2b86c3e478f45eeeb6d7d6ab (patch) | |
tree | 0ae1a767ac98e0e22442e9ecaf11c5a8c79e4b2c /src/main | |
parent | 87cf5fde69c76b8dee87790f18ee8b3283d86c09 (diff) | |
download | NotEnoughUpdates-e540823d2869323f2b86c3e478f45eeeb6d7d6ab.tar.gz NotEnoughUpdates-e540823d2869323f2b86c3e478f45eeeb6d7d6ab.tar.bz2 NotEnoughUpdates-e540823d2869323f2b86c3e478f45eeeb6d7d6ab.zip |
Hotkey to open ah/bz while hovering over an item (#864)
Search ah or bz for item hovered when clicking m by default
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java | 8 | ||||
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Misc.java | 8 |
2 files changed, 15 insertions, 1 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java index 792bbea4..6e3a2570 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java @@ -25,7 +25,6 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import io.github.moulberry.notenoughupdates.commands.help.SettingsCommand; import io.github.moulberry.notenoughupdates.core.BackgroundBlur; -import io.github.moulberry.notenoughupdates.core.GuiScreenElementWrapper; import io.github.moulberry.notenoughupdates.core.util.lerp.LerpingInteger; import io.github.moulberry.notenoughupdates.infopanes.DevInfoPane; import io.github.moulberry.notenoughupdates.infopanes.InfoPane; @@ -1212,6 +1211,13 @@ public class NEUOverlay extends Gui { NotEnoughUpdates.INSTANCE.config.ahGraph.graphEnabled) { NotEnoughUpdates.INSTANCE.openGui = new GuiPriceGraph(internalname.get()); return true; + } else if (keyPressed == NotEnoughUpdates.INSTANCE.config.misc.openAHKeybind) { + String cleanName = Utils.cleanColour(item.get("displayname").getAsString()); + if (NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo(internalname.get()) == null) { + NotEnoughUpdates.INSTANCE.trySendCommand("/ahs " + cleanName); + } else { + NotEnoughUpdates.INSTANCE.trySendCommand("/bz " + cleanName); + } } } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Misc.java b/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Misc.java index 95e29a5c..72521821 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Misc.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Misc.java @@ -325,4 +325,12 @@ public class Misc { ) @ConfigEditorBoolean public boolean defaultArmorColour = false; + + @Expose + @ConfigOption( + name = "Search AH/BZ for current item", + desc = "Search AH/BZ for the item you are hovering over" + ) + @ConfigEditorKeybind(defaultKey = Keyboard.KEY_M) + public int openAHKeybind = Keyboard.KEY_M; } |