aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/config/features
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal002@users.noreply.github.com>2024-07-15 16:45:09 +0200
committerGitHub <noreply@github.com>2024-07-15 16:45:09 +0200
commitad7c6dfc824bb7d2b1405ec5f7c0a017612bbf2f (patch)
tree4a9786dd9c2578d0063ccd179200f04b612d7e35 /src/main/java/at/hannibal2/skyhanni/config/features
parenta716e5d26a6ae6c79300c298c221382fb73e21a8 (diff)
downloadskyhanni-ad7c6dfc824bb7d2b1405ec5f7c0a017612bbf2f.tar.gz
skyhanni-ad7c6dfc824bb7d2b1405ec5f7c0a017612bbf2f.tar.bz2
skyhanni-ad7c6dfc824bb7d2b1405ec5f7c0a017612bbf2f.zip
Fix: price source inconsistencies (bz sell/buy and npc price) (#2221)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/config/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/garden/SkyMartConfig.java22
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/garden/composter/ComposterConfig.java33
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/inventory/SackDisplayConfig.java33
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/misc/EstimatedItemValueConfig.java5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/misc/TrackerConfig.java34
5 files changed, 15 insertions, 112 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 b477d2329..d2a9428c7 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
@@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.config.features.garden;
import at.hannibal2.skyhanni.config.FeatureToggle;
import at.hannibal2.skyhanni.config.core.config.Position;
+import at.hannibal2.skyhanni.utils.ItemPriceSource;
import com.google.gson.annotations.Expose;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDropdown;
@@ -26,24 +27,7 @@ public class SkyMartConfig {
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.")
+ @ConfigOption(name = "Change Price Source", desc = "Change what price to use: Bazaar (Sell Offer or Buy Order) or NPC.")
@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;
- }
- }
+ public ItemPriceSource priceSource = ItemPriceSource.BAZAAR_INSTANT_SELL;
}
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/garden/composter/ComposterConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/garden/composter/ComposterConfig.java
index 5f22aa62b..9712573fb 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/garden/composter/ComposterConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/garden/composter/ComposterConfig.java
@@ -3,6 +3,7 @@ package at.hannibal2.skyhanni.config.features.garden.composter;
import at.hannibal2.skyhanni.config.FeatureToggle;
import at.hannibal2.skyhanni.config.HasLegacyId;
import at.hannibal2.skyhanni.config.core.config.Position;
+import at.hannibal2.skyhanni.utils.ItemPriceSource;
import com.google.gson.annotations.Expose;
import io.github.notenoughupdates.moulconfig.annotations.Accordion;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean;
@@ -21,37 +22,9 @@ public class ComposterConfig {
public boolean overlay = true;
@Expose
- @ConfigOption(name = "Overlay Price", desc = "Toggle for Bazaar 'buy order' vs 'instant buy' price in composter overlay.")
+ @ConfigOption(name = "Change Price Source", desc = "Change what price to use: Bazaar (Sell Offer or Buy Order) or NPC.")
@ConfigEditorDropdown
- public OverlayPriceTypeEntry overlayPriceType = OverlayPriceTypeEntry.INSTANT_BUY;
-
- public enum OverlayPriceTypeEntry implements HasLegacyId {
- INSTANT_BUY("Instant Buy", 0),
- BUY_ORDER("Buy Order", 1),
- ;
- private final String str;
- private final int legacyId;
-
- OverlayPriceTypeEntry(String str, int legacyId) {
- this.str = str;
- this.legacyId = legacyId;
- }
-
- // Constructor if new enum elements are added post-migration
- OverlayPriceTypeEntry(String str) {
- this(str, -1);
- }
-
- @Override
- public int getLegacyId() {
- return legacyId;
- }
-
- @Override
- public String toString() {
- return str;
- }
- }
+ public ItemPriceSource priceSource = ItemPriceSource.BAZAAR_INSTANT_BUY;
@Expose
@ConfigOption(name = "Retrieve From", desc = "Change where to retrieve the materials from in the composter overlay: Bazaar or Sacks.")
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/SackDisplayConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/SackDisplayConfig.java
index 0b4fc9998..88a6405fc 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/SackDisplayConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/SackDisplayConfig.java
@@ -3,6 +3,7 @@ package at.hannibal2.skyhanni.config.features.inventory;
import at.hannibal2.skyhanni.config.FeatureToggle;
import at.hannibal2.skyhanni.config.HasLegacyId;
import at.hannibal2.skyhanni.config.core.config.Position;
+import at.hannibal2.skyhanni.utils.ItemPriceSource;
import at.hannibal2.skyhanni.utils.RenderUtils;
import com.google.gson.annotations.Expose;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean;
@@ -170,37 +171,9 @@ public class SackDisplayConfig {
}
@Expose
- @ConfigOption(name = "Show Price From", desc = "Show price from Bazaar or NPC.")
+ @ConfigOption(name = "Change Price Source", desc = "Change what price to use: Bazaar (Sell Offer or Buy Order) or NPC.")
@ConfigEditorDropdown
- public PriceFrom priceFrom = PriceFrom.BAZAAR;
-
- public enum PriceFrom implements HasLegacyId {
- BAZAAR("Bazaar", 0),
- NPC("NPC", 1);
-
- private final String str;
- private final int legacyId;
-
- PriceFrom(String str, int legacyId) {
- this.str = str;
- this.legacyId = legacyId;
- }
-
- // Constructor if new enum elements are added post-migration
- PriceFrom(String str) {
- this(str, -1);
- }
-
- @Override
- public int getLegacyId() {
- return legacyId;
- }
-
- @Override
- public String toString() {
- return str;
- }
- }
+ public ItemPriceSource priceSource = ItemPriceSource.BAZAAR_INSTANT_BUY;
@Expose
@ConfigLink(owner = SackDisplayConfig.class, field = "enabled")
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/misc/EstimatedItemValueConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/misc/EstimatedItemValueConfig.java
index 10d97ebfd..096370308 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/misc/EstimatedItemValueConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/misc/EstimatedItemValueConfig.java
@@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.config.features.misc;
import at.hannibal2.skyhanni.config.FeatureToggle;
import at.hannibal2.skyhanni.config.core.config.Position;
+import at.hannibal2.skyhanni.utils.ItemPriceSource;
import com.google.gson.annotations.Expose;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDropdown;
@@ -65,9 +66,9 @@ public class EstimatedItemValueConfig {
public Property<Boolean> ignoreRunes = Property.of(false);
@Expose
- @ConfigOption(name = "Bazaar Price Source", desc = "Use Instant Buy or Buy Order.")
+ @ConfigOption(name = "Change Price Source", desc = "Change what price to use: Bazaar (Sell Offer or Buy Order) or NPC.")
@ConfigEditorDropdown
- public Property<BazaarPriceSource> bazaarPriceSource = Property.of(BazaarPriceSource.BUY_ORDER);
+ public Property<ItemPriceSource> priceSource = Property.of(ItemPriceSource.BAZAAR_INSTANT_SELL);
public enum BazaarPriceSource {
INSTANT_BUY("Instant Buy"),
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/misc/TrackerConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/misc/TrackerConfig.java
index 5896dd38c..dcad728fe 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/misc/TrackerConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/misc/TrackerConfig.java
@@ -1,7 +1,7 @@
package at.hannibal2.skyhanni.config.features.misc;
import at.hannibal2.skyhanni.config.FeatureToggle;
-import at.hannibal2.skyhanni.config.HasLegacyId;
+import at.hannibal2.skyhanni.utils.ItemPriceSource;
import at.hannibal2.skyhanni.utils.tracker.SkyHanniTracker;
import com.google.gson.annotations.Expose;
import io.github.notenoughupdates.moulconfig.annotations.Accordion;
@@ -19,37 +19,9 @@ public class TrackerConfig {
public boolean hideInEstimatedItemValue = true;
@Expose
- @ConfigOption(name = "Show Price From", desc = "Show price from Bazaar or NPC.")
+ @ConfigOption(name = "Change Price Source", desc = "Change what price to use: Bazaar (Sell Offer or Buy Order) or NPC.")
@ConfigEditorDropdown
- public PriceFromEntry priceFrom = PriceFromEntry.SELL_OFFER;
-
- public enum PriceFromEntry implements HasLegacyId {
- INSTANT_SELL("Instant Sell", 0),
- SELL_OFFER("Sell Offer", 1),
- NPC("NPC", 2);
- private final String str;
- private final int legacyId;
-
- PriceFromEntry(String str, int legacyId) {
- this.str = str;
- this.legacyId = legacyId;
- }
-
- // Constructor if new enum elements are added post-migration
- PriceFromEntry(String str) {
- this(str, -1);
- }
-
- @Override
- public int getLegacyId() {
- return legacyId;
- }
-
- @Override
- public String toString() {
- return str;
- }
- }
+ public ItemPriceSource priceSource = ItemPriceSource.BAZAAR_INSTANT_BUY;
@Expose
@ConfigOption(name = "Default Display Mode", desc = "Change the display mode that gets shown on default.")