aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-02-24 16:52:52 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-02-24 16:52:52 +0100
commit0f1f311351a310c53cf0c785983a2c0e6d493efd (patch)
tree72c49616fe30fff7fe86c5774c0ec3d00c8b7b05 /src/main/java/at/hannibal2/skyhanni
parentc2d34ca9ec5f61ab21e6f514726b74188b324a20 (diff)
downloadskyhanni-0f1f311351a310c53cf0c785983a2c0e6d493efd.tar.gz
skyhanni-0f1f311351a310c53cf0c785983a2c0e6d493efd.tar.bz2
skyhanni-0f1f311351a310c53cf0c785983a2c0e6d493efd.zip
Show additionally the bin price and copper price for every item.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Garden.java6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/SkyMartBestProfit.kt14
2 files changed, 14 insertions, 6 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 b2684880d..2343773de 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java
@@ -18,6 +18,12 @@ public class Garden {
public boolean skyMartCopperPrice = true;
@Expose
+ @ConfigOption(name = "Advanced stats", desc = "Show additionally the bin price and copper price for every item.")
+ @ConfigEditorBoolean
+ @ConfigAccordionId(id = 0)
+ public boolean skyMartCopperPriceAdvancedStats = false;
+
+ @Expose
@ConfigOption(name = "Copper Price Position", desc = "")
@ConfigEditorButton(runnableId = "skyMartCopperPrice", buttonText = "Edit")
@ConfigAccordionId(id = 0)
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/SkyMartBestProfit.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/SkyMartBestProfit.kt
index ead2f6832..83d46e1ff 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/SkyMartBestProfit.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/SkyMartBestProfit.kt
@@ -22,6 +22,7 @@ class SkyMartBestProfit {
private val pattern = Pattern.compile("§c(.*) Copper")
private val display = mutableListOf<String>()
+ private val config get() = SkyHanniMod.feature.garden
@SubscribeEvent
fun onChatPacket(event: InventoryOpenEvent) {
@@ -53,14 +54,17 @@ class SkyMartBestProfit {
name = "§9Sunder I"
}
- val pair = Pair("$name§f:", "§6§l$perFormat §f(§6$priceFormat §f/ §c$amountFormat copper§f)")
+ val advancedStats = if (config.skyMartCopperPriceAdvancedStats) {
+ " §f(§6$priceFormat §f/ §c$amountFormat Copper§f)"
+ } else ""
+ val pair = Pair("$name§f:", "§6§l$perFormat$advancedStats")
priceMap[pair] = factor
}
}
display.clear()
- display.add("Coins per §ccopper§f:")
+ display.add("Coins per §cCopper§f:")
display.add(" ")
val keys = priceMap.sortedDesc().keys
@@ -84,12 +88,10 @@ class SkyMartBestProfit {
@SubscribeEvent
fun onBackgroundDraw(event: GuiScreenEvent.BackgroundDrawnEvent) {
if (isEnabled()) {
- SkyHanniMod.feature.garden.skyMartCopperPricePos.renderStrings(display)
+ config.skyMartCopperPricePos.renderStrings(display)
}
}
private fun isEnabled() =
- LorenzUtils.inSkyBlock &&
- SkyHanniMod.feature.garden.skyMartCopperPrice &&
- LorenzUtils.skyBlockIsland == IslandType.GARDEN
+ LorenzUtils.inSkyBlock && config.skyMartCopperPrice && LorenzUtils.skyBlockIsland == IslandType.GARDEN
} \ No newline at end of file