From f3b3b44296b8a6ac77ecad433ca28e7a03a9eaf2 Mon Sep 17 00:00:00 2001 From: Vixid <52578495+VixidDev@users.noreply.github.com> Date: Thu, 25 Apr 2024 08:43:01 +0100 Subject: Feature: SBA style Enchant Parsing (#654) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../features/inventory/EnchantParsingConfig.java | 93 ++++++++++++++++++++++ .../config/features/inventory/InventoryConfig.java | 4 + 2 files changed, 97 insertions(+) create mode 100644 src/main/java/at/hannibal2/skyhanni/config/features/inventory/EnchantParsingConfig.java (limited to 'src/main/java/at/hannibal2/skyhanni/config') diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/EnchantParsingConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/EnchantParsingConfig.java new file mode 100644 index 000000000..bada2edee --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/EnchantParsingConfig.java @@ -0,0 +1,93 @@ +package at.hannibal2.skyhanni.config.features.inventory; + +import at.hannibal2.skyhanni.config.FeatureToggle; +import at.hannibal2.skyhanni.utils.LorenzColor; +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.ConfigOption; +import io.github.notenoughupdates.moulconfig.observer.Property; + +public class EnchantParsingConfig { + + @Expose + @ConfigOption(name = "Enable", desc = "Toggle for coloring the enchants. Turn this off if you want to use enchant parsing from other mods.") + @ConfigEditorBoolean + @FeatureToggle + public Property colorParsing = Property.of(true); + + @Expose + @ConfigOption(name = "Format", desc = "The way the enchants are formatted in the tooltip.") + @ConfigEditorDropdown() + public Property format = Property.of(EnchantFormat.NORMAL); + + public enum EnchantFormat { + NORMAL("Normal"), + COMPRESSED("Compressed"), + STACKED("Stacked"); + + public final String str; + + EnchantFormat(String str) { + this.str = str; + } + + @Override + public String toString() { + return str; + } + } + + @Expose + @ConfigOption(name = "Perfect Enchantment Color", desc = "The color an enchantment will be at max level.") + @ConfigEditorDropdown() + public Property perfectEnchantColor = Property.of(LorenzColor.CHROMA); + + @Expose + @ConfigOption(name = "Great Enchantment Color", desc = "The color an enchantment will be at a great level.") + @ConfigEditorDropdown() + public Property greatEnchantColor = Property.of(LorenzColor.GOLD); + + @Expose + @ConfigOption(name = "Good Enchantment Color", desc = "The color an enchantment will be at a good level.") + @ConfigEditorDropdown() + public Property goodEnchantColor = Property.of(LorenzColor.BLUE); + + @Expose + @ConfigOption(name = "Poor Enchantment Color", desc = "The color an enchantment will be at a poor level.") + @ConfigEditorDropdown() + public Property poorEnchantColor = Property.of(LorenzColor.GRAY); + + @Expose + @ConfigOption(name = "Comma Format", desc = "Change the format of the comma after each enchant.") + @ConfigEditorDropdown() + public Property commaFormat = Property.of(CommaFormat.COPY_ENCHANT); + + public enum CommaFormat { + COPY_ENCHANT("Copy enchant format"), + DEFAULT("Default (Blue)"); + + public final String str; + + CommaFormat(String str) { + this.str = str; + } + + @Override + public String toString() { + return str; + } + } + + @Expose + @ConfigOption(name = "Hide Vanilla Enchants", desc = "Hide the regular vanilla enchants usually found in the first 1-2 lines of lore.") + @ConfigEditorBoolean + @FeatureToggle + public Property hideVanillaEnchants = Property.of(true); + + @Expose + @ConfigOption(name = "Hide Enchant Description", desc = "Hides the enchant description after each enchant if available.") + @ConfigEditorBoolean + @FeatureToggle + public Property hideEnchantDescriptions = Property.of(false); +} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java index 1bef14366..518730117 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java @@ -36,6 +36,10 @@ public class InventoryConfig { @Category(name = "Bazaar", desc = "Bazaar settings.") public BazaarConfig bazaar = new BazaarConfig(); + @Expose + @Category(name = "Enchant Parsing", desc = "Settings for Skyhanni's Enchant Parsing") + public EnchantParsingConfig enchantParsing = new EnchantParsingConfig(); + @Expose @Category(name = "Helpers", desc = "Settings for Helpers") public HelperConfig helper = new HelperConfig(); -- cgit