diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-05-18 18:45:07 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-05-18 18:45:07 +0200 |
commit | 71a4298a7b3770b238a84c0866b0ff0ce56f0578 (patch) | |
tree | 949ee0cf92a047e76bc5538520d632db4c1af5d4 /src/main/java/at/hannibal2 | |
parent | 6fd2c2e4242dfc1980ebfdc657919840b127d52b (diff) | |
download | skyhanni-71a4298a7b3770b238a84c0866b0ff0ce56f0578.tar.gz skyhanni-71a4298a7b3770b238a84c0866b0ff0ce56f0578.tar.bz2 skyhanni-71a4298a7b3770b238a84c0866b0ff0ce56f0578.zip |
Added profile id chat hider
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/Chat.java | 6 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt | 9 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Chat.java b/src/main/java/at/hannibal2/skyhanni/config/features/Chat.java index 5ec5e018c..bd60e0eee 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Chat.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Chat.java @@ -77,6 +77,12 @@ public class Chat { @ConfigAccordionId(id = 0) public boolean watchDog = true; + @Expose + @ConfigOption(name = "Profile Join", desc = "Hide 'You are playing on profile' and 'Profile ID' chat messages") + @ConfigEditorBoolean + @ConfigAccordionId(id = 0) + public boolean profileJoin = true; + //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 c106d5a2f..37b61d5a3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt @@ -28,8 +28,8 @@ class ChatFilter { friendJoin(message) && config.friendJoinLeft -> "friend_join" killCombo(message) && config.killCombo -> "kill_combo" watchdogAnnouncement(message) && config.watchDog -> "watchdog" + profileJoin(message) && config.profileJoin -> "profile_join" - message.startsWith("§aYou are playing on profile: §e") && config.others -> "profile"//TODO move into own class bazaarAndAHMiniMessages(message) && config.others -> "bz_ah_minis" slayer(message) && config.others -> "slayer" slayerDrop(message) && config.others -> "slayer_drop" @@ -227,6 +227,13 @@ class ChatFilter { else -> false } + private fun profileJoin(message: String) = when { + message.startsWith("§aYou are playing on profile: §e") -> true + message.startsWith("§8Profile ID: ") -> true + + else -> false + } + private fun bazaarAndAHMiniMessages(message: String) = when (message) { "§7Putting item in escrow...", "§7Putting coins in escrow...", |