aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-05-01 15:40:58 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-05-01 15:40:58 +0200
commit29a4ef26301b92805d30849684362c2c65082197 (patch)
tree2fbd055e93f0c5865759bf27312ba7898e43fbe8
parente3368e8bbc579d616951f045a596eae423b601eb (diff)
downloadskyhanni-29a4ef26301b92805d30849684362c2c65082197.tar.gz
skyhanni-29a4ef26301b92805d30849684362c2c65082197.tar.bz2
skyhanni-29a4ef26301b92805d30849684362c2c65082197.zip
Hiding chat border messages as well for compact bingo
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bingo/CompactBingoChat.kt54
1 files changed, 26 insertions, 28 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/CompactBingoChat.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/CompactBingoChat.kt
index bb1721397..d043c2364 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/bingo/CompactBingoChat.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/CompactBingoChat.kt
@@ -19,39 +19,39 @@ class CompactBingoChat {
if (!LorenzUtils.isBingoProfile) return
if (!SkyHanniMod.feature.bingo.compactChatMessages) return
- onSkillLevelUp(event)
- onCollectionLevelUp(event)
- onNewAreaDiscovered(event)
- onBestiarityUpgrade(event)
+ if (onSkillLevelUp(event.message)) event.blockedReason = "compact_skill_level_up"
+ if (onCollectionLevelUp(event.message)) event.blockedReason = "compact_collection_level_up"
+ if (onNewAreaDiscovered(event.message)) event.blockedReason = "compact_new_area_discovered"
+ if (onBestiarityUpgrade(event.message)) event.blockedReason = "compact_skill_level_up"
}
- private fun onSkillLevelUp(event: LorenzChatEvent) {
- val message = event.message
+ private fun onSkillLevelUp(message: String): Boolean {
if (message.startsWith(" §r§b§lSKILL LEVEL UP ")) {
blockedSkillLevelUp = true
- return
+ return false
}
if (message == "§3§l▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬") {
blockedSkillLevelUp = false
- return
+ return true
}
if (blockedSkillLevelUp) {
if (!message.contains("Access to") && !message.endsWith(" Enchantment")) {
- event.blockedReason = "compact skill level up"
+ return true
}
}
+
+ return false
}
- private fun onCollectionLevelUp(event: LorenzChatEvent) {
- val message = event.message
+ private fun onCollectionLevelUp(message: String): Boolean {
if (message.startsWith(" §r§6§lCOLLECTION LEVEL UP ")) {
blockedCollectionLevelUp = true
- return
+ return false
}
if (message == "§e§l▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬") {
blockedCollectionLevelUp = false
- return
+ return true
}
if (blockedCollectionLevelUp) {
@@ -61,54 +61,52 @@ class CompactBingoChat {
collectionLevelUpLastLine?.let { LorenzUtils.chat(it) }
}
} else {
- event.blockedReason = "compact collection level up"
collectionLevelUpLastLine = message
+ return true
}
}
- }
- private fun onNewAreaDiscovered(event: LorenzChatEvent) {
- var message = event.message
+ return false
+ }
+ private fun onNewAreaDiscovered(message: String): Boolean {
if (message == " §r§6§lNEW AREA DISCOVERED!") {
newArea = 1
println("new area $newArea $message")
- return
+ return false
}
if (message != "") {
if (newArea == 1) {
newArea = 2
println("new area $newArea $message")
- return
+ return false
}
if (newArea == 2) {
if (message.startsWith("§7 ■ §r") || message.startsWith(" §r")) {
- event.blockedReason = "compact new area discovered"
+ return true
} else {
newArea = 0
println("new area $newArea $message")
}
}
}
+ return false
}
- private fun onBestiarityUpgrade(event: LorenzChatEvent) {
- val message = event.message
- if (message.contains("§r§6§lBESTIARY MILESTONE")) return
+ private fun onBestiarityUpgrade(message: String): Boolean {
+ if (message.contains("§r§6§lBESTIARY MILESTONE")) return false
if (message.startsWith(" §r§3§lBESTIARY §b§l")) {
blockedBestiarity = true
- return
+ return false
}
if (message == "§3§l▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬") {
blockedBestiarity = false
- return
+ return true
}
- if (blockedBestiarity) {
- event.blockedReason = "compact bestiarity upgrade"
- }
+ return blockedBestiarity
}
} \ No newline at end of file