aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-06-01 13:32:14 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-06-01 13:32:14 +0200
commit831ef83a74384f7bc89a469b8aa621df5a271e0a (patch)
tree8e3dd1a7e65a11e09cfbf833996fc3d96e546ecd /src/main/java/at/hannibal2/skyhanni
parent8b781f457d85e3142629268ba67913cb58574722 (diff)
downloadskyhanni-831ef83a74384f7bc89a469b8aa621df5a271e0a.tar.gz
skyhanni-831ef83a74384f7bc89a469b8aa621df5a271e0a.tar.bz2
skyhanni-831ef83a74384f7bc89a469b8aa621df5a271e0a.zip
using buildString
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/gui/BeaconPower.kt15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/BeaconPower.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/BeaconPower.kt
index 364a55d73..60ed3ed66 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/gui/BeaconPower.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/gui/BeaconPower.kt
@@ -108,15 +108,16 @@ object BeaconPower {
display = drawDisplay()
}
- private fun drawDisplay(): String {
- var text = "§eBeacon: "
- if (expiryTime.isInPast()) text += "§cNot active"
- else {
- text += "§b${expiryTime.timeUntil().format(maxUnits = 2)}"
- if (config.beaconPowerStat) text += " §7(" + (stat ?: "§cNo stat") + "§7)"
+ private fun drawDisplay(): String = buildString {
+ append("§eBeacon: ")
+ if (expiryTime.isInPast()) {
+ append("§cNot active")
+ } else {
+ append("§b${expiryTime.timeUntil().format(maxUnits = 2)}")
+ if (config.beaconPowerStat) append(" §7(${stat ?: "§cNo stat"}§7)")
}
- return text
}
+
private fun isEnabled() = LorenzUtils.inSkyBlock && config.beaconPower
}