From e47a2877bbb0550a1852889e0398f45bc20c0881 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 25 Nov 2023 03:21:38 +0100 Subject: moved item draw logic from item tracker data to SkyHanni item tracker --- .../skyhanni/features/slayer/SlayerProfitTracker.kt | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features/slayer') 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 d71172eb3..938441d95 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt @@ -14,7 +14,6 @@ import at.hannibal2.skyhanni.events.SlayerQuestCompleteEvent import at.hannibal2.skyhanni.utils.LorenzLogger import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.addAsSingletonList -import at.hannibal2.skyhanni.utils.LorenzUtils.sortedDesc import at.hannibal2.skyhanni.utils.NEUInternalName import at.hannibal2.skyhanni.utils.NumberUtil import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators @@ -170,25 +169,19 @@ object SlayerProfitTracker { val tracker = getTracker() ?: return@buildList addAsSingletonList("§e§l$itemLogCategory Profit Tracker") - var profit = 0.0 - val map = mutableMapOf() - for ((internalName, itemProfit) in itemLog.items) { - profit += itemLog.drawItem(tracker, itemProfit, internalName, map) - } + var profit = tracker.drawItems(itemLog, { true }, this) val slayerSpawnCost = itemLog.slayerSpawnCost if (slayerSpawnCost != 0L) { val mobKillCoinsFormat = NumberUtil.format(slayerSpawnCost) - map[Renderable.hoverTips( - " §7Slayer Spawn Costs: §c$mobKillCoinsFormat", - listOf("§7You paid §c$mobKillCoinsFormat §7in total", "§7for starting the slayer quests.") - )] = slayerSpawnCost + addAsSingletonList( + Renderable.hoverTips( + " §7Slayer Spawn Costs: §c$mobKillCoinsFormat", + listOf("§7You paid §c$mobKillCoinsFormat §7in total", "§7for starting the slayer quests.") + ) + ) profit += slayerSpawnCost } - for (text in map.sortedDesc().keys) { - addAsSingletonList(text) - } - val slayerCompletedCount = itemLog.slayerCompletedCount addAsSingletonList( Renderable.hoverTips( -- cgit