aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorJ10a1n15 <45315647+j10a1n15@users.noreply.github.com>2024-09-28 21:54:47 +0200
committerGitHub <noreply@github.com>2024-09-28 21:54:47 +0200
commitc9938504234a1291ee53515bd296e75daeecbd3d (patch)
tree0668d19d90260d19e97cd666f3a3560ec8791045 /src/main
parent8a67b06c948ea35fee18853b7b19e2b0d064f60f (diff)
downloadskyhanni-c9938504234a1291ee53515bd296e75daeecbd3d.tar.gz
skyhanni-c9938504234a1291ee53515bd296e75daeecbd3d.tar.bz2
skyhanni-c9938504234a1291ee53515bd296e75daeecbd3d.zip
Fix: Custom Scoreboard Active Tablist Event (#2592)
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardEvent.kt20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardEvent.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardEvent.kt
index 3b3b6448b..68dba3eee 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardEvent.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardEvent.kt
@@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.features.gui.customscoreboard
import at.hannibal2.skyhanni.data.HypixelData
import at.hannibal2.skyhanni.data.IslandType
+import at.hannibal2.skyhanni.data.model.TabWidget
import at.hannibal2.skyhanni.features.combat.SpidersDenAPI.isAtTopOfNest
import at.hannibal2.skyhanni.features.dungeon.DungeonAPI
import at.hannibal2.skyhanni.features.gui.customscoreboard.CustomScoreboard.eventsConfig
@@ -13,6 +14,7 @@ import at.hannibal2.skyhanni.utils.CollectionUtils.nextAfter
import at.hannibal2.skyhanni.utils.LorenzUtils.inAdvancedMiningIsland
import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland
import at.hannibal2.skyhanni.utils.RegexUtils.anyMatches
+import at.hannibal2.skyhanni.utils.RegexUtils.firstMatcher
import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher
import at.hannibal2.skyhanni.utils.RegexUtils.matches
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
@@ -411,12 +413,9 @@ private fun getActiveEventLine(): List<String> {
val blockedEvents = listOf("Spooky Festival", "Carnival", "5th SkyBlock Anniversary", "New Year Celebration")
if (blockedEvents.contains(currentActiveEvent.removeColor())) return emptyList()
- val currentActiveEventTime = TabListData.getTabList().firstOrNull { SbPattern.eventTimeEndsPattern.matches(it) }
- ?.let {
- SbPattern.eventTimeEndsPattern.matchMatcher(it) {
- group("time")
- }
- }
+ val currentActiveEventTime = ScoreboardPattern.eventTimeEndsPattern.firstMatcher(TabWidget.EVENT.lines) {
+ group("time")
+ } ?: return emptyList()
return listOf(currentActiveEvent, " Ends in: §e$currentActiveEventTime")
}
@@ -426,12 +425,9 @@ private fun getActiveEventShowWhen(): Boolean =
private fun getSoonEventLine(): List<String> {
val soonActiveEvent = getTablistEvent() ?: return emptyList()
- val soonActiveEventTime = TabListData.getTabList().firstOrNull { SbPattern.eventTimeStartsPattern.matches(it) }
- ?.let {
- SbPattern.eventTimeStartsPattern.matchMatcher(it) {
- group("time")
- }
- }
+ val soonActiveEventTime = ScoreboardPattern.eventTimeStartsPattern.firstMatcher(TabWidget.EVENT.lines) {
+ group("time")
+ } ?: return emptyList()
return listOf(soonActiveEvent, " Starts in: §e$soonActiveEventTime")
}