aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-03-24 23:54:35 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-03-24 23:54:35 +0100
commit5fc17e42b1a30c507a4db5dc06711214cbec908c (patch)
tree4d612f3b0bca073d0b2a9e06524ef3063a07db3a
parenta61a3d9ff1c1e2b23596e1d185c48b1f3b48dbcf (diff)
downloadSkyHanni-5fc17e42b1a30c507a4db5dc06711214cbec908c.tar.gz
SkyHanni-5fc17e42b1a30c507a4db5dc06711214cbec908c.tar.bz2
SkyHanni-5fc17e42b1a30c507a4db5dc06711214cbec908c.zip
Hide elite farming leaderboard eta time when not farming
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/EliteFarmingWeight.kt19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/EliteFarmingWeight.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/EliteFarmingWeight.kt
index b62bffb25..612bebfbc 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/EliteFarmingWeight.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/EliteFarmingWeight.kt
@@ -160,7 +160,9 @@ class EliteFarmingWeight {
val weightUntilOvertake = nextPlayerWeight - totalWeight
if (weightUntilOvertake < 0) {
if (!hasPassedNext) {
- LorenzUtils.chat("§e[SkyHanni] You passed §b$nextName §ein the Farming Weight Leaderboard!")
+ if (weightPerSecond != -1.0) {
+ LorenzUtils.chat("§e[SkyHanni] You passed §b$nextName §ein the Farming Weight Leaderboard!")
+ }
if (leaderboardPosition == -1) {
leaderboardPosition = 1000
} else {
@@ -174,13 +176,14 @@ class EliteFarmingWeight {
if (nextPlayerWeight == 0.0) {
return "§cRejoin the garden to show ETA!"
}
- val timeTillOvertake = (weightUntilOvertake / weightPerSecond) * 1000
- val timeFormat = TimeUtils.formatDuration(timeTillOvertake.toLong())
-
- val format = LorenzUtils.formatDouble(weightUntilOvertake, 2)
-
- // TODO Maybe add next player name?
- return "§e$format §7(§b$timeFormat§7) §7behind §b$nextName"
+ val timeFormat = if (weightPerSecond != -1.0) {
+ val timeTillOvertake = (weightUntilOvertake / weightPerSecond) * 1000
+ val format = TimeUtils.formatDuration(timeTillOvertake.toLong())
+ " §7(§b$format§7)"
+ } else ""
+
+ val weightFormat = LorenzUtils.formatDouble(weightUntilOvertake, 2)
+ return "§e$weightFormat$timeFormat §7behind §b$nextName"
}
private fun isEnabled() = GardenAPI.inGarden() && config.eliteFarmingWeightDisplay