diff options
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt | 18 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt | 3 |
2 files changed, 12 insertions, 9 deletions
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 046325749..8b6697a41 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 @@ -3,6 +3,7 @@ package at.hannibal2.skyhanni.features.misc.items import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator +import at.hannibal2.skyhanni.config.features.misc.EstimatedItemValueConfig import at.hannibal2.skyhanni.data.jsonobjects.repo.ItemsJson import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.GuiRenderEvent @@ -39,7 +40,7 @@ import kotlin.math.roundToLong @SkyHanniModule object EstimatedItemValue { - val config get() = SkyHanniMod.feature.inventory.estimatedItemValues + val config: EstimatedItemValueConfig get() = SkyHanniMod.feature.inventory.estimatedItemValues private var display = emptyList<List<Any>>() private val cache = mutableMapOf<ItemStack, List<List<Any>>>() private var lastToolTipTime = 0L @@ -90,13 +91,14 @@ object EstimatedItemValue { currentlyShowing = checkCurrentlyVisible() if (!currentlyShowing) return - // TODO add "is debug enabled" check once users notice this easteregg - if (Keyboard.KEY_RIGHT.isKeyClicked()) { - EstimatedItemValueCalculator.starChange += 1 - cache.clear() - } else if (Keyboard.KEY_LEFT.isKeyClicked()) { - EstimatedItemValueCalculator.starChange -= 1 - cache.clear() + if (SkyHanniMod.feature.dev.debug.enabled) { + if (Keyboard.KEY_RIGHT.isKeyClicked()) { + EstimatedItemValueCalculator.starChange += 1 + cache.clear() + } else if (Keyboard.KEY_LEFT.isKeyClicked()) { + EstimatedItemValueCalculator.starChange -= 1 + cache.clear() + } } config.itemPriceDataPos.renderStringsAndItems(display, posLabel = "Estimated Item Value") diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt index fb1ce6b44..15c55e02e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt @@ -72,6 +72,7 @@ object EstimatedItemValueCalculator { private val kuudraSets = listOf("AURORA", "CRIMSON", "TERROR", "HOLLOW", "FERVOR") var starChange = 0 + get() = if (SkyHanniMod.feature.dev.debug.enabled) field else 0 private val additionalCostFunctions = listOf( ::addAttributeCost, @@ -449,7 +450,7 @@ object EstimatedItemValueCalculator { var totalStars = stack.getDungeonStarCount() ?: stack.getStarCount() ?: 0 starChange.takeIf { it != 0 }?.let { - list.add("change: $it") + list.add("[Debug] added stars: $it") totalStars += it } |