diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/ChatConfig.java | 27 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/chat/CompactSplashPotionMessage.kt | 23 |
2 files changed, 25 insertions, 25 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/ChatConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/ChatConfig.java index e2e67573f..5b770b9d1 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/ChatConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/ChatConfig.java @@ -119,7 +119,7 @@ public class ChatConfig { @Expose @ConfigOption(name = "Player Chat Symbols", desc = "") @Accordion - public ChatSymbols chatSymbols = new ChatSymbols(); + public CompactPotionConfig chatSymbols = new CompactPotionConfig(); public static class ChatSymbols { @@ -159,16 +159,23 @@ public class ChatConfig { //TODO jawbus + thunder @Expose - @ConfigOption(name = "Compact Potion Message", desc = "Shorten chat messages about player potion effects.") - @ConfigEditorBoolean - @FeatureToggle - public boolean compactPotionMessage = true; + @ConfigOption(name = "Compact Potion Messages", desc = "") + @Accordion + public CompactPotionConfig compactPotionMessages = new CompactPotionConfig(); - @Expose - @ConfigOption(name = "Clickable Potion Messages", desc = "Makes the Compact Potion message open the Potion effects menu on click.") - @ConfigEditorBoolean - @FeatureToggle - public boolean compactPotionClickableMessage = true; + public static class CompactPotionConfig { + + @Expose + @ConfigOption(name = "Enabled", desc = "Shorten chat messages about player potion effects.") + @ConfigEditorBoolean + @FeatureToggle + public boolean enabled = true; + + @Expose + @ConfigOption(name = "Clickable Chat Message", desc = "Makes the Compact Potion message open the Potion effects menu on click.") + @ConfigEditorBoolean + public boolean clickableChatMessage = true; + } @Expose @ConfigOption(name = "Compact Bestiary Message", desc = "Shorten the Bestiary level up message, showing additional information when hovering.") diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/CompactSplashPotionMessage.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/CompactSplashPotionMessage.kt index d9732079f..c823d83f0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/CompactSplashPotionMessage.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/CompactSplashPotionMessage.kt @@ -8,7 +8,7 @@ import at.hannibal2.skyhanni.utils.StringUtils.removeColor import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class CompactSplashPotionMessage { - private val config get() = SkyHanniMod.feature.chat + private val config get() = SkyHanniMod.feature.chat.compactPotionMessages private val potionEffectPattern = "§a§lBUFF! §fYou have gained §r(?<name>.*)§r§f! Press TAB or type /effects to view your active effects!".toPattern() @@ -19,40 +19,33 @@ class CompactSplashPotionMessage { @SubscribeEvent fun onChatMessage(event: LorenzChatEvent) { - if (!LorenzUtils.inSkyBlock || !config.compactPotionMessage) return + if (!LorenzUtils.inSkyBlock || !config.enabled) return potionEffectPattern.matchMatcher(event.message) { val name = group("name") sendMessage("§a§lPotion Effect! §r$name") - event.blockedReason = "blocked" + event.blockedReason = "compact_potion_effect" } potionSplashEffectOthersPattern.matchMatcher(event.message) { val playerName = group("playerName").removeColor() val effectName = group("effectName") - sendMessage( - "§a§lPotion Effect! §r$effectName by §b$playerName", - ) - event.blockedReason = "blocked" + sendMessage("§a§lPotion Effect! §r$effectName by §b$playerName") + event.blockedReason = "compact_potion_effect" } potionSplashEffectPattern.matchMatcher(event.message) { val name = group("name") sendMessage("§a§lPotion Effect! §r$name") - event.blockedReason = "blocked" + event.blockedReason = "compact_potion_effect" } } private fun sendMessage(message: String) { - if (config.compactPotionClickableMessage) { - LorenzUtils.hoverableChat( - message, - listOf("§eClick to view your potion effects."), - "/effects" - ) + if (config.clickableChatMessage) { + LorenzUtils.hoverableChat(message, listOf("§eClick to view your potion effects."), "/effects") } else { LorenzUtils.chat(message) - } } } |