aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-03-23 20:07:36 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-03-23 20:07:36 +0100
commit19cbeabc2a7eff5e5c4ccef0cbe6404ad6d1abba (patch)
tree4f7234c3db6039771a71a7636df22dfd089a4e69 /src
parent9e16ac756bbeadad01eb247ae4c220bf1f4001f4 (diff)
downloadskyhanni-19cbeabc2a7eff5e5c4ccef0cbe6404ad6d1abba.tar.gz
skyhanni-19cbeabc2a7eff5e5c4ccef0cbe6404ad6d1abba.tar.bz2
skyhanni-19cbeabc2a7eff5e5c4ccef0cbe6404ad6d1abba.zip
Added the coin price in the visitor items needed list
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Garden.java6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt19
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt7
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
}