aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-06-05 14:30:56 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-06-05 14:30:56 +0200
commit2e19b6146d189175f682f703afe7fdcf04a9e629 (patch)
tree22a53db1d5ba1c4d29add1b250d8a0f9aef339ed /src
parent422d4dd7ab9096d639fe98a9da750f9feaabc848 (diff)
downloadskyhanni-2e19b6146d189175f682f703afe7fdcf04a9e629.tar.gz
skyhanni-2e19b6146d189175f682f703afe7fdcf04a9e629.tar.bz2
skyhanni-2e19b6146d189175f682f703afe7fdcf04a9e629.zip
Showing total price for visitor items needed
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt
index 588ee9172..31654398e 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt
@@ -138,6 +138,7 @@ class GardenVisitorFeatures {
}
}
if (requiredItems.isNotEmpty()) {
+ var totalPrice = 0.0
newDisplay.addAsSingletonList("§7Visitor items needed:")
for ((internalName, amount) in requiredItems) {
val name = NEUItems.getItemStack(internalName).name!!
@@ -158,12 +159,17 @@ class GardenVisitorFeatures {
if (config.visitorNeedsShowPrice) {
val price = NEUItems.getPrice(internalName) * amount
+ totalPrice += price
val format = NumberUtil.format(price)
list.add(" §7(§6$format§7)")
}
newDisplay.add(list)
}
+ if (totalPrice > 0) {
+ val format = NumberUtil.format(totalPrice)
+ newDisplay[0] = listOf("§7Visitor items needed: §7(§6$format§7)")
+ }
}
if (newVisitors.isNotEmpty()) {
if (requiredItems.isNotEmpty()) {