diff options
author | raaaaaven <168305416+raaaaaven@users.noreply.github.com> | 2024-05-06 16:10:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-06 17:10:57 +0200 |
commit | 91b84552e80f2868e5688f311f407def7186d502 (patch) | |
tree | b395470c1e4a242cc5ba63f5f2ff827d120911f1 /src/main/java | |
parent | 1a4b36a327841a9ed9d3f0006e00908d5bce643a (diff) | |
download | skyhanni-91b84552e80f2868e5688f311f407def7186d502.tar.gz skyhanni-91b84552e80f2868e5688f311f407def7186d502.tar.bz2 skyhanni-91b84552e80f2868e5688f311f407def7186d502.zip |
Feature: Hide solo class, solo class stats and fairy dialogue messages (#1702)
Co-authored-by: raven <raveeeennnn@hotmail.com>
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/dungeon/MessageFilterConfig.java | 18 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt | 24 |
2 files changed, 42 insertions, 0 deletions
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 /// <editor-fold desc="Regex Patterns & Messages"> // 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<String, List<Pattern>> = 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<String, List<String>> = 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 -> "" } |