From ec9e3340cae5d42a6aa57e381d01f79a00b7ffd1 Mon Sep 17 00:00:00 2001 From: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> Date: Sat, 12 Oct 2024 05:38:06 +1100 Subject: Fix: Make adding stars debug only (#2715) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../skyhanni/features/misc/items/EstimatedItemValue.kt | 18 ++++++++++-------- .../misc/items/EstimatedItemValueCalculator.kt | 3 ++- 2 files changed, 12 insertions(+), 9 deletions(-) (limited to 'src/main') 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>() private val cache = mutableMapOf>>() 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 } -- cgit