From 35eea60d6d77681d5fc1964a3a1d29b531ee1e28 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 16 Dec 2023 16:54:33 +0100 Subject: [PATCH] Diana Chat hider. --- .../features/chat/FilterTypesConfig.java | 6 ++++++ .../event/diana/DianaProfitTracker.kt | 19 +++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/chat/FilterTypesConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/chat/FilterTypesConfig.java index f37e6670590d..d8f9304233b4 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/chat/FilterTypesConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/chat/FilterTypesConfig.java @@ -80,6 +80,12 @@ public class FilterTypesConfig { @FeatureToggle public boolean fireSale = true; + @Expose + @ConfigOption(name = "Diana", desc = "Hide chat messages around griffin burrow chains and griffin feather drops and coin drops.") + @ConfigEditorBoolean + @FeatureToggle + public boolean diana = false; + //TODO remove @Expose @ConfigOption(name = "Others", desc = "Hide other annoying messages.") diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaProfitTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaProfitTracker.kt index d6849e9aa43f..7563a7bc91e3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaProfitTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaProfitTracker.kt @@ -114,14 +114,29 @@ object DianaProfitTracker { @SubscribeEvent fun onChat(event: LorenzChatEvent) { - if (chatDugOutPattern.matches(event.message)) { + val message = event.message + if (chatDugOutPattern.matches(message)) { tracker.modify { it.burrowsDug++ } + tryHide(event) } - chatDugOutCoinsPattern.matchMatcher(event.message) { + chatDugOutCoinsPattern.matchMatcher(message) { val coins = group("coins").formatNumber().toInt() tracker.addCoins(coins) + tryHide(event) + } + + if (message == "§6§lRARE DROP! §r§eYou dug out a §r§9Griffin Feather§r§e!" || + message == "§eFollow the arrows to find the §r§6treasure§r§e!" + ) { + tryHide(event) + } + } + + private fun tryHide(event: LorenzChatEvent) { + if (SkyHanniMod.feature.chat.filterType.diana) { + event.blockedReason = "diana_chain_or_drops" } }