From e540823d2869323f2b86c3e478f45eeeb6d7d6ab Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Sat, 7 Oct 2023 22:38:05 +1100 Subject: Hotkey to open ah/bz while hovering over an item (#864) Search ah or bz for item hovered when clicking m by default --- .../java/io/github/moulberry/notenoughupdates/NEUOverlay.java | 8 +++++++- .../moulberry/notenoughupdates/options/separatesections/Misc.java | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'src/main/java') 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; } -- cgit