From 35b6ecbdcb5e8e7ed0ef15abec7d86da6c82d728 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Mon, 20 Nov 2023 01:22:09 +0100 Subject: Fixed clickable farming weight gui that opens #1000 in lb website. --- .../features/garden/farming/FarmingWeightDisplay.kt | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/main/java/at/hannibal2') 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) + } } } -- cgit