aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils/tracker
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-25 03:25:20 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-25 03:25:20 +0100
commitea84c154f07a805e61bab93ca3883bb727ce2080 (patch)
treee51c6d2cf164a52e89008373e5edc4807106f2c8 /src/main/java/at/hannibal2/skyhanni/utils/tracker
parente47a2877bbb0550a1852889e0398f45bc20c0881 (diff)
downloadskyhanni-ea84c154f07a805e61bab93ca3883bb727ce2080.tar.gz
skyhanni-ea84c154f07a805e61bab93ca3883bb727ce2080.tar.bz2
skyhanni-ea84c154f07a805e61bab93ca3883bb727ce2080.zip
added missing empty char at start
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/tracker')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt10
1 files changed, 7 insertions, 3 deletions
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<Data : ItemTrackerData>(
lists: MutableList<List<Any>>
): Double {
var profit = 0.0
- val map = mutableMapOf<Renderable, Long>()
+ val items = mutableMapOf<Renderable, Long>()
for ((internalName, itemProfit) in data.items) {
if (!filter(internalName)) continue
@@ -69,11 +69,13 @@ class SkyHanniItemTracker<Data : ItemTrackerData>(
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<Data : ItemTrackerData>(
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<Data : ItemTrackerData>(
}
} 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