From a7b17939cca46fc5b0bdcd859df6da25caa143f2 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 23 Sep 2023 13:38:06 +0200 Subject: code cleanup --- .../java/at/hannibal2/skyhanni/features/chat/Translator.kt | 7 ++++--- .../skyhanni/features/inventory/HighlightBonzoMasks.kt | 14 +++++++------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/Translator.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/Translator.kt index 300f8805b..851adb45d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/Translator.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/Translator.kt @@ -29,13 +29,14 @@ class Translator { // Logic for listening for a user click on a chat message is from NotEnoughUpdates @SubscribeEvent(priority = EventPriority.LOWEST) - fun onGuiChat(e: LorenzChatEvent) { + fun onGuiChat(event: LorenzChatEvent) { if (!SkyHanniMod.feature.chat.translator) return - val message = e.message + val message = event.message if (message.getPlayerName() == "-") return - val editedComponent = if (e.chatComponent.siblings.size > 0) e.chatComponent.siblings.last() else e.chatComponent + val editedComponent = + if (event.chatComponent.siblings.size > 0) event.chatComponent.siblings.last() else event.chatComponent val clickStyle = createClickStyle(message.removeColor(), editedComponent.chatStyle) editedComponent.setChatStyle(clickStyle) diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/HighlightBonzoMasks.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/HighlightBonzoMasks.kt index 6c0be90d3..390ed408e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HighlightBonzoMasks.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HighlightBonzoMasks.kt @@ -22,17 +22,17 @@ import kotlin.time.Duration.Companion.seconds class HighlightBonzoMasks { private val config get() = SkyHanniMod.feature.itemAbilities - val maskTimers = mutableMapOf() + private val maskTimers = mutableMapOf() // Technically this timer is overestimating since mage level affects the cooldown, however I don't care. - val bonzoMaskCooldown = 360.seconds - val bonzoMaskMessage = "^Your (.*Bonzo's Mask) saved your life!$".toRegex() + private val bonzoMaskCooldown = 360.seconds + private val bonzoMaskMessage = "^Your (.*Bonzo's Mask) saved your life!$".toRegex() - val spiritMaskCooldown = 30.seconds - val spiritMaskMessage = "^Second Wind Activated! Your Spirit Mask saved your life!$".toRegex() + private val spiritMaskCooldown = 30.seconds + private val spiritMaskMessage = "^Second Wind Activated! Your Spirit Mask saved your life!$".toRegex() - val greenHue = Color.RGBtoHSB(0, 255, 0, null)[0].toDouble() - val redHue = Color.RGBtoHSB(255, 0, 0, null)[0].toDouble() + private val greenHue = Color.RGBtoHSB(0, 255, 0, null)[0].toDouble() + private val redHue = Color.RGBtoHSB(255, 0, 0, null)[0].toDouble() @SubscribeEvent fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { -- cgit