From ea84c154f07a805e61bab93ca3883bb727ce2080 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 25 Nov 2023 03:25:20 +0100 Subject: added missing empty char at start --- .../skyhanni/features/fishing/tracker/FishingProfitTracker.kt | 2 +- .../hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt | 2 +- .../at/hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt | 10 +++++++--- 3 files changed, 9 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/FishingProfitTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/FishingProfitTracker.kt index a6e8c2477..5f01183d6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/FishingProfitTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/FishingProfitTracker.kt @@ -55,7 +55,7 @@ object FishingProfitTracker { override fun getCoinFormat(item: TrackedItem, numberColor: String): Pair> { val mobKillCoinsFormat = NumberUtil.format(item.totalAmount) val gained = item.timesGained - val text = "$numberColor${gained}x §6Fished Coins§7: §6$mobKillCoinsFormat" + val text = " $numberColor${gained}x §6Fished Coins§7: §6$mobKillCoinsFormat" val lore = listOf( "§7Killing mobs gives you coins (more with scavenger)", "§7You got §e$mobKillCoinsFormat §7coins in total this way" diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt index 938441d95..f77ae2121 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt @@ -61,7 +61,7 @@ object SlayerProfitTracker { override fun getCoinFormat(item: TrackedItem, numberColor: String): Pair> { val mobKillCoinsFormat = NumberUtil.format(item.totalAmount) val gained = item.timesGained - val text = "$numberColor${gained}x §6Mob Kill Coins§7: §6$mobKillCoinsFormat" + val text = " $numberColor${gained}x §6Mob Kill Coins§7: §6$mobKillCoinsFormat" val lore = listOf( "§7Killing mobs gives you coins (more with scavenger)", "§7You got §6$mobKillCoinsFormat coins §7in total this way" diff --git a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt index 3c33a408a..c84ab239a 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt @@ -60,7 +60,7 @@ class SkyHanniItemTracker( lists: MutableList> ): Double { var profit = 0.0 - val map = mutableMapOf() + val items = mutableMapOf() for ((internalName, itemProfit) in data.items) { if (!filter(internalName)) continue @@ -69,11 +69,13 @@ class SkyHanniItemTracker( if (internalName == SKYBLOCK_COIN) 1.0 else data.getCustomPricePer(internalName) val price = (pricePer * amount).toLong() val displayAmount = if (internalName == SKYBLOCK_COIN) itemProfit.timesGained else amount + var name = if (internalName == SKYBLOCK_COIN) { "§6Coins" } else { internalName.getItemStack().nameWithEnchantment ?: error("no name for $internalName") } + val priceFormat = NumberUtil.format(price) val hidden = itemProfit.hidden val newDrop = itemProfit.lastTimeUpdated.passedSince() < 10.seconds && config.showRecentDrops @@ -81,10 +83,12 @@ class SkyHanniItemTracker( if (hidden) { name = "§8§m" + name.removeColor(keepFormatting = true).replace("§r", "") } + val text = " $numberColor${displayAmount.addSeparators()}x $name§7: §6$priceFormat" val (displayName, lore) = if (internalName == SKYBLOCK_COIN) { data.getCoinFormat(itemProfit, numberColor) } else text to buildLore(data, itemProfit, hidden, newDrop) + val renderable = if (isInventoryOpen()) Renderable.clickAndHover(displayName, lore) { if (System.currentTimeMillis() > lastClickDelay + 150) { if (KeyboardManager.isControlKeyDown()) { @@ -105,12 +109,12 @@ class SkyHanniItemTracker( } } else Renderable.string(displayName) if (isInventoryOpen() || !hidden) { - map[renderable] = price + items[renderable] = price } profit += price } - for (text in map.sortedDesc().keys) { + for (text in items.sortedDesc().keys) { lists.addAsSingletonList(text) } return profit -- cgit