diff options
author | Mikecraft1224 <85994411+Mikecraft1224@users.noreply.github.com> | 2024-05-26 13:30:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-26 13:30:19 +0200 |
commit | e78e440df6c071b2023c19ea311305e643378fb4 (patch) | |
tree | 5d532c49adb78bf165a64434ece1ae714dc580a8 /src/main/java | |
parent | 80c414d629cba4029198dbafb23941109ad9511b (diff) | |
download | skyhanni-e78e440df6c071b2023c19ea311305e643378fb4.tar.gz skyhanni-e78e440df6c071b2023c19ea311305e643378fb4.tar.bz2 skyhanni-e78e440df6c071b2023c19ea311305e643378fb4.zip |
Feature + Fix: Added new chat filters, Fixed: Healer Orb Pickup (#1750)
Diffstat (limited to 'src/main/java')
4 files changed, 33 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 9b1d7db80..76fb716da 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 @@ -99,6 +99,13 @@ public class FilterTypesConfig { @FeatureToggle public boolean factoryUpgrade = false; + @Expose + @ConfigOption(name = "Sacrifice", desc = "Hide sacrifice messages of other players.") + @ConfigEditorBoolean + @FeatureToggle + public boolean sacrifice = false; + + //TODO remove @Expose @ConfigOption(name = "Others", desc = "Hide other annoying messages.") 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 34fe05c52..0bb6d0b88 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 @@ -7,6 +7,12 @@ import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; public class MessageFilterConfig { @Expose + @ConfigOption(name = "Rare Drops", desc = "Hides the chat message when other players get rare drops from chests.") + @ConfigEditorBoolean + @FeatureToggle + public boolean rareDrops = false; + + @Expose @ConfigOption(name = "Keys and Doors", desc = "Hides the chat message when picking up keys or opening doors in Dungeons.") @ConfigEditorBoolean @FeatureToggle 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 c02a769e5..c183a142c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt @@ -355,6 +355,14 @@ class ChatFilter { "§7You will now produce §r§6.* Chocolate §r§7per click!".toPattern(), "§7You upgraded to §r§d.*?§r§7!".toPattern(), ) + /** + * REGEX-TEST: §c§lSACRIFICE! §r§6[MVP§r§d++§r§6] Mikecraft1224§r§f §r§eturned §r§6Young Dragon Boots §r§einto §r§d40 Dragon Essence§r§e! + * REGEX-TEST: §c§lBONUS LOOT! §r§eThey also received §r§5Ritual Residue §r§efrom their sacrifice! + */ + private val sacrificePatterns = listOf( + "§c§lSACRIFICE! (.*) §r§eturned (.*) §r§einto (.*) Dragon Essence§r§e!".toPattern(), + "§c§lBONUS LOOT! §r§eThey also received (.*) §r§efrom their sacrifice!".toPattern() + ) private val powderMiningMessages = listOf( "§aYou uncovered a treasure chest!", "§aYou received §r§f1 §r§aWishing Compass§r§a.", @@ -372,6 +380,13 @@ class ChatFilter { "▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬", ) + /** + * REGEX-TEST: §6§lRARE REWARD! §r§bLeebys §r§efound a §r§6Recombobulator 3000 §r§ein their Obsidian Chest§r§e! + */ + private val rareDropsMessages = listOf( + "§6§lRARE REWARD! (.*) §r§efound a (.*) §r§ein their (.*) Chest§r§e!".toPattern() + ) + // &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() @@ -405,6 +420,8 @@ class ChatFilter { "fire_sale" to fireSalePatterns, "event" to eventPatterns, "factory_upgrade" to factoryUpgradePatterns, + "sacrifice" to sacrificePatterns, + "rare_drops" to rareDropsMessages, "solo_class" to soloClassPatterns, "solo_stats" to soloStatsPatterns, "fairy" to fairyPatterns, @@ -465,8 +482,10 @@ class ChatFilter { config.eventLevelUp && (message.isPresent("event") || StringUtils.isEmpty(message)) -> "event" config.fireSale && (fireSalePattern.matches(message) || message.isPresent("fire_sale")) -> "fire_sale" config.factoryUpgrade && message.isPresent("factory_upgrade") -> "factory_upgrade" + config.sacrifice && message.isPresent("sacrifice") -> "sacrifice" generalConfig.hideJacob && !GardenAPI.inGarden() && anitaFortunePattern.matches(message) -> "jacob_event" generalConfig.hideSkyMall && !LorenzUtils.inMiningIsland() && skymallPerkPattern.matches(message) -> "skymall" + dungeonConfig.rareDrops && message.isPresent("rare_drops") -> "rare_drops" 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" diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonChatFilter.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonChatFilter.kt index 495ff56a9..381e179db 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonChatFilter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonChatFilter.kt @@ -130,8 +130,7 @@ class DungeonChatFilter { "§d(.*) the Fairy§r§f: You killed me! I'll revive you so that my death is not in vain!".toPattern(), "§d(.*) the Fairy§r§f: You killed me! I'll revive your friend §r(.*) §r§fso that my death is not in vain!".toPattern(), "§d(.*) the Fairy§r§f: Have a great life!".toPattern(), - "§c(.*) §r§eYou picked up a Ability Damage Orb from (.*) §r§ehealing you for §r§c(.*) §r§eand granting you +§r§c(.*)% §r§eAbility Damage for §r§b10 §r§eseconds.".toPattern(), - "§c(.*) §r§eYou picked up a Damage Orb from (.*) §r§ehealing you for §r§c(.*) §r§eand granting you +§r§c(.*)% §r§eDamage for §r§b10 §r§eseconds.".toPattern(), + "§c(.*) §r§eYou picked up a (.*) Orb from (.*) §r§ehealing you for §r§c(.*) §r§eand granting you +(.*)% §r§e(.*) for §r§b10 §r§eseconds.".toPattern(), "(.*) §r§ehas obtained §r§a§r§9Premium Flesh§r§e!".toPattern(), "§6§lRARE DROP! §r§9Beating Heart §r§b(.*)".toPattern(), "(.*) §r§ehas obtained §r§a§r§9Beating Heart§r§e!".toPattern() |