diff options
author | David Cole <40234707+DavidArthurCole@users.noreply.github.com> | 2024-08-25 18:30:44 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-26 00:30:44 +0200 |
commit | 560af1582429c4a0efd588820e9a273879b1e098 (patch) | |
tree | a1d26b824a8f5d1eedb12a21ab30a511b22a7f50 | |
parent | f1ad84c1976fc8f0aede4ec8c93f2ea289bffebd (diff) | |
download | skyhanni-560af1582429c4a0efd588820e9a273879b1e098.tar.gz skyhanni-560af1582429c4a0efd588820e9a273879b1e098.tar.bz2 skyhanni-560af1582429c4a0efd588820e9a273879b1e098.zip |
Feature & Fix: No Rarity on Compacted Dupes (#2383)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/event/HoppityEggsConfig.java | 25 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt | 10 |
2 files changed, 33 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/event/HoppityEggsConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/event/HoppityEggsConfig.java index 5536d5691..010434990 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/event/HoppityEggsConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/event/HoppityEggsConfig.java @@ -156,6 +156,31 @@ public class HoppityEggsConfig { public boolean compactChat = false; @Expose + @ConfigOption(name = "Compacted Rarity", desc = "Show rarity of found rabbit in Compacted chat messages.") + @ConfigEditorBoolean + @FeatureToggle + public CompactRarityTypes rarityInCompact = CompactRarityTypes.NEW; + + public enum CompactRarityTypes { + NONE("Neither"), + NEW("New Rabbits"), + DUPE("Duplicate Rabbits"), + BOTH("New & Duplicate Rabbits") + ; + + private final String name; + + CompactRarityTypes(String name) { + this.name = name; + } + + @Override + public String toString() { + return name; + } + } + + @Expose @ConfigOption( name = "Rabbit Pet Warning", desc = "Warn when using the Egglocator without a §d§lMythic Rabbit Pet §7equipped. " + diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt index 91316dbfc..35f87d7da 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.event.hoppity +import at.hannibal2.skyhanni.config.features.event.HoppityEggsConfig import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.features.event.hoppity.HoppityEggsManager.getEggType import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactoryAPI @@ -13,6 +14,8 @@ import at.hannibal2.skyhanni.utils.TimeUtils.format import kotlin.time.Duration.Companion.milliseconds import kotlin.time.Duration.Companion.seconds +typealias RarityType = HoppityEggsConfig.CompactRarityTypes + object HoppityEggsCompactChat { private var hoppityEggChat = mutableListOf<String>() @@ -66,16 +69,19 @@ object HoppityEggsCompactChat { val mealName = lastChatMeal?.coloredName ?: "" val mealNameFormatted = if (rabbitBought) "§aBought Rabbit" else "$mealName Egg" + val rarityConfig = HoppityEggsManager.config.rarityInCompact return if (duplicate) { val format = lastDuplicateAmount?.shortFormat() ?: "?" val timeFormatted = lastDuplicateAmount?.let { ChocolateFactoryAPI.timeUntilNeed(it).format(maxUnits = 2) } ?: "?" + val showDupeRarity = rarityConfig.let { it == RarityType.BOTH || it == RarityType.DUPE } val timeStr = if (config.showDuplicateTime) ", §a+§b$timeFormatted§7" else "" - "$mealNameFormatted! §7Duplicate $lastName §7(§6+$format Chocolate§7$timeStr)" + "$mealNameFormatted! §7Duplicate ${if (showDupeRarity) "$lastRarity " else ""}$lastName §7(§6+$format Chocolate§7$timeStr)" } else if (newRabbit) { - "$mealNameFormatted! §d§lNEW $lastRarity $lastName §7(${lastProfit}§7)" + val showNewRarity = rarityConfig.let { it == RarityType.BOTH || it == RarityType.NEW } + "$mealNameFormatted! §d§lNEW ${if (showNewRarity) "$lastRarity " else ""}$lastName §7(${lastProfit}§7)" } else "?" } |