aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/garden/EliteFarmingWeightConfig.java3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt14
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt3
3 files changed, 11 insertions, 9 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/garden/EliteFarmingWeightConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/garden/EliteFarmingWeightConfig.java
index c192ac763..caf56c195 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/garden/EliteFarmingWeightConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/garden/EliteFarmingWeightConfig.java
@@ -32,8 +32,9 @@ public class EliteFarmingWeightConfig {
public boolean overtakeETA = false;
@Expose
- @ConfigOption(name = "Offscreen Drop Message", desc = "Show a chat message when joining Garden how many spots you have dropped since last Garden join.")
+ @ConfigOption(name = "Show LB Change", desc = "Show the change of your position in the farming weight leaderboard while you were offline.")
@ConfigEditorBoolean
+ // TODO migrate
public boolean offScreenDropMessage = true;
@Expose
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 1070319c9..233aa46ea 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
@@ -385,17 +385,17 @@ class FarmingWeightDisplay {
if (diff == 0) return
if (diff > 0) {
- chatOffScreenChange("§cdropped ${StringUtils.optionalPlural(diff, "place", "places")}", oldPosition)
+ showLbChange("§cdropped ${StringUtils.optionalPlural(diff, "place", "places")}", oldPosition)
} else {
- chatOffScreenChange("§arisen ${StringUtils.optionalPlural(-diff, "place", "places")}", oldPosition)
+ showLbChange("§arisen ${StringUtils.optionalPlural(-diff, "place", "places")}", oldPosition)
}
}
- private fun chatOffScreenChange(direction: String, oldPosition: Int) {
+ private fun showLbChange(direction: String, oldPosition: Int) {
farmingChatMessage(
"§7Since your last visit to the §aGarden§7, " +
- "you have $direction §7on the §dFarming Leaderboard§7. " +
- "§7(§e#${oldPosition.addSeparators()} §7-> §e#${leaderboardPosition.addSeparators()}§7)"
+ "you have $direction §7on the §dFarming Leaderboard§7. " +
+ "§7(§e#${oldPosition.addSeparators()} §7-> §e#${leaderboardPosition.addSeparators()}§7)"
)
}
@@ -472,8 +472,8 @@ class FarmingWeightDisplay {
apiError = true
LorenzUtils.error(
"Loading the farming weight data from elitebot.dev failed!\n"
- + "§eYou can re-enter the garden to try to fix the problem.\n" +
- "§cIf this message repeats, please report it on Discord!",
+ + "§eYou can re-enter the garden to try to fix the problem.\n" +
+ "§cIf this message repeats, please report it on Discord!",
)
}
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
index 05694c0a9..2066b809b 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
@@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.utils
import at.hannibal2.skyhanni.mixins.transformers.AccessorChatComponentText
import at.hannibal2.skyhanni.utils.GuiRenderUtils.darkenColor
+import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.GuiUtilRenderComponents
import net.minecraft.util.ChatComponentText
@@ -148,7 +149,7 @@ object StringUtils {
}
fun optionalPlural(number: Int, singular: String, plural: String) =
- "$number " + if (number == 1) singular else plural
+ "${number.addSeparators()} " + if (number == 1) singular else plural
fun progressBar(percentage: Double, steps: Int = 24): Any {
//'§5§o§2§l§m §l§m §l§m §l§m §l§m §l§m §l§m §l§m §l§m §l§m §f§l§m §l§m §l§m §l§m §l§m §l§m §l§m §l§m §l§m §l§m §l§m §l§m §l§m §l§m §l§m §r §e348,144.3§6/§e936k'