diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-25 13:46:12 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-25 13:46:12 +0100 |
commit | 3f25c2c3dbd31adfe9a2b1b5dd2a996b05528d19 (patch) | |
tree | b81318e824395095912caac9b7b74ac1fca96e32 /src/main/java | |
parent | e66eeae3cc2dbe16531e73f54909f27767f6af71 (diff) | |
download | skyhanni-3f25c2c3dbd31adfe9a2b1b5dd2a996b05528d19.tar.gz skyhanni-3f25c2c3dbd31adfe9a2b1b5dd2a996b05528d19.tar.bz2 skyhanni-3f25c2c3dbd31adfe9a2b1b5dd2a996b05528d19.zip |
Fixed EstimatedItemValue.isCurrentlyShowing logic
Diffstat (limited to 'src/main/java')
3 files changed, 5 insertions, 3 deletions
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 0f472aafa..f8817b43b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ChestValue.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ChestValue.kt @@ -45,7 +45,7 @@ class ChestValue { if (InventoryUtils.openInventoryName() == "") return if (!config.showDuringEstimatedItemValue) { - if (EstimatedItemValue.currentlyShowing) return + if (EstimatedItemValue.isCurrentlyShowing()) return } if (inInventory) { 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 87394161f..bfdd876c3 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 @@ -38,7 +38,9 @@ object EstimatedItemValue { private val cache = mutableMapOf<ItemStack, List<List<Any>>>() private var lastToolTipTime = 0L var gemstoneUnlockCosts = HashMap<NEUInternalName, HashMap<String, List<String>>>() - var currentlyShowing = false + private var currentlyShowing = false + + fun isCurrentlyShowing() = currentlyShowing && Minecraft.getMinecraft().currentScreen != null @SubscribeEvent fun onRepoReload(event: RepositoryReloadEvent) { diff --git a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt index 331be034b..bc2db88e1 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt @@ -65,7 +65,7 @@ open class SkyHanniTracker<Data : TrackerData>( } fun renderDisplay(position: Position) { - if (config.hideInEstimatedItemValue && EstimatedItemValue.currentlyShowing) return + if (config.hideInEstimatedItemValue && EstimatedItemValue.isCurrentlyShowing()) return val currentlyOpen = Minecraft.getMinecraft().currentScreen is GuiInventory if (inventoryOpen != currentlyOpen) { |