From 2e19b6146d189175f682f703afe7fdcf04a9e629 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Mon, 5 Jun 2023 14:30:56 +0200 Subject: Showing total price for visitor items needed --- .../skyhanni/features/garden/visitor/GardenVisitorFeatures.kt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/main/java') 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()) { -- cgit