diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
3 files changed, 25 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java b/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java index c3ee77114..61c45d56c 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java @@ -83,6 +83,12 @@ public class Garden { public boolean visitorNeedsOnlyWhenClose = false; @Expose + @ConfigOption(name = "Show Price", desc = "Show the coin price in the items needed list.") + @ConfigEditorBoolean + @ConfigAccordionId(id = 3) + public boolean visitorNeedsShowPrice = true; + + @Expose @ConfigOption(name = "Visitor Inventory", desc = "") @ConfigAccordionId(id = 1) @ConfigEditorAccordion(id = 4) diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt index 1e0be2855..ddbdcc997 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt @@ -114,7 +114,19 @@ class GardenVisitorFeatures { for ((internalName, amount) in requiredItems) { val name = NEUItems.getItemStack(internalName).name val itemStack = NEUItems.getItemStack(internalName) - newDisplay.add(listOf(" §7- ", itemStack, "$name §8x$amount")) + + val list = mutableListOf<Any>() + list.add(" §7- ") + list.add(itemStack) + list.add("$name §8x$amount") + + if (config.visitorNeedsShowPrice) { + val price = NEUItems.getPrice(internalName) * amount + val format = NumberUtil.format(price) + list.add(" §7(§6$format§7)") + } + + newDisplay.add(list) } } if (newVisitors.isNotEmpty()) { @@ -209,11 +221,6 @@ class GardenVisitorFeatures { var internalName: String try { internalName = NEUItems.getInternalName(itemName) - // This fixes a NEU bug with §9Hay Bale (cosmetic item) - // TODO remove workaround when this is fixed in neu - if (internalName == "HAY_BALE") { - internalName = "HAY_BLOCK" - } } catch (e: NullPointerException) { val message = "internal name is null: '$itemName'" println(message) diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt index 8de57f642..568ccbb87 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt @@ -23,7 +23,12 @@ object NEUItems { if (itemNameCache.containsKey(itemName)) { return itemNameCache[itemName]!! } - val internalName = ItemResolutionQuery.findInternalNameByDisplayName(itemName, false) + var internalName = ItemResolutionQuery.findInternalNameByDisplayName(itemName, false) + // This fixes a NEU bug with §9Hay Bale (cosmetic item) + // TODO remove workaround when this is fixed in neu + if (internalName == "HAY_BALE") { + internalName = "HAY_BLOCK" + } itemNameCache[itemName] = internalName return internalName } |