From e70531a2090979d942b047be004b319869a6f220 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Mon, 25 Dec 2023 01:00:26 +0100 Subject: Fixed config migration errors --- .../features/rift/motes/InventoryValueConfig.java | 54 ---------------------- .../config/features/rift/motes/MotesConfig.java | 2 +- .../rift/motes/RiftInventoryValueConfig.java | 54 ++++++++++++++++++++++ 3 files changed, 55 insertions(+), 55 deletions(-) delete mode 100644 src/main/java/at/hannibal2/skyhanni/config/features/rift/motes/InventoryValueConfig.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/features/rift/motes/RiftInventoryValueConfig.java (limited to 'src/main/java/at/hannibal2/skyhanni/config/features') diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/rift/motes/InventoryValueConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/rift/motes/InventoryValueConfig.java deleted file mode 100644 index 50ec181e4..000000000 --- a/src/main/java/at/hannibal2/skyhanni/config/features/rift/motes/InventoryValueConfig.java +++ /dev/null @@ -1,54 +0,0 @@ -package at.hannibal2.skyhanni.config.features.rift.motes; - -import at.hannibal2.skyhanni.config.FeatureToggle; -import at.hannibal2.skyhanni.config.HasLegacyId; -import at.hannibal2.skyhanni.config.core.config.Position; -import com.google.gson.annotations.Expose; -import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean; -import io.github.moulberry.moulconfig.annotations.ConfigEditorDropdown; -import io.github.moulberry.moulconfig.annotations.ConfigOption; - -public class InventoryValueConfig { - @Expose - @ConfigOption(name = "Inventory Value", desc = "Show total Motes NPC price for the current opened inventory.") - @ConfigEditorBoolean - @FeatureToggle - public boolean enabled = true; - - @Expose - @ConfigOption(name = "Number Format Type", desc = "Short: 1.2M\n" + - "Long: 1,200,000") - @ConfigEditorDropdown() - public NumberFormatEntry formatType = NumberFormatEntry.SHORT; - - public enum NumberFormatEntry implements HasLegacyId { - SHORT("Short", 0), - LONG("Long", 1); - - private final String str; - private final int legacyId; - - NumberFormatEntry(String str, int legacyId) { - this.str = str; - this.legacyId = legacyId; - } - - // Constructor if new enum elements are added post-migration - NumberFormatEntry(String str) { - this(str, -1); - } - - @Override - public int getLegacyId() { - return legacyId; - } - - @Override - public String toString() { - return str; - } - } - - @Expose - public Position position = new Position(126, 156, false, true); -} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/rift/motes/MotesConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/rift/motes/MotesConfig.java index 2a65a6652..ef6c3a3e7 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/rift/motes/MotesConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/rift/motes/MotesConfig.java @@ -23,5 +23,5 @@ public class MotesConfig { @Expose @ConfigOption(name = "Inventory Value", desc = "") @Accordion - public InventoryValueConfig inventoryValue = new InventoryValueConfig(); + public RiftInventoryValueConfig inventoryValue = new RiftInventoryValueConfig(); } diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/rift/motes/RiftInventoryValueConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/rift/motes/RiftInventoryValueConfig.java new file mode 100644 index 000000000..4b4fef21d --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/features/rift/motes/RiftInventoryValueConfig.java @@ -0,0 +1,54 @@ +package at.hannibal2.skyhanni.config.features.rift.motes; + +import at.hannibal2.skyhanni.config.FeatureToggle; +import at.hannibal2.skyhanni.config.HasLegacyId; +import at.hannibal2.skyhanni.config.core.config.Position; +import com.google.gson.annotations.Expose; +import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean; +import io.github.moulberry.moulconfig.annotations.ConfigEditorDropdown; +import io.github.moulberry.moulconfig.annotations.ConfigOption; + +public class RiftInventoryValueConfig { + @Expose + @ConfigOption(name = "Inventory Value", desc = "Show total Motes NPC price for the current opened inventory.") + @ConfigEditorBoolean + @FeatureToggle + public boolean enabled = true; + + @Expose + @ConfigOption(name = "Number Format Type", desc = "Short: 1.2M\n" + + "Long: 1,200,000") + @ConfigEditorDropdown() + public NumberFormatEntry formatType = NumberFormatEntry.SHORT; + + public enum NumberFormatEntry implements HasLegacyId { + SHORT("Short", 0), + LONG("Long", 1); + + private final String str; + private final int legacyId; + + NumberFormatEntry(String str, int legacyId) { + this.str = str; + this.legacyId = legacyId; + } + + // Constructor if new enum elements are added post-migration + NumberFormatEntry(String str) { + this(str, -1); + } + + @Override + public int getLegacyId() { + return legacyId; + } + + @Override + public String toString() { + return str; + } + } + + @Expose + public Position position = new Position(126, 156, false, true); +} -- cgit