aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobotHanzo <36107150+RobotHanzo@users.noreply.github.com>2024-04-28 17:14:48 +0800
committerGitHub <noreply@github.com>2024-04-28 11:14:48 +0200
commite759f4a5d7b2e574cd6b3f3171eac71de90248b9 (patch)
tree7422f3eb8f663c6adb8ad4383bac0f55b4917411 /src
parent58f56fd71d73255f8fa9c0de5ed7b0ea5079834e (diff)
downloadskyhanni-e759f4a5d7b2e574cd6b3f3171eac71de90248b9.tar.gz
skyhanni-e759f4a5d7b2e574cd6b3f3171eac71de90248b9.tar.bz2
skyhanni-e759f4a5d7b2e574cd6b3f3171eac71de90248b9.zip
Improvement: New Chat Filter: Factory Upgrade (#1574)
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/chat/FilterTypesConfig.java6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt7
2 files changed, 13 insertions, 0 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 37bce7bca..37172b970 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
@@ -92,6 +92,12 @@ public class FilterTypesConfig {
@FeatureToggle
public boolean diana = false;
+ @Expose
+ @ConfigOption(name = "Factory Upgrade", desc = "Hide chocolate factory upgrade and employee promotion messages.")
+ @ConfigEditorBoolean
+ @FeatureToggle
+ public boolean factoryUpgrade = false;
+
//TODO remove
@Expose
@ConfigOption(name = "Others", desc = "Hide other annoying messages.")
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 a09a8d6f7..79009a559 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt
@@ -347,6 +347,11 @@ class ChatFilter {
"§f +§r§7You earned §r§.* Event Silver§r§7!".toPattern(),
"§f +§r§.§k#§r§. LEVEL UP! §r§.§k#".toPattern(),
)
+ private val factoryUpgradePatterns = listOf(
+ "§.* §r§7has been promoted to §r§7\\[.*§r§7] §r§.*§r§7!".toPattern(),
+ "§7Your §r§aRabbit Barn §r§7capacity has been increased to §r§a.* Rabbits§r§7!".toPattern(),
+ "§7You will now produce §r§6.* Chocolate §r§7per click!".toPattern()
+ )
private val powderMiningMessages = listOf(
"§aYou uncovered a treasure chest!",
"§aYou received §r§f1 §r§aWishing Compass§r§a.",
@@ -380,6 +385,7 @@ class ChatFilter {
"powder_mining" to powderMiningPatterns,
"fire_sale" to fireSalePatterns,
"event" to eventPatterns,
+ "factory_upgrade" to factoryUpgradePatterns,
)
private val messagesMap: Map<String, List<String>> = mapOf(
@@ -436,6 +442,7 @@ class ChatFilter {
config.powderMining && message.isPresent("powder_mining") -> "powder_mining"
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"
generalConfig.hideJacob && !GardenAPI.inGarden() && anitaFortunePattern.matches(message) -> "jacob_event"
generalConfig.hideSkyMall && !LorenzUtils.inMiningIsland() && skymallPerkPattern.matches(message) -> "skymall"