aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-25 13:46:12 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-25 13:46:12 +0100
commit3f25c2c3dbd31adfe9a2b1b5dd2a996b05528d19 (patch)
treeb81318e824395095912caac9b7b74ac1fca96e32 /src/main/java
parente66eeae3cc2dbe16531e73f54909f27767f6af71 (diff)
downloadskyhanni-3f25c2c3dbd31adfe9a2b1b5dd2a996b05528d19.tar.gz
skyhanni-3f25c2c3dbd31adfe9a2b1b5dd2a996b05528d19.tar.bz2
skyhanni-3f25c2c3dbd31adfe9a2b1b5dd2a996b05528d19.zip
Fixed EstimatedItemValue.isCurrentlyShowing logic
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/ChestValue.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt2
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) {