diff options
author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2024-05-20 12:18:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-20 12:18:26 +0200 |
commit | 0eebe1c0f734379e50c641aea87fc03a1930d58e (patch) | |
tree | b4eec6e0848ca9680c5365fd41a1cd4645bf8a28 /src/main/java/at/hannibal2/skyhanni | |
parent | fd42f05ce3b849ed579787607bf5f77080aebb7f (diff) | |
download | skyhanni-0eebe1c0f734379e50c641aea87fc03a1930d58e.tar.gz skyhanni-0eebe1c0f734379e50c641aea87fc03a1930d58e.tar.bz2 skyhanni-0eebe1c0f734379e50c641aea87fc03a1930d58e.zip |
Fix: Craft Materials (#1840)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/CraftMaterialsFromBazaar.kt | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/CraftMaterialsFromBazaar.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/CraftMaterialsFromBazaar.kt index c1b4582c9..a161bab74 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/CraftMaterialsFromBazaar.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/CraftMaterialsFromBazaar.kt @@ -6,6 +6,7 @@ import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.features.inventory.bazaar.BazaarApi.Companion.isBazaarItem import at.hannibal2.skyhanni.utils.CollectionUtils.addOrPut +import at.hannibal2.skyhanni.utils.CollectionUtils.addString import at.hannibal2.skyhanni.utils.ItemUtils.itemName import at.hannibal2.skyhanni.utils.ItemUtils.itemNameWithoutColor import at.hannibal2.skyhanni.utils.ItemUtils.name @@ -126,18 +127,24 @@ class CraftMaterialsFromBazaar { private fun MutableList<Renderable>.addMultipliers() { for (m in listOf(1, 5, 16, 32, 64, 512)) { - val nameColor = if (m == multiplier) "§amount" else "§e" - val priceColor = if (m == multiplier) "§6" else "§7" + val isThisMultiply = m == multiplier + val nameColor = if (isThisMultiply) "§a" else "§e" + val priceColor = if (isThisMultiply) "§6" else "§7" val price = priceColor + NumberUtil.format(calculateTotalPrice(neededMaterials, m)) - add( - Renderable.clickAndHover( - "${nameColor}Mulitply x$m $price", - listOf("§eClick here to multiply the items needed times $m!"), - onClick = { - multiplier = m - updateBazaarDisplay() - }) - ) + val text = "${nameColor}Mulitply x$m $price" + if (!isThisMultiply) { + add( + Renderable.clickAndHover( + text, + listOf("§eClick here to multiply the items needed times $m!"), + onClick = { + multiplier = m + updateBazaarDisplay() + }) + ) + } else { + addString(text) + } } } |