summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/fishing
diff options
context:
space:
mode:
authorWalker Selby <git@walkerselby.com>2023-12-11 13:59:52 -0800
committerGitHub <noreply@github.com>2023-12-11 22:59:52 +0100
commitd5b4a817e2b9e7e5c88eb0c8212b9a6e678bd92f (patch)
treebc07923686b77da759b3f12ea535f2e3c02deead /src/main/java/at/hannibal2/skyhanni/features/fishing
parentb8ec689ce9bd6fe89e4b825a988edb63fb51b5ab (diff)
downloadskyhanni-d5b4a817e2b9e7e5c88eb0c8212b9a6e678bd92f.tar.gz
skyhanni-d5b4a817e2b9e7e5c88eb0c8212b9a6e678bd92f.tar.bz2
skyhanni-d5b4a817e2b9e7e5c88eb0c8212b9a6e678bd92f.zip
Internal: Migrate Deprecated Config Values to Enums (#790)
Migrate Deprecated Config Values to Enums. #790
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/fishing')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishMessages.kt11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishMessages.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishMessages.kt
index b1abdc2d5..cd3af1f77 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishMessages.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishMessages.kt
@@ -2,9 +2,11 @@ package at.hannibal2.skyhanni.features.fishing.trophy
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator
+import at.hannibal2.skyhanni.config.features.fishing.trophyfishing.ChatMessagesConfig.DesignFormat
import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.features.fishing.trophy.TrophyFishManager.fishes
import at.hannibal2.skyhanni.features.fishing.trophy.TrophyFishManager.getTooltip
+import at.hannibal2.skyhanni.utils.ConfigUtils
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.LorenzUtils.addOrPut
import at.hannibal2.skyhanni.utils.LorenzUtils.sumAllValues
@@ -42,7 +44,7 @@ class TrophyFishMessages {
val amount = trophyFishCounts.addOrPut(rarity, 1)
event.blockedReason = "trophy_fish"
- if (config.enabled && config.design == 0 && amount == 1) {
+ if (config.enabled && config.design == DesignFormat.STYLE_1 && amount == 1) {
LorenzUtils.chat("§6§lTROPHY FISH! §c§lFIRST §r$displayRarity $displayName", prefix = false)
return
}
@@ -57,8 +59,8 @@ class TrophyFishMessages {
val component = ChatComponentText(
if (config.enabled) {
"§6§lTROPHY FISH! " + when (config.design) {
- 0 -> "§7$amount. §r$displayRarity $displayName$totalText"
- 1 -> "§bYou caught a $displayName $displayRarity§b. §7(${amount.addSeparators()})$totalText"
+ DesignFormat.STYLE_1 -> "§7$amount. §r$displayRarity $displayName$totalText"
+ DesignFormat.STYLE_2 -> "§bYou caught a $displayName $displayRarity§b. §7(${amount.addSeparators()})$totalText"
else -> "§bYou caught your ${amount.addSeparators()}${amount.ordinal()} $displayRarity $displayName§b.$totalText"
}
} else event.message
@@ -84,5 +86,8 @@ class TrophyFishMessages {
event.move(2, "fishing.trophyFishDuplicateHider", "fishing.trophyFishing.chatMessages.duplicateHider")
event.move(2, "fishing.trophyFishBronzeHider", "fishing.trophyFishing.chatMessages.bronzeHider")
event.move(2, "fishing.trophyFishSilverHider", "fishing.trophyFishing.chatMessages.silverHider")
+ event.transform(14, "fishing.trophyFishing.chatMessages.design") { element ->
+ ConfigUtils.migrateIntToEnum(element, DesignFormat::class.java)
+ }
}
}