diff options
| author | NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> | 2024-07-14 02:20:08 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-13 18:20:08 +0200 |
| commit | 1e587bdb6003b0beffa0c554582fbd846c314954 (patch) | |
| tree | e97c4105a6a027e2e92d12922039c7f320aea8a3 /src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java | |
| parent | 821c177944db38d038f635d2ba499392265a02eb (diff) | |
| download | notenoughupdates-1e587bdb6003b0beffa0c554582fbd846c314954.tar.gz notenoughupdates-1e587bdb6003b0beffa0c554582fbd846c314954.tar.bz2 notenoughupdates-1e587bdb6003b0beffa0c554582fbd846c314954.zip | |
Add support for ah/bz keybind in custom menus (#1241)
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java index d5ffc790..35cbf8c6 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java @@ -34,7 +34,7 @@ import io.github.moulberry.notenoughupdates.mbgui.MBAnchorPoint; import io.github.moulberry.notenoughupdates.mbgui.MBGuiElement; import io.github.moulberry.notenoughupdates.mbgui.MBGuiGroupAligned; import io.github.moulberry.notenoughupdates.mbgui.MBGuiGroupFloating; -import io.github.moulberry.notenoughupdates.miscfeatures.CookieWarning; +import io.github.moulberry.notenoughupdates.miscfeatures.AhBzKeybind; import io.github.moulberry.notenoughupdates.miscfeatures.EnchantingSolvers; import io.github.moulberry.notenoughupdates.miscfeatures.SunTzu; import io.github.moulberry.notenoughupdates.miscgui.NeuSearchCalculator; @@ -1219,22 +1219,14 @@ 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 && - CookieWarning.hasActiveBoosterCookie()) { + } else if (keyPressed == NotEnoughUpdates.INSTANCE.config.misc.openAHKeybind) { String displayName = item.get("displayname").getAsString(); - - String cleanName = Utils.cleanColour(displayName).replace("[Lvl {LVL}]", "]").trim(); - - if (displayName.endsWith("Enchanted Book")) { - String loreName = Utils.cleanColour(item.getAsJsonArray("lore").get(0).getAsString()); - - String bookName = loreName.substring(0, loreName.lastIndexOf(' ')); - NotEnoughUpdates.INSTANCE.trySendCommand("/bz " + bookName); - } else if (NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo(internalname.get()) == null) { - NotEnoughUpdates.INSTANCE.trySendCommand("/ahs " + cleanName); - } else { - NotEnoughUpdates.INSTANCE.trySendCommand("/bz " + cleanName); + JsonArray lore = item.getAsJsonArray("lore"); + List<String> loreList = new ArrayList<>(); + for (int i = 0; i < lore.size(); i++) { + loreList.add(lore.get(i).getAsString()); } + AhBzKeybind.onKeyPressed(displayName, loreList, internalname.get()); } else if (keyPressed == NotEnoughUpdates.INSTANCE.config.misc.openSkyBlockRecipeKeybind && !item.has("vanilla") && StreamExtL.filterIsInstance( |
