diff options
Diffstat (limited to 'src/main/java')
2 files changed, 11 insertions, 2 deletions
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 b66f06891..fdb029fa6 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 @@ -2,11 +2,13 @@ package at.hannibal2.skyhanni.features.event.hoppity import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.features.event.hoppity.HoppityEggsManager.getEggType +import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactoryAPI import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.DelayedRun import at.hannibal2.skyhanni.utils.NumberUtil import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher import at.hannibal2.skyhanni.utils.SimpleTimeMark.Companion.fromNow +import at.hannibal2.skyhanni.utils.TimeUtils.format import kotlin.time.Duration.Companion.milliseconds import kotlin.time.Duration.Companion.seconds @@ -20,6 +22,7 @@ object HoppityEggsCompactChat { private var newRabbit = false private var lastChatMeal: HoppityEggType? = null private var lastDuplicateAmount: Long? = null + private val config get() = ChocolateFactoryAPI.config fun compactChat(event: LorenzChatEvent, lastDuplicateAmount: Long? = null) { lastDuplicateAmount?.let { @@ -57,7 +60,12 @@ object HoppityEggsCompactChat { return if (duplicate) { val format = lastDuplicateAmount?.let { NumberUtil.format(it) } ?: "?" - "$mealName Egg! §7Duplicate $lastName §7(§6+$format Chocolate§7)" + val timeFormatted = lastDuplicateAmount?.let { + ChocolateFactoryAPI.timeUntilNeed(it).format(maxUnits = 2) + } ?: "?" + + val timeStr = if (config.showDuplicateTime) ", §a+§b$timeFormatted§7" else "" + "$mealName Egg! §7Duplicate $lastName §7(§6+$format Chocolate§7$timeStr)" } else if (newRabbit) { "$mealName Egg! §d§lNEW $lastName §7(${lastProfit}§7)" } else "?" diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryBarnManager.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryBarnManager.kt index 356794b7e..a8134cedf 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryBarnManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryBarnManager.kt @@ -18,6 +18,7 @@ import kotlin.time.Duration.Companion.seconds object ChocolateFactoryBarnManager { private val config get() = ChocolateFactoryAPI.config + private val hoppityConfig get() = HoppityEggsManager.config private val profileStorage get() = ChocolateFactoryAPI.profileStorage private val newRabbitPattern by ChocolateFactoryAPI.patternGroup.pattern( @@ -54,7 +55,7 @@ object ChocolateFactoryBarnManager { rabbitDuplicatePattern.matchMatcher(event.message) { HoppityEggsManager.shareWaypointPrompt() val amount = group("amount").formatLong() - if (config.showDuplicateTime) { + if (config.showDuplicateTime && !hoppityConfig.compactChat) { val format = ChocolateFactoryAPI.timeUntilNeed(amount).format(maxUnits = 2) DelayedRun.runNextTick { ChatUtils.chat("§7(§a+§b$format §aof production§7)") |