From 91b84552e80f2868e5688f311f407def7186d502 Mon Sep 17 00:00:00 2001 From: raaaaaven <168305416+raaaaaven@users.noreply.github.com> Date: Mon, 6 May 2024 16:10:57 +0100 Subject: Feature: Hide solo class, solo class stats and fairy dialogue messages (#1702) Co-authored-by: raven --- .../features/dungeon/MessageFilterConfig.java | 18 ++++++++++++++++ .../hannibal2/skyhanni/features/chat/ChatFilter.kt | 24 ++++++++++++++++++++++ 2 files changed, 42 insertions(+) (limited to 'src/main') diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/dungeon/MessageFilterConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/dungeon/MessageFilterConfig.java index 17bab0577..34fe05c52 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/dungeon/MessageFilterConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/dungeon/MessageFilterConfig.java @@ -11,4 +11,22 @@ public class MessageFilterConfig { @ConfigEditorBoolean @FeatureToggle public boolean keysAndDoors = false; + + @Expose + @ConfigOption(name = "Solo Class", desc = "Hide the message that sends when you play a class alone.") + @ConfigEditorBoolean + @FeatureToggle + public boolean soloClass = false; + + @Expose + @ConfigOption(name = "Solo Class Stats", desc = "Hide the boosted class stats when starting a dungeon.") + @ConfigEditorBoolean + @FeatureToggle + public boolean soloStats = false; + + @Expose + @ConfigOption(name= "Fairy Dialogue" , desc = "Hide the dialogue when a fairy is killed.") + @ConfigEditorBoolean + @FeatureToggle + public boolean fairy = false; } diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt index 79009a559..d59891902 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt @@ -3,6 +3,7 @@ package at.hannibal2.skyhanni.features.chat import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.LorenzChatEvent +import at.hannibal2.skyhanni.features.dungeon.DungeonAPI import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.StringUtils @@ -15,6 +16,7 @@ class ChatFilter { private val generalConfig get() = SkyHanniMod.feature.chat private val config get() = SkyHanniMod.feature.chat.filterType + private val dungeonConfig get() = SkyHanniMod.feature.dungeon.messageFilter /// // Lobby Messages @@ -369,6 +371,22 @@ class ChatFilter { "▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬", ) + // &r&6Your &r&aMage &r&6stats are doubled because you are the only player using this class!&r + private val soloClassPatterns = listOf( + "§6Your §r§a(Healer|Mage|Berserk|Archer|Tank) §r§6stats are doubled because you are the only player using this class!".toPattern() + ) + + private val soloStatsPatterns = listOf( + "§a\\[(Healer|Mage|Berserk|Archer|Tank)].*".toPattern() + ) + + // &r&dGenevieve the Fairy&r&f: You killed me! Take this &r&6Revive Stone &r&fso that my death is not in vain!&r + private val fairyPatterns = listOf( + "§d[\\w']+ the Fairy§r§f: You killed me! Take this §r§6Revive Stone §r§fso that my death is not in vain!".toPattern(), + "§d[\\w']+ the Fairy§r§f: You killed me! I'll revive you so that my death is not in vain!".toPattern(), + "§d[\\w']+ the Fairy§r§f: Have a great life!".toPattern() + ) + private val patternsMap: Map> = mapOf( "lobby" to lobbyPatterns, "warping" to warpingPatterns, @@ -386,6 +404,9 @@ class ChatFilter { "fire_sale" to fireSalePatterns, "event" to eventPatterns, "factory_upgrade" to factoryUpgradePatterns, + "solo_class" to soloClassPatterns, + "solo_stats" to soloStatsPatterns, + "fairy" to fairyPatterns, ) private val messagesMap: Map> = mapOf( @@ -445,6 +466,9 @@ class ChatFilter { config.factoryUpgrade && message.isPresent("factory_upgrade") -> "factory_upgrade" generalConfig.hideJacob && !GardenAPI.inGarden() && anitaFortunePattern.matches(message) -> "jacob_event" generalConfig.hideSkyMall && !LorenzUtils.inMiningIsland() && skymallPerkPattern.matches(message) -> "skymall" + dungeonConfig.soloClass && DungeonAPI.inDungeon() && message.isPresent("solo_class") -> "solo_class" + dungeonConfig.soloStats && DungeonAPI.inDungeon() && message.isPresent("solo_stats") -> "solo_stats" + dungeonConfig.fairy && DungeonAPI.inDungeon() && message.isPresent("fairy") -> "fairy" else -> "" } -- cgit