aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni
diff options
context:
space:
mode:
authorStella <stellaarnott1@gmail.com>2024-09-29 01:06:40 -0700
committerGitHub <noreply@github.com>2024-09-29 10:06:40 +0200
commit1f4ce6c4207fe6ef6eaff48a35f61b18a524a429 (patch)
treee175900609bd639b4db7ed9bfbfcd0ffad51ceda /src/main/java/at/hannibal2/skyhanni
parent270e885ea9a7fc2efe40b9d91fa8de488c7bff53 (diff)
downloadskyhanni-1f4ce6c4207fe6ef6eaff48a35f61b18a524a429.tar.gz
skyhanni-1f4ce6c4207fe6ef6eaff48a35f61b18a524a429.tar.bz2
skyhanni-1f4ce6c4207fe6ef6eaff48a35f61b18a524a429.zip
Fix: Flare Display negative values in chat with lag (#2567)
Co-authored-by: Cal <cwolfson58@gmail.com> Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/combat/FlareDisplay.kt8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/FlareDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/FlareDisplay.kt
index fd2b513cf..5a67e1d34 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/combat/FlareDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/combat/FlareDisplay.kt
@@ -48,7 +48,7 @@ object FlareDisplay {
"ewogICJ0aW1lc3RhbXAiIDogMTY0NjY4NzMyNjQzMiwKICAicHJvZmlsZUlkIiA6ICI0MWQzYWJjMmQ3NDk0MDBjOTA5MGQ1NDM0ZDAzODMxYiIsCiAgInByb2ZpbGVOYW1lIiA6ICJNZWdha2xvb24iLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOWQyYmY5ODY0NzIwZDg3ZmQwNmI4NGVmYTgwYjc5NWM0OGVkNTM5YjE2NTIzYzNiMWYxOTkwYjQwYzAwM2Y2YiIKICAgIH0KICB9Cn0="
to FlareType.ALERT,
"ewogICJ0aW1lc3RhbXAiIDogMTY0NjY4NzM0NzQ4OSwKICAicHJvZmlsZUlkIiA6ICI0MWQzYWJjMmQ3NDk0MDBjOTA5MGQ1NDM0ZDAzODMxYiIsCiAgInByb2ZpbGVOYW1lIiA6ICJNZWdha2xvb24iLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzAwNjJjYzk4ZWJkYTcyYTZhNGI4OTc4M2FkY2VmMjgxNWI0ODNhMDFkNzNlYTg3YjNkZjc2MDcyYTg5ZDEzYiIKICAgIH0KICB9Cn0="
- to FlareType.SOS
+ to FlareType.SOS,
)
@SubscribeEvent
@@ -92,7 +92,8 @@ object FlareDisplay {
val name = type.displayName
if (newDisplay == null) {
newDisplay = buildList {
- add(Renderable.string("$name: §b${remainingTime.format()}"))
+ val displayTime = if (remainingTime.isNegative()) "§eSoon" else "§b${remainingTime.format()}"
+ add(Renderable.string("$name: $displayTime"))
if (config.showManaBuff) {
type.manaBuff?.let {
add(Renderable.string(" §b$it §7mana regen"))
@@ -100,7 +101,7 @@ object FlareDisplay {
}
}
}
- if (remainingTime > 5.seconds) continue
+ if (remainingTime !in 5.seconds..0.seconds) continue
val message = "$name §eexpires in: §b${remainingTime.inWholeSeconds}s"
when (config.alertType) {
FlareConfig.AlertType.CHAT -> {
@@ -194,7 +195,6 @@ object FlareDisplay {
SOS("§5SOS Flare", "+125%"),
ALERT("§9Alert Flare", "+50%"),
WARNING("§aWarning Flare", null),
- ;
}
private fun isEnabled() = LorenzUtils.inSkyBlock && config.enabled