diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-10-30 15:16:08 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-10-30 15:16:08 +0100 |
commit | 248edea686fb2580a339b2ca0c3668f3f1da0ff7 (patch) | |
tree | 54aba72c9d95fcbeba7722e71ccda65d12d0b7e0 | |
parent | 3f3ead4265dc7814f7e34f9c60ec83ad5cb45c83 (diff) | |
download | skyhanni-248edea686fb2580a339b2ca0c3668f3f1da0ff7.tar.gz skyhanni-248edea686fb2580a339b2ca0c3668f3f1da0ff7.tar.bz2 skyhanni-248edea686fb2580a339b2ca0c3668f3f1da0ff7.zip |
Added option to hide chest value while estimated item value display is showing.
3 files changed, 26 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/InventoryConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/InventoryConfig.java index 3c6c75056..d1bf61efa 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/InventoryConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/InventoryConfig.java @@ -245,6 +245,12 @@ public class InventoryConfig { public boolean enableInDungeons = false; @Expose + @ConfigOption(name = "Enable during Item Value", desc = "Show this display even if the Estimated Item Value is visible.") + @ConfigEditorBoolean + @FeatureToggle + public boolean showDuringEstimatedItemValue = false; + + @Expose @ConfigOption(name = "Show Stacks", desc = "Show the item icon before name.") @ConfigEditorBoolean public boolean showStacks = true; diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/ChestValue.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/ChestValue.kt index 52e6d3b8d..449464952 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ChestValue.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ChestValue.kt @@ -42,6 +42,11 @@ class ChestValue { if (!isEnabled()) return if (LorenzUtils.inDungeons && !config.enableInDungeons) return if (InventoryUtils.openInventoryName() == "") return + + if (!config.showDuringEstimatedItemValue) { + if (EstimatedItemValue.currentlyShowing) return + } + if (inInventory) { config.position.renderStringsAndItems( display, @@ -239,7 +244,7 @@ class ChestValue { } val inMinion = name.contains("Minion") && !name.contains("Recipe") && - LorenzUtils.skyBlockIsland == IslandType.PRIVATE_ISLAND + LorenzUtils.skyBlockIsland == IslandType.PRIVATE_ISLAND return name == "Chest" || name == "Large Chest" || inMinion || name == "Personal Vault" } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt index b92bc8f0a..5671822cb 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt @@ -78,6 +78,7 @@ object EstimatedItemValue { private val cache = mutableMapOf<ItemStack, List<List<Any>>>() private var lastToolTipTime = 0L private var gemstoneUnlockCosts = HashMap<NEUInternalName, HashMap<String, List<String>>>() + var currentlyShowing = false @SubscribeEvent fun onRepoReload(event: RepositoryReloadEvent) { @@ -96,14 +97,23 @@ object EstimatedItemValue { @SubscribeEvent fun onRenderOverlay(event: GuiRenderEvent.ChestGuiOverlayRenderEvent) { - if (!LorenzUtils.inSkyBlock) return - if (!config.enabled) return - if (!config.hotkey.isKeyHeld() && !config.alwaysEnabled) return - if (System.currentTimeMillis() > lastToolTipTime + 200) return + currentlyShowing = checkCurrentlyVisible() + if (!currentlyShowing) return config.itemPriceDataPos.renderStringsAndItems(display, posLabel = "Estimated Item Value") } + private fun checkCurrentlyVisible(): Boolean { + if (!LorenzUtils.inSkyBlock) return false + if (!config.enabled) return false + if (!config.hotkey.isKeyHeld() && !config.alwaysEnabled) return false + if (System.currentTimeMillis() > lastToolTipTime + 200) return false + + if (display.isEmpty()) return false + + return true + } + @SubscribeEvent fun onInventoryClose(event: InventoryCloseEvent) { cache.clear() |