aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorCalMWolfs <94038482+CalMWolfs@users.noreply.github.com>2024-10-12 05:38:06 +1100
committerGitHub <noreply@github.com>2024-10-11 20:38:06 +0200
commitec9e3340cae5d42a6aa57e381d01f79a00b7ffd1 (patch)
tree61aa132e730cc8ffd11130283cbd7f54cce37ae7 /src/main
parent92291e61cbbdc05736288aef1743ee1c667da6fa (diff)
downloadskyhanni-ec9e3340cae5d42a6aa57e381d01f79a00b7ffd1.tar.gz
skyhanni-ec9e3340cae5d42a6aa57e381d01f79a00b7ffd1.tar.bz2
skyhanni-ec9e3340cae5d42a6aa57e381d01f79a00b7ffd1.zip
Fix: Make adding stars debug only (#2715)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt18
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt3
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
}