aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/garden/SkyMartConfig.java23
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/inventory/SkyMartCopperPrice.kt4
2 files changed, 26 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/garden/SkyMartConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/garden/SkyMartConfig.java
index 095c3733c..b477d2329 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/garden/SkyMartConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/garden/SkyMartConfig.java
@@ -4,6 +4,7 @@ import at.hannibal2.skyhanni.config.FeatureToggle;
import at.hannibal2.skyhanni.config.core.config.Position;
import com.google.gson.annotations.Expose;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean;
+import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDropdown;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorSlider;
import io.github.notenoughupdates.moulconfig.annotations.ConfigLink;
import io.github.notenoughupdates.moulconfig.annotations.ConfigOption;
@@ -23,4 +24,26 @@ public class SkyMartConfig {
@Expose
@ConfigLink(owner = SkyMartConfig.class, field = "copperPrice")
public Position copperPricePos = new Position(211, 132, false, true);
+
+ @Expose
+ @ConfigOption(name = "Overlay Price", desc = "Toggle for Bazaar 'sell order' vs 'instant sell' price in copper price overlay.")
+ @ConfigEditorDropdown
+ public OverlayPriceTypeEntry overlayPriceType = OverlayPriceTypeEntry.INSTANT_SELL;
+
+ public enum OverlayPriceTypeEntry {
+ INSTANT_SELL("Instant Sell"),
+ SELL_ORDER("Sell Order"),
+ ;
+ private final String str;
+
+
+ OverlayPriceTypeEntry(String str) {
+ this.str = str;
+ }
+
+ @Override
+ public String toString() {
+ return str;
+ }
+ }
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/SkyMartCopperPrice.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/SkyMartCopperPrice.kt
index c01998cd4..625216f85 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/SkyMartCopperPrice.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/SkyMartCopperPrice.kt
@@ -1,6 +1,7 @@
package at.hannibal2.skyhanni.features.garden.inventory
import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator
+import at.hannibal2.skyhanni.config.features.garden.SkyMartConfig
import at.hannibal2.skyhanni.events.GuiRenderEvent
import at.hannibal2.skyhanni.events.InventoryCloseEvent
import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent
@@ -55,7 +56,8 @@ object SkyMartCopperPrice {
} ?: continue
val internalName = item.getInternalName()
- val itemPrice = internalName.getPriceOrNull() ?: continue
+ val useSellPrice = config.overlayPriceType == SkyMartConfig.OverlayPriceTypeEntry.SELL_ORDER
+ val itemPrice = internalName.getPriceOrNull(useSellPrice) ?: continue
val profit = itemPrice - (otherItemsPrice ?: 0.0)
val factor = profit / copper