From 871d90100ba2cf45f6544220138a3d62433baf43 Mon Sep 17 00:00:00 2001 From: Alexia Luna Date: Tue, 26 Mar 2024 18:26:19 +0100 Subject: Improvement: Hide visitor Jacob messages without hiding real Jacob ones (#1267) --- .../skyhanni/config/features/garden/visitor/VisitorConfig.java | 2 +- .../skyhanni/features/garden/visitor/GardenVisitorFeatures.kt | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni') diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/garden/visitor/VisitorConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/garden/visitor/VisitorConfig.java index 098eddea1..ed1a65661 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/garden/visitor/VisitorConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/garden/visitor/VisitorConfig.java @@ -84,7 +84,7 @@ public class VisitorConfig { public boolean hypixelArrivedMessage = true; @Expose - @ConfigOption(name = "Hide Chat", desc = "Hide chat messages from the visitors in the garden. (Except Beth, Jacob and Spaceman)") + @ConfigOption(name = "Hide Chat", desc = "Hide chat messages from the visitors in the garden. (Except Beth and Spaceman)") @ConfigEditorBoolean @FeatureToggle public boolean hideChat = true; diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt index 82914c66f..f29fd4faf 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt @@ -89,7 +89,7 @@ class GardenVisitorFeatures { ) private val visitorChatMessagePattern by patternGroup.pattern( "visitorchat", - "§e\\[NPC] (§.)?(?.*)§f: §r.*" + "§e\\[NPC] (?§.)?(?.*)§f: §r.*" ) private val partialAcceptedPattern by patternGroup.pattern( "partialaccepted", @@ -476,8 +476,10 @@ class GardenVisitorFeatures { } private fun hideVisitorMessage(message: String) = visitorChatMessagePattern.matchMatcher(message) { + val color = group("color") + if (color == null || color == "§e") return false // Non-visitor NPC, probably Jacob + val name = group("name") - if (name == "Jacob") return false if (name == "Spaceman") return false if (name == "Beth") return false -- cgit