Skip to content

Commit

Permalink
using buildString
Browse files Browse the repository at this point in the history
  • Loading branch information
hannibal002 committed Jun 1, 2024
1 parent 8b781f4 commit 831ef83
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/main/java/at/hannibal2/skyhanni/features/gui/BeaconPower.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 831ef83

Please sign in to comment.