diff options
author | Kendell R <KTibow@users.noreply.github.com> | 2022-05-29 12:39:36 -0700 |
---|---|---|
committer | Kendell R <KTibow@users.noreply.github.com> | 2022-05-29 12:41:30 -0700 |
commit | 93a32bbbd183cf45af10a7fbe9a5238585eb442e (patch) | |
tree | 6ea38aeaca53beb1584007ae8268dcbe905269ee /src/main/kotlin/cc/woverflow/chatting/config | |
parent | 5da5f6efd284076b65d1811f13e1b4825c34d2db (diff) | |
download | Chatting-93a32bbbd183cf45af10a7fbe9a5238585eb442e.tar.gz Chatting-93a32bbbd183cf45af10a7fbe9a5238585eb442e.tar.bz2 Chatting-93a32bbbd183cf45af10a7fbe9a5238585eb442e.zip |
spam block v2
Diffstat (limited to 'src/main/kotlin/cc/woverflow/chatting/config')
-rw-r--r-- | src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt | 101 |
1 files changed, 72 insertions, 29 deletions
diff --git a/src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt b/src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt index 1a936c9..3041af8 100644 --- a/src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt +++ b/src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt @@ -17,7 +17,11 @@ import java.awt.Color import java.io.File object ChattingConfig : - Vigilant(File(Chatting.modDir, "${Chatting.ID}.toml"), Chatting.NAME, sortingBehavior = ConfigSorting) { + Vigilant( + File(Chatting.modDir, "${Chatting.ID}.toml"), + Chatting.NAME, + sortingBehavior = ConfigSorting + ) { @Property( type = PropertyType.SELECTOR, @@ -73,7 +77,8 @@ object ChattingConfig : @Property( type = PropertyType.SWITCH, name = "Inform for Alternatives", - description = "Inform the user if a mod they are using can be replaced by a feature in Chatting.", + description = + "Inform the user if a mod they are using can be replaced by a feature in Chatting.", category = "General" ) var informForAlternatives = true @@ -98,6 +103,40 @@ object ChattingConfig : */ @Property( + type = PropertyType.SLIDER, + min = 80, + max = 100, + name = "Spam Blocker Threshold", + description = + "If Chatting detects a public chat message that seems like spam, and the probability is higher than this, it will hide it.\n" + + "Made for Hypixel Skyblock. Set to 100% to disable. 95% is a reasonable threshold to use it at.\n" + + "Note that this is not and never will be 100% accurate; however, it's pretty much guaranteed to block most spam.", + category = "Player Chats" + ) + var spamThreshold = 100 + + @Property( + type = PropertyType.SWITCH, + name = "Custom Chat Formatting", + description = + "Reformat all Skyblock chat messages. Example:\n" + + "§a[VIP] Person§f: Message\n§7Person2: Message\n" + + "§eBecomes:\n" + + "§aPerson§f: Message\n§7Person2§f: Message", + category = "Player Chats" + ) + var customChatFormatting = false + + @Property( + type = PropertyType.SWITCH, + name = "Hide Spam", + description = + "When Chatting detects spam (if it's enabled), hide it instead of just graying it out.", + category = "Player Chats" + ) + var hideSpam = false + + @Property( type = PropertyType.SWITCH, name = "Custom Chat Height", description = "Allows you to change the height of chat to heights greater than before.", @@ -143,7 +182,10 @@ object ChattingConfig : var chatSearch = true @Property( - type = PropertyType.SWITCH, name = "Chat Tabs", description = "Add chat tabs.", category = "Tabs" + type = PropertyType.SWITCH, + name = "Chat Tabs", + description = "Add chat tabs.", + category = "Tabs" ) var chatTabs = true get() { @@ -164,7 +206,10 @@ object ChattingConfig : var hypixelOnlyChatTabs = true @Property( - type = PropertyType.SWITCH, name = "Chat Shortcuts", description = "Add chat shortcuts.", category = "Shortcuts" + type = PropertyType.SWITCH, + name = "Chat Shortcuts", + description = "Add chat shortcuts.", + category = "Shortcuts" ) var chatShortcuts = false get() { @@ -198,26 +243,27 @@ object ChattingConfig : chatTabs = funny ChatTabs.initialize() if (!funny) { - val dummy = ChatTab( - true, - "ALL", - false, - false, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - TabButton.color, - TabButton.hoveredColor, - TabButton.selectedColor, - "" - ) + val dummy = + ChatTab( + true, + "ALL", + false, + false, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + TabButton.color, + TabButton.hoveredColor, + TabButton.selectedColor, + "" + ) dummy.initialize() ChatTabs.currentTab = dummy } else { @@ -228,16 +274,13 @@ object ChattingConfig : chatShortcuts = funny ChatShortcuts.initialize() } - //addDependency("showTimestampHover", "showTimestamp") + // addDependency("showTimestampHover", "showTimestamp") } private object ConfigSorting : SortingBehavior() { override fun getCategoryComparator(): Comparator<in Category> = Comparator { o1, o2 -> if (o1.name == "General") return@Comparator -1 - if (o2.name == "General") return@Comparator 1 - else compareValuesBy(o1, o2) { - it.name - } + if (o2.name == "General") return@Comparator 1 else compareValuesBy(o1, o2) { it.name } } } } |