aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-03-21 20:26:31 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-03-21 20:26:31 +0100
commit885f00f5a6ea4539a6dab2a44f0dd2951c1247bc (patch)
treeabbc057c1f602d2349b0417087f641b35fff7453 /src/main/java/at/hannibal2/skyhanni
parent415c54df96ba46744a524715f10ff26962929903 (diff)
downloadskyhanni-885f00f5a6ea4539a6dab2a44f0dd2951c1247bc.tar.gz
skyhanni-885f00f5a6ea4539a6dab2a44f0dd2951c1247bc.tar.bz2
skyhanni-885f00f5a6ea4539a6dab2a44f0dd2951c1247bc.zip
Added price per garden exp in visitor gui
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Garden.java8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt11
2 files changed, 17 insertions, 2 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 75f934584..bfa578547 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java
@@ -97,12 +97,18 @@ public class Garden {
public boolean visitorExactAmountAndTime = true;
@Expose
- @ConfigOption(name = "Copper Price", desc = "Show the price for copper inside the visitor gui.")
+ @ConfigOption(name = "Copper Price", desc = "Show the price per copper inside the visitor gui.")
@ConfigEditorBoolean
@ConfigAccordionId(id = 4)
public boolean visitorCopperPrice = false;
@Expose
+ @ConfigOption(name = "Experience Price", desc = "Show the price per garden experience inside the visitor gui.")
+ @ConfigEditorBoolean
+ @ConfigAccordionId(id = 4)
+ public boolean visitorExperiencePrice = false;
+
+ @Expose
@ConfigOption(name = "Notification Chat", desc = "Show in chat when a new visitor is visiting your island.")
@ConfigEditorBoolean
@ConfigAccordionId(id = 1)
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 fb08d212c..85b311c10 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt
@@ -34,6 +34,7 @@ class GardenVisitorFeatures {
private var onBarnPlot = false
private var tick = 0
private val copperPattern = Pattern.compile(" §8\\+§c(.*) Copper")
+ private val gardenExperiencePattern = Pattern.compile(" §8\\+§2(.*) §7Garden Experience")
private val offerAcceptedPattern = Pattern.compile("§6§lOFFER ACCEPTED §r§8with §r(.*) §r.*")
private val config get() = SkyHanniMod.feature.garden
@@ -256,7 +257,15 @@ class GardenVisitorFeatures {
if (matcher.matches()) {
val coppers = matcher.group(1).replace(",", "").toInt()
val pricePerCopper = NumberUtil.format((totalPrice / coppers).toInt())
- list[i + itemsWithSpeedCounter] = "$line §7(Copper price §6$pricePerCopper§7)"
+ list[i + itemsWithSpeedCounter] = "$line §7(price per §6$pricePerCopper§7)"
+ }
+ }
+ if (config.visitorExperiencePrice) {
+ val matcher = gardenExperiencePattern.matcher(line)
+ if (matcher.matches()) {
+ val gardenExp = matcher.group(1).replace(",", "").toInt()
+ val pricePerCopper = NumberUtil.format((totalPrice / gardenExp).toInt())
+ list[i + itemsWithSpeedCounter] = "$line §7(price per §6$pricePerCopper§7)"
}
}
}