aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-06-23 00:08:22 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-06-23 00:08:22 +0200
commit86fe9ce47707cc59f25b78082aff7962d107d95a (patch)
tree0a3d9f2a30b6e46bd5473b327b602ff1421a4894 /src/main/java/at/hannibal2
parentd2789b6938fa5db55b7d4fe258c48cacfab1f35d (diff)
downloadskyhanni-86fe9ce47707cc59f25b78082aff7962d107d95a.tar.gz
skyhanni-86fe9ce47707cc59f25b78082aff7962d107d95a.tar.bz2
skyhanni-86fe9ce47707cc59f25b78082aff7962d107d95a.zip
Fixed maxed rift time being off after teleporting out of wizard portal using Intruder/Porhtal
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/RiftAgaricusCap.kt1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/RiftTimer.kt18
2 files changed, 11 insertions, 8 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAgaricusCap.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAgaricusCap.kt
index 0b9bc9fbc..c4b452396 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAgaricusCap.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAgaricusCap.kt
@@ -63,7 +63,6 @@ class RiftAgaricusCap {
val countDown = System.currentTimeMillis() - startTime
val format = TimeUtils.formatDuration(countDown - 1000, showMilliSeconds = true)
-
event.drawDynamicText(location, "§b$format", 1.5)
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftTimer.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftTimer.kt
index ffe8097c1..3901d8370 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftTimer.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftTimer.kt
@@ -32,7 +32,7 @@ class RiftTimer {
val message = event.message
" §r§7You have §r§a(?<time>.*)ф §r§7left before the rift collapses!".toPattern().matchMatcher(message) {
val time = group("time")
- maxTime = formatTime(time)
+ maxTime = getTime(time)
}
}
@@ -45,23 +45,27 @@ class RiftTimer {
"§(?<color>[a7])(?<time>.*)ф Left.*".toPattern().matchMatcher(entry) {
val color = group("color")
if (color == "7") {
- display = emptyList()
+ val currentTime = getTime(group("time"))
+ if (currentTime > maxTime) {
+ maxTime = currentTime
+ update(currentTime)
+ }
return
}
- val time = group("time")
- val currentTime = formatTime(time)
- update(currentTime)
+ update(getTime(group("time")))
}
}
}
- private fun formatTime(time: String) = TimeUtils.getMillis(time.replace("m", "m "))
+ private fun getTime(time: String) = TimeUtils.getMillis(time.replace("m", "m "))
private fun update(currentTime: Long) {
if (currentTime == latestTime) return
val diff = (currentTime - latestTime) + 1000
latestTime = currentTime
- addDiff(diff)
+ if (latestTime != maxTime) {
+ addDiff(diff)
+ }
val currentFormat = TimeUtils.formatDuration(currentTime)
val percentage = LorenzUtils.formatPercentage(currentTime.toDouble() / maxTime)