aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexia Luna <me@alexia.lol>2024-03-26 18:26:19 +0100
committerGitHub <noreply@github.com>2024-03-26 18:26:19 +0100
commit871d90100ba2cf45f6544220138a3d62433baf43 (patch)
treed11d3f8d170c2e6aefa070d51a66dd9319a16cb8
parentf60b9e4c0b71901b362b54959a729d03898aa838 (diff)
downloadskyhanni-871d90100ba2cf45f6544220138a3d62433baf43.tar.gz
skyhanni-871d90100ba2cf45f6544220138a3d62433baf43.tar.bz2
skyhanni-871d90100ba2cf45f6544220138a3d62433baf43.zip
Improvement: Hide visitor Jacob messages without hiding real Jacob ones (#1267)
-rw-r--r--docs/FEATURES.md2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/garden/visitor/VisitorConfig.java2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt6
3 files changed, 6 insertions, 4 deletions
diff --git a/docs/FEATURES.md b/docs/FEATURES.md
index 95ebbc79a..16169d3cb 100644
--- a/docs/FEATURES.md
+++ b/docs/FEATURES.md
@@ -545,7 +545,7 @@ Use `/sh` or `/skyhanni` to open the SkyHanni config in game.
is empty when fully filled and show a preview how these stats change when hovering over an upgrade
+ Hide crop money display, crop milestone display and garden visitor list while inside anita show, SkyMart or the
composter inventory
-+ Hide chat messages from the visitors in the garden. (Except Beth, Jacob and Spaceman)
++ Hide chat messages from the visitors in the garden. (Except Beth and Spaceman)
+ Show the average crop milestone in the crop milestone inventory.
+ **FF for Contest** - Show the minimum needed Farming Fortune for reaching a medal in the Jacob's Farming Contest
inventory.
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] (§.)?(?<name>.*)§f: §r.*"
+ "§e\\[NPC] (?<color>§.)?(?<name>.*)§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