summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/mining
diff options
context:
space:
mode:
authorWalker Selby <git@walkerselby.com>2023-11-29 23:43:02 +0000
committerGitHub <noreply@github.com>2023-11-30 00:43:02 +0100
commit247d4d324dc9ce5960d8c94719707d232a89e3ad (patch)
treecbf6942c5875ed8fd8c24c54435aba5a514ce1b1 /src/main/java/at/hannibal2/skyhanni/features/mining
parented02a14a6d688ec9546d9ed06dddf412620bb246 (diff)
downloadskyhanni-247d4d324dc9ce5960d8c94719707d232a89e3ad.tar.gz
skyhanni-247d4d324dc9ce5960d8c94719707d232a89e3ad.tar.bz2
skyhanni-247d4d324dc9ce5960d8c94719707d232a89e3ad.zip
Migrate Integer to Enums in Config #727
Co-authored-by: hannibal2 <24389977+hannibal002@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/mining')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt
index fd4ad8962..63ae5763e 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt
@@ -2,12 +2,14 @@ package at.hannibal2.skyhanni.features.mining.powdertracker
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator
+import at.hannibal2.skyhanni.config.features.mining.PowderTrackerConfig.PowderDisplayEntry
import at.hannibal2.skyhanni.data.IslandType
import at.hannibal2.skyhanni.events.ConfigLoadEvent
import at.hannibal2.skyhanni.events.GuiRenderEvent
import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
+import at.hannibal2.skyhanni.utils.ConfigUtils
import at.hannibal2.skyhanni.utils.LorenzUtils.addAsSingletonList
import at.hannibal2.skyhanni.utils.LorenzUtils.afterChange
import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland
@@ -176,12 +178,16 @@ object PowderTracker {
event.move(8, "#profile.powderTracker", "#profile.powderTracker") { old ->
old.asJsonObject.get("0")
}
+ event.move(11, "mining.powderTracker.textFormat", "mining.powderTracker.textFormat") { element ->
+ ConfigUtils.migrateIntArrayListToEnumArrayList(element, PowderDisplayEntry::class.java)
+ }
}
private fun formatDisplay(map: List<List<Any>>) = buildList {
if (map.isEmpty()) return@buildList
for (index in config.textFormat.get()) {
- add(map[index])
+ // TODO, change functionality to use enum rather than ordinals
+ add(map[index.ordinal])
}
}