From 74490dcdb619e6eadf1be7665871cdaba4d58ee8 Mon Sep 17 00:00:00 2001 From: J10a1n15 <45315647+j10a1n15@users.noreply.github.com> Date: Mon, 23 Sep 2024 15:45:56 +0200 Subject: Backend: Carry Tracker Number format depending on Custom Scoreboard (#2571) --- src/main/java/at/hannibal2/skyhanni/features/misc/CarryTracker.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features') diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/CarryTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CarryTracker.kt index f70fa58b8..bfecbc48f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/CarryTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CarryTracker.kt @@ -7,7 +7,6 @@ import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.events.RepositoryReloadEvent import at.hannibal2.skyhanni.events.entity.slayer.SlayerDeathEvent -import at.hannibal2.skyhanni.features.gui.customscoreboard.CustomScoreboardUtils.formatNum import at.hannibal2.skyhanni.features.slayer.SlayerType import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.ChatUtils @@ -15,6 +14,7 @@ import at.hannibal2.skyhanni.utils.CollectionUtils.addString import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.KeyboardManager import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.NumberUtil.shortFormat import at.hannibal2.skyhanni.utils.NumberUtil.formatDouble import at.hannibal2.skyhanni.utils.NumberUtil.formatDoubleOrUserError import at.hannibal2.skyhanni.utils.NumberUtil.formatIntOrUserError @@ -181,7 +181,7 @@ object CarryTracker { val price = rawPrice.formatDoubleOrUserError() ?: return carryType.pricePer = price update() - ChatUtils.chat("Set carry price for $carryType §eto §6${price.formatNum()} coins.") + ChatUtils.chat("Set carry price for $carryType §eto §6${price.shortFormat()} coins.") } private fun getCustomer(customerName: String): Customer { @@ -260,7 +260,7 @@ object CarryTracker { val totalCost = customer.carries.sumOf { it.getCost() ?: 0.0 } val totalCostFormat = formatCost(totalCost) if (totalCostFormat != "") { - val paidFormat = "§6${customer.alreadyPaid.formatNum()}" + val paidFormat = "§6${customer.alreadyPaid.shortFormat()}" val missingFormat = formatCost(totalCost - customer.alreadyPaid) list.add( Renderable.clickAndHover( @@ -293,7 +293,7 @@ object CarryTracker { }?.takeIf { it != 0.0 } } - private fun formatCost(totalCost: Double?): String = if (totalCost == 0.0 || totalCost == null) "" else "§6${totalCost.formatNum()}" + private fun formatCost(totalCost: Double?): String = if (totalCost == 0.0 || totalCost == null) "" else "§6${totalCost.shortFormat()}" private fun createCarryType(input: String): CarryType? { if (input.length == 1) return null -- cgit