diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-09-23 13:38:06 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-09-23 13:38:06 +0200 |
commit | a7b17939cca46fc5b0bdcd859df6da25caa143f2 (patch) | |
tree | b41fd9b0d1fea3ffddfe63e16d2fdb8919e595b1 | |
parent | f617d59f1c52ad77f23ce28fb14bf44986e38ed1 (diff) | |
download | skyhanni-a7b17939cca46fc5b0bdcd859df6da25caa143f2.tar.gz skyhanni-a7b17939cca46fc5b0bdcd859df6da25caa143f2.tar.bz2 skyhanni-a7b17939cca46fc5b0bdcd859df6da25caa143f2.zip |
code cleanup
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/chat/Translator.kt | 7 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/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<String, CooldownTimer>() + private val maskTimers = mutableMapOf<String, CooldownTimer>() // 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) { |