diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-20 01:22:09 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-20 01:22:09 +0100 |
commit | 35b6ecbdcb5e8e7ed0ef15abec7d86da6c82d728 (patch) | |
tree | 10b1a6b914b05fd416f7e53c8fefb5e2ea153700 /src/main/java | |
parent | 3f18945698cb4a67a07bc053046ee3d7f00b7b5e (diff) | |
download | skyhanni-35b6ecbdcb5e8e7ed0ef15abec7d86da6c82d728.tar.gz skyhanni-35b6ecbdcb5e8e7ed0ef15abec7d86da6c82d728.tar.bz2 skyhanni-35b6ecbdcb5e8e7ed0ef15abec7d86da6c82d728.zip |
Fixed clickable farming weight gui that opens #1000 in lb website.
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt index 233aa46ea..13125c349 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt @@ -254,8 +254,9 @@ class FarmingWeightDisplay { listOf("§eClick here to load new data right now!"), onClick = recalculate ) + val showRankGoal = leaderboardPosition == -1 || leaderboardPosition > rankGoal var nextName = - if (leaderboardPosition == -1 || leaderboardPosition > rankGoal) "#$rankGoal" else nextPlayer.name + if (showRankGoal) "#$rankGoal" else nextPlayer.name val totalWeight = (localWeight + weight) var weightUntilOvertake = nextPlayer.weight - totalWeight @@ -298,11 +299,16 @@ class FarmingWeightDisplay { } else "" val weightFormat = LorenzUtils.formatDouble(weightUntilOvertake, 2) - return Renderable.clickAndHover( - "§e$weightFormat$timeFormat §7behind §b$nextName", - listOf("§eClick to open the Farming Profile of §b$nextName.") - ) { - openWebsite(nextName) + val text = "§e$weightFormat$timeFormat §7behind §b$nextName" + return if (showRankGoal) { + Renderable.string(text) + } else { + Renderable.clickAndHover( + text, + listOf("§eClick to open the Farming Profile of §b$nextName.") + ) { + openWebsite(nextName) + } } } |