aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/InventoryConfig.java6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/ChestValue.kt7
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt18
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()