aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/dulkirmod/utils
diff options
context:
space:
mode:
authoringlettronald <inglettronald@gmail.com>2023-04-18 12:46:19 -0500
committeringlettronald <inglettronald@gmail.com>2023-04-18 12:46:19 -0500
commit3586217aa1d08458d81a4eb15e5b38e42793f68b (patch)
tree435bf47a5a1b9033d4e6b0a2d5212e099039961f /src/main/kotlin/dulkirmod/utils
parente933913ebe88f6b465ee862374bbd26c57906cae (diff)
downloadDulkirMod-3586217aa1d08458d81a4eb15e5b38e42793f68b.tar.gz
DulkirMod-3586217aa1d08458d81a4eb15e5b38e42793f68b.tar.bz2
DulkirMod-3586217aa1d08458d81a4eb15e5b38e42793f68b.zip
change to location semantics
Diffstat (limited to 'src/main/kotlin/dulkirmod/utils')
-rw-r--r--src/main/kotlin/dulkirmod/utils/TablistUtils.kt14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/main/kotlin/dulkirmod/utils/TablistUtils.kt b/src/main/kotlin/dulkirmod/utils/TablistUtils.kt
index af4512b..8bad6be 100644
--- a/src/main/kotlin/dulkirmod/utils/TablistUtils.kt
+++ b/src/main/kotlin/dulkirmod/utils/TablistUtils.kt
@@ -13,7 +13,6 @@ val NetworkPlayerInfo.text: String
object TabListUtils {
var area: String = ""
var explosivity: Boolean = false
- var isInDungeons: Boolean = false
var maxVisitors: Boolean = false
var emptyComposter: Boolean = false
var gardenMilestone: String = ""
@@ -53,8 +52,8 @@ object TabListUtils {
fun parseTabEntries() {
// exploFlag is just telling the loop that the next line is the relevant tab entry
var exploFlag = false
+ var numVisitorsFlag = false
// dungeonFlag keeps track of whether we've found the in-dungeons state.
- var dungeonFlag = false
val scoreboardList: List<String> = fetchTabEntries().mapNotNull {
it.displayName?.unformattedText
}
@@ -71,9 +70,11 @@ object TabListUtils {
}
}
line == " Dungeon Stats" -> {
- isInDungeons = true
+ area = "Dungeon"
+ }
+ line.startsWith(" Time Left:") -> {
+ emptyComposter = (line.substring(12) == "INACTIVE")
}
- line == " Time Left: INACTIVE" -> emptyComposter = true
line.startsWith(" Milestone") -> gardenMilestone = line.substring(1)
line.startsWith(" Next Visitor:") -> {
timeTillNextVisitor = line.substring(15)
@@ -81,6 +82,7 @@ object TabListUtils {
}
line.startsWith("Visitors:") -> {
numVisitors = line.substring(11, 12).toInt() // TODO: FIX WHEN THEY ADD THE TENTH VISITOR
+ numVisitorsFlag = true
}
}
}
@@ -91,8 +93,8 @@ object TabListUtils {
if (area != "Garden") {
maxVisitors = false
}
- if (!isInDungeons) {
- isInDungeons = false
+ if (!numVisitorsFlag) {
+ numVisitors = 0
}
}
} \ No newline at end of file