diff options
author | Trîggered <57991380+Triggered0@users.noreply.github.com> | 2024-06-09 09:55:29 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-09 08:55:29 +0200 |
commit | 783c4f380b02b50b43801c44f8c189d9ad546bc6 (patch) | |
tree | 17620738e133ac53b49dcd9f5e8ee9fc4f417279 /src/main/java/at/hannibal2 | |
parent | 60db3c691013f5afbb141110c284ac2adffcdda4 (diff) | |
download | skyhanni-783c4f380b02b50b43801c44f8c189d9ad546bc6.tar.gz skyhanni-783c4f380b02b50b43801c44f8c189d9ad546bc6.tar.bz2 skyhanni-783c4f380b02b50b43801c44f8c189d9ad546bc6.zip |
Feature: Skymart Copper Price Bazaar Options (#2030)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/garden/SkyMartConfig.java | 23 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/inventory/SkyMartCopperPrice.kt | 4 |
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 |