diff options
author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2024-03-28 10:07:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-28 10:07:28 +0100 |
commit | 07a41cc61d1aa4373e925d240e067d720580b486 (patch) | |
tree | 185d8a6c4ccfe6e2811511f35c67d39aec129202 /src/main/java/at/hannibal2/skyhanni | |
parent | 0beb9e3b3132bcc14c99759628732625ee97d6a8 (diff) | |
download | skyhanni-07a41cc61d1aa4373e925d240e067d720580b486.tar.gz skyhanni-07a41cc61d1aa4373e925d240e067d720580b486.tar.bz2 skyhanni-07a41cc61d1aa4373e925d240e067d720580b486.zip |
Improvement: Config Move (#1300)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
45 files changed, 249 insertions, 173 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt index 2bc382375..22f0d3196 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt @@ -77,6 +77,7 @@ import at.hannibal2.skyhanni.features.chat.Translator import at.hannibal2.skyhanni.features.chat.WatchdogHider import at.hannibal2.skyhanni.features.chat.playerchat.PlayerChatFilter import at.hannibal2.skyhanni.features.chat.playerchat.PlayerChatModifier +import at.hannibal2.skyhanni.features.chroma.ChromaManager import at.hannibal2.skyhanni.features.combat.BestiaryData import at.hannibal2.skyhanni.features.combat.HideDamageSplash import at.hannibal2.skyhanni.features.combat.damageindicator.DamageIndicatorManager @@ -486,6 +487,7 @@ class SkyHanniMod { loadModule(BossbarData) loadModule(EntityUtils) loadModule(ChatUtils) + loadModule(ChromaManager) // APIs loadModule(BazaarApi()) diff --git a/src/main/java/at/hannibal2/skyhanni/config/Features.java b/src/main/java/at/hannibal2/skyhanni/config/Features.java index 2448b7ce9..5b44c1b12 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/Features.java +++ b/src/main/java/at/hannibal2/skyhanni/config/Features.java @@ -3,9 +3,7 @@ package at.hannibal2.skyhanni.config; import at.hannibal2.skyhanni.SkyHanniMod; import at.hannibal2.skyhanni.config.features.About; import at.hannibal2.skyhanni.config.features.chat.ChatConfig; -import at.hannibal2.skyhanni.config.features.chroma.ChromaConfig; import at.hannibal2.skyhanni.config.features.combat.CombatConfig; -import at.hannibal2.skyhanni.config.features.commands.CommandsConfig; import at.hannibal2.skyhanni.config.features.crimsonisle.CrimsonIsleConfig; import at.hannibal2.skyhanni.config.features.dev.DevConfig; import at.hannibal2.skyhanni.config.features.dungeon.DungeonConfig; @@ -14,15 +12,11 @@ import at.hannibal2.skyhanni.config.features.fishing.FishingConfig; import at.hannibal2.skyhanni.config.features.garden.GardenConfig; import at.hannibal2.skyhanni.config.features.gui.GUIConfig; import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig; -import at.hannibal2.skyhanni.config.features.itemability.ItemAbilityConfig; -import at.hannibal2.skyhanni.config.features.markedplayer.MarkedPlayerConfig; import at.hannibal2.skyhanni.config.features.mining.MiningConfig; -import at.hannibal2.skyhanni.config.features.minion.MinionsConfig; import at.hannibal2.skyhanni.config.features.misc.MiscConfig; import at.hannibal2.skyhanni.config.features.rift.RiftConfig; import at.hannibal2.skyhanni.config.features.skillprogress.SkillProgressConfig; import at.hannibal2.skyhanni.config.features.slayer.SlayerConfig; -import at.hannibal2.skyhanni.config.features.stranded.StrandedConfig; import at.hannibal2.skyhanni.config.storage.Storage; import com.google.gson.annotations.Expose; import io.github.moulberry.moulconfig.Config; @@ -69,6 +63,9 @@ public class Features extends Config { * and Misc and Dev, which are to be at the bottom. Thanks! */ + + // Top + @Expose @Category(name = "About", desc = "Information about SkyHanni and updates.") public About about = new About(); @@ -77,82 +74,68 @@ public class Features extends Config { @Category(name = "GUI", desc = "Change the locations of GUI elements (§e/sh gui§7).") public GUIConfig gui = new GUIConfig(); - @Expose - @Category(name = "Chat", desc = "Change how the chat looks.") - public ChatConfig chat = new ChatConfig(); - - @Expose - @Category(name = "Chroma", desc = "Settings for Chroma text (Credit to SBA).") - public ChromaConfig chroma = new ChromaConfig(); + // Islands @Expose - @Category(name = "Combat", desc = "Everything combat and PvE related.") - public CombatConfig combat = new CombatConfig(); - - @Expose - @Category(name = "Commands", desc = "Enable or disable commands.") - public CommandsConfig commands = new CommandsConfig(); + @Category(name = "Garden", desc = "Features for the Garden island.") + public GardenConfig garden = new GardenConfig(); @Expose @Category(name = "Crimson Isle", desc = "Things to do on the Crimson Isle/Nether island.") public CrimsonIsleConfig crimsonIsle = new CrimsonIsleConfig(); @Expose - @Category(name = "Dungeon", desc = "Features that change the Dungeons experience in The Catacombs.") - public DungeonConfig dungeon = new DungeonConfig(); + @Category(name = "The Rift", desc = "Features for The Rift dimension.") + public RiftConfig rift = new RiftConfig(); - @Expose - @Category(name = "Events", desc = "Stuff that is not always available.") - public EventConfig event = new EventConfig(); + // Skills @Expose @Category(name = "Fishing", desc = "Fishing stuff.") public FishingConfig fishing = new FishingConfig(); @Expose - @Category(name = "Garden", desc = "Features for the Garden island.") - public GardenConfig garden = new GardenConfig(); + @Category(name = "Mining", desc = "Features that help you break blocks.") + public MiningConfig mining = new MiningConfig(); - @Expose - @Category(name = "Inventory", desc = "Change the behavior of items and the inventory.") - public InventoryConfig inventory = new InventoryConfig(); + // Combat like @Expose - @Category(name = "Item Abilities", desc = "Stuff about item abilities.") - public ItemAbilityConfig itemAbilities = new ItemAbilityConfig(); + @Category(name = "Combat", desc = "Everything combat and PvE related.") + public CombatConfig combat = new CombatConfig(); @Expose - @Category(name = "Marked Players", desc = "Players that got marked with §e/shmarkplayer§7.") - public MarkedPlayerConfig markedPlayers = new MarkedPlayerConfig(); + @Category(name = "Slayer", desc = "Slayer features.") + public SlayerConfig slayer = new SlayerConfig(); @Expose - @Category(name = "Minions", desc = "The minions on your private island.") - public MinionsConfig minions = new MinionsConfig(); + @Category(name = "Dungeon", desc = "Features that change the Dungeons experience in The Catacombs.") + public DungeonConfig dungeon = new DungeonConfig(); - @Expose - @Category(name = "Mining", desc = "Features that help you break blocks.") - public MiningConfig mining = new MiningConfig(); + // Misc @Expose - @Category(name = "Skill Progress", desc = "Skill Progress related config options.") - public SkillProgressConfig skillProgress = new SkillProgressConfig(); + @Category(name = "Inventory", desc = "Change the behavior of items and the inventory.") + public InventoryConfig inventory = new InventoryConfig(); @Expose - @Category(name = "Slayer", desc = "Slayer features.") - public SlayerConfig slayer = new SlayerConfig(); + @Category(name = "Events", desc = "Stuff that is not always available.") + public EventConfig event = new EventConfig(); @Expose - @Category(name = "Stranded", desc = "Features for the Stranded game mode.") - public StrandedConfig stranded = new StrandedConfig(); + @Category(name = "Skill Progress", desc = "Skill Progress related config options.") + public SkillProgressConfig skillProgress = new SkillProgressConfig(); @Expose - @Category(name = "The Rift", desc = "Features for The Rift dimension.") - public RiftConfig rift = new RiftConfig(); + @Category(name = "Chat", desc = "Change how the chat looks.") + public ChatConfig chat = new ChatConfig(); @Expose @Category(name = "Misc", desc = "Settings without a category.") public MiscConfig misc = new MiscConfig(); + // Bottom + @Expose @Category(name = "Dev", desc = "Debug and test stuff. Developers are cool.") public DevConfig dev = new DevConfig(); diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/chroma/ChromaConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/chroma/ChromaConfig.java index fc455b5d2..efd49c545 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/chroma/ChromaConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/chroma/ChromaConfig.java @@ -1,8 +1,8 @@ package at.hannibal2.skyhanni.config.features.chroma; -import at.hannibal2.skyhanni.SkyHanniMod; import at.hannibal2.skyhanni.config.FeatureToggle; import at.hannibal2.skyhanni.config.HasLegacyId; +import at.hannibal2.skyhanni.features.chroma.ChromaManager; import com.google.gson.annotations.Expose; import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean; import io.github.moulberry.moulconfig.annotations.ConfigEditorButton; @@ -76,7 +76,7 @@ public class ChromaConfig { @ConfigOption(name = "Reset to Default", desc = "Resets all chroma settings to the default.") @ConfigEditorButton(buttonText = "Reset") - public Runnable resetSettings = this::resetChromaSettings; + public Runnable resetSettings = ChromaManager::resetChromaSettings; @Expose @ConfigOption(name = "Everything Chroma", desc = "Renders §4§l§oALL §r§7text in chroma. (Some enchants may appear white with SBA enchant parsing)") @@ -88,12 +88,4 @@ public class ChromaConfig { @ConfigEditorBoolean public boolean ignoreChat = false; - private void resetChromaSettings() { - SkyHanniMod.getFeature().chroma.chromaSize = 30f; - SkyHanniMod.getFeature().chroma.chromaSpeed = 6f; - SkyHanniMod.getFeature().chroma.chromaSaturation = 0.75f; - SkyHanniMod.getFeature().chroma.allChroma = false; - SkyHanniMod.getFeature().chroma.ignoreChat = false; - SkyHanniMod.getFeature().chroma.chromaDirection = Direction.FORWARD_RIGHT; - } } diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/gui/GUIConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/gui/GUIConfig.java index 10b6cdde1..78b94fbba 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/gui/GUIConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/gui/GUIConfig.java @@ -2,7 +2,12 @@ package at.hannibal2.skyhanni.config.features.gui; import at.hannibal2.skyhanni.config.FeatureToggle; import at.hannibal2.skyhanni.config.core.config.Position; +import at.hannibal2.skyhanni.config.features.chroma.ChromaConfig; import at.hannibal2.skyhanni.config.features.gui.customscoreboard.CustomScoreboardConfig; +import at.hannibal2.skyhanni.config.features.markedplayer.MarkedPlayerConfig; +import at.hannibal2.skyhanni.config.features.misc.DiscordRPCConfig; +import at.hannibal2.skyhanni.config.features.misc.compacttablist.CompactTabListConfig; +import at.hannibal2.skyhanni.config.features.misc.cosmetic.CosmeticConfig; import at.hannibal2.skyhanni.data.GuiEditManager; import com.google.gson.annotations.Expose; import io.github.moulberry.moulconfig.annotations.Accordion; @@ -16,6 +21,20 @@ import org.lwjgl.input.Keyboard; public class GUIConfig { + @Expose + @Category(name = "Compact Tab List", desc = "Compact Tab List Settings") + @Accordion + public CompactTabListConfig compactTabList = new CompactTabListConfig(); + + @Expose + @Category(name = "Custom Scoreboard", desc = "Custom Scoreboard Settings") + public CustomScoreboardConfig customScoreboard = new CustomScoreboardConfig(); + + @Expose + @Category(name = "Chroma", desc = "Settings for Chroma text (Credit to SBA).") + @Accordion + public ChromaConfig chroma = new ChromaConfig(); + @ConfigOption(name = "Edit GUI Locations", desc = "Change the position of SkyHanni's overlays.") @ConfigEditorButton(buttonText = "Edit") public Runnable positions = () -> GuiEditManager.openGuiPositionEditor(true); @@ -31,8 +50,14 @@ public class GUIConfig { public float globalScale = 1F; @Expose - @Category(name = "Custom Scoreboard", desc = "Custom Scoreboard Settings") - public CustomScoreboardConfig customScoreboard = new CustomScoreboardConfig(); + @ConfigOption(name = "Discord Rich Presence", desc = "") + @Accordion + public DiscordRPCConfig discordRPC = new DiscordRPCConfig(); + + @Expose + @ConfigOption(name = "Marked Players", desc = "Players that got marked with §e/shmarkplayer§7.") + @Accordion + public MarkedPlayerConfig markedPlayers = new MarkedPlayerConfig(); @Expose @ConfigOption(name = "Modify Visual Words", desc = "") @@ -45,6 +70,11 @@ public class GUIConfig { public TextBoxConfig customTextBox = new TextBoxConfig(); @Expose + @ConfigOption(name = "In-Game Date", desc = "") + @Accordion + public InGameDateConfig inGameDate = new InGameDateConfig(); + + @Expose @ConfigOption(name = "Real Time", desc = "Display the current computer time, a handy feature when playing in full-screen mode.") @ConfigEditorBoolean @FeatureToggle @@ -59,9 +89,8 @@ public class GUIConfig { public Position realTimePosition = new Position(10, 10, false, true); @Expose - @ConfigOption(name = "In-Game Date", desc = "") - @Accordion - public InGameDateConfig inGameDate = new InGameDateConfig(); + @Category(name = "Cosmetic", desc = "Cosmetics Settings") + public CosmeticConfig cosmetic = new CosmeticConfig(); @Expose @ConfigOption(name = "TPS Display", desc = "Show the TPS of the current server, like in Soopy.") diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/AuctionHouseConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/AuctionHouseConfig.java index 8c3d8d385..26746cb47 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/AuctionHouseConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/AuctionHouseConfig.java @@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.config.features.inventory; import at.hannibal2.skyhanni.config.FeatureToggle; import com.google.gson.annotations.Expose; +import io.github.moulberry.moulconfig.annotations.Accordion; import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean; import io.github.moulberry.moulconfig.annotations.ConfigEditorKeybind; import io.github.moulberry.moulconfig.annotations.ConfigOption; @@ -9,6 +10,10 @@ import org.lwjgl.input.Keyboard; public class AuctionHouseConfig { + @Expose + @ConfigOption(name = "Auctions Price Comparison", desc = "") + @Accordion + public AuctionHousePriceComparisonConfig auctionsPriceComparison = new AuctionHousePriceComparisonConfig(); @Expose @ConfigOption( 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 6959299cb..a005c0428 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 @@ -3,6 +3,9 @@ package at.hannibal2.skyhanni.config.features.inventory; import at.hannibal2.skyhanni.config.FeatureToggle; import at.hannibal2.skyhanni.config.HasLegacyId; import at.hannibal2.skyhanni.config.features.inventory.helper.HelperConfig; +import at.hannibal2.skyhanni.config.features.itemability.ItemAbilityConfig; +import at.hannibal2.skyhanni.config.features.misc.EstimatedItemValueConfig; +import at.hannibal2.skyhanni.config.features.misc.PocketSackInASackConfig; import com.google.gson.annotations.Expose; import io.github.moulberry.moulconfig.annotations.Accordion; import io.github.moulberry.moulconfig.annotations.Category; @@ -22,6 +25,26 @@ import static at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.It public class InventoryConfig { @Expose + @Category(name = "Skyblock Guide", desc = "") + public SkyblockGuideConfig skyblockGuideConfig = new SkyblockGuideConfig(); + + @Expose + @Category(name = "Auction House", desc = "") + public AuctionHouseConfig auctions = new AuctionHouseConfig(); + + @Expose + @Category(name = "Bazaar", desc = "Bazaar settings.") + public BazaarConfig bazaar = new BazaarConfig(); + + @Expose + @Category(name = "Helpers", desc = "Settings for Helpers") + public HelperConfig helper = new HelperConfig(); + + @Expose + @Category(name = "Item Abilities", desc = "Stuff about item abilities.") + public ItemAbilityConfig itemAbilities = new ItemAbilityConfig(); + + @Expose @ConfigOption(name = "Not Clickable Items", desc = "") @Accordion public HideNotClickableConfig hideNotClickable = new HideNotClickableConfig(); @@ -41,43 +64,30 @@ public class InventoryConfig { @Accordion public JacobFarmingContestConfig jacobFarmingContests = new JacobFarmingContestConfig(); - @Expose @ConfigOption(name = "Sack Items Display", desc = "") @Accordion public SackDisplayConfig sackDisplay = new SackDisplayConfig(); @Expose - @ConfigOption(name = "Chest Value", desc = "") + @ConfigOption(name = "Estimated Item Value", desc = "(Prices for Enchantments, Reforge Stones, Gemstones, Drill Parts and more)") @Accordion - public ChestValueConfig chestValueConfig = new ChestValueConfig(); - - @Expose - @Category(name = "Skyblock Guide", desc = "") - public SkyblockGuideConfig skyblockGuideConfig = new SkyblockGuideConfig(); - - @Expose - @Category(name = "Bazaar", desc = "Bazaar settings.") - public BazaarConfig bazaar = new BazaarConfig(); + public EstimatedItemValueConfig estimatedItemValues = new EstimatedItemValueConfig(); @Expose - @Category(name = "Helpers", desc = "Settings for Helpers") - public HelperConfig helper = new HelperConfig(); + @ConfigOption(name = "Chest Value", desc = "") + @Accordion + public ChestValueConfig chestValueConfig = new ChestValueConfig(); @Expose @ConfigOption(name = "Get From Sack", desc = "") @Accordion public GetFromSackConfig gfs = new GetFromSackConfig(); - @Expose - @ConfigOption(name = "Auctions", desc = "") + @ConfigOption(name = "Pocket Sack-In-A-Sack", desc = "") @Accordion - public AuctionHouseConfig auctions = new AuctionHouseConfig(); - @Expose - @ConfigOption(name = "Auctions Price Comparison", desc = "") - @Accordion - public AuctionHousePriceComparisonConfig auctionsPriceComparison = new AuctionHousePriceComparisonConfig(); + public PocketSackInASackConfig pocketSackInASack = new PocketSackInASackConfig(); @Expose @ConfigOption( diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/misc/MiscConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/misc/MiscConfig.java index bce2bbaf2..5d58664fc 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/misc/MiscConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/misc/MiscConfig.java @@ -3,9 +3,10 @@ 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.config.enums.OutsideSbFeature; -import at.hannibal2.skyhanni.config.features.misc.compacttablist.CompactTabListConfig; -import at.hannibal2.skyhanni.config.features.misc.cosmetic.CosmeticConfig; +import at.hannibal2.skyhanni.config.features.commands.CommandsConfig; +import at.hannibal2.skyhanni.config.features.minion.MinionsConfig; import at.hannibal2.skyhanni.config.features.misc.pets.PetConfig; +import at.hannibal2.skyhanni.config.features.stranded.StrandedConfig; import com.google.gson.annotations.Expose; import io.github.moulberry.moulconfig.annotations.Accordion; import io.github.moulberry.moulconfig.annotations.Category; @@ -22,6 +23,18 @@ public class MiscConfig { @Category(name = "Pets", desc = "Pets Settings") public PetConfig pets = new PetConfig(); + @Expose + @Category(name = "Commands", desc = "Enable or disable commands.") + public CommandsConfig commands = new CommandsConfig(); + + @Expose + @Category(name = "Minions", desc = "The minions on your private island.") + public MinionsConfig minions = new MinionsConfig(); + + @Expose + @Category(name = "Stranded", desc = "Features for the Stranded game mode.") + public StrandedConfig stranded = new StrandedConfig(); + @ConfigOption(name = "Hide Armor", desc = "") @Accordion @Expose @@ -38,16 +51,6 @@ public class MiscConfig { @Accordion public ParticleHiderConfig particleHiders = new ParticleHiderConfig(); - @Expose - @ConfigOption(name = "Estimated Item Value", desc = "(Prices for Enchantments, Reforge Stones, Gemstones, Drill Parts and more)") - @Accordion - public EstimatedItemValueConfig estimatedItemValues = new EstimatedItemValueConfig(); - - @ConfigOption(name = "Discord Rich Presence", desc = "") - @Accordion - @Expose - public DiscordRPCConfig discordRPC = new DiscordRPCConfig(); - @ConfigOption(name = "Trevor The Trapper", desc = "") @Accordion @Expose @@ -58,22 +61,12 @@ public class MiscConfig { @Expose public TeleportPadConfig teleportPad = new TeleportPadConfig(); - @ConfigOption(name = "Pocket Sack-In-A-Sack", desc = "") - @Accordion - @Expose - public PocketSackInASackConfig pocketSackInASack = new PocketSackInASackConfig(); - @ConfigOption(name = "Quick Mod Menu Switch", desc = "") @Accordion @Expose public QuickModMenuSwitchConfig quickModMenuSwitch = new QuickModMenuSwitchConfig(); @Expose - @Category(name = "Cosmetic", desc = "Cosmetics Settings") - public CosmeticConfig cosmetic = new CosmeticConfig(); - - - @Expose @ConfigOption(name = "Glowing Dropped Items", desc = "") @Accordion public GlowingDroppedItemsConfig glowingDroppedItems = new GlowingDroppedItemsConfig(); @@ -84,11 +77,6 @@ public class MiscConfig { public HighlightPartyMembersConfig highlightPartyMembers = new HighlightPartyMembersConfig(); @Expose - @Category(name = "Compact Tab List", desc = "Compact Tab List Settings") - @Accordion - public CompactTabListConfig compactTabList = new CompactTabListConfig(); - - @Expose @ConfigOption(name = "Kick Duration", desc = "") @Accordion public KickDurationConfig kickDuration = new KickDurationConfig(); diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt index 5516cbe77..05b4a0cd7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt @@ -41,12 +41,12 @@ class PlayerDeathMessages { val message = event.message deathMessagePattern.matchMatcher(message) { val name = group("name") - if (SkyHanniMod.feature.markedPlayers.highlightInChat && + if (MarkedPlayerManager.config.highlightInChat && !LorenzUtils.inDungeons && !LorenzUtils.inKuudraFight && MarkedPlayerManager.isMarkedPlayer(name) ) { val reason = group("reason").removeColor() - val color = SkyHanniMod.feature.markedPlayers.chatColor.getChatColor() + val color = MarkedPlayerManager.config.chatColor.getChatColor() ChatUtils.chat(" §c☠ $color$name §7$reason", false) event.blockedReason = "marked_player_death" return diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt index a9c302021..a8b7cdada 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt @@ -78,8 +78,8 @@ class PlayerChatModifier { string = string.replace("§r§f: ", "§r§7: ") } - if (SkyHanniMod.feature.markedPlayers.highlightInChat) { - val color = SkyHanniMod.feature.markedPlayers.chatColor.getChatColor() + if (MarkedPlayerManager.config.highlightInChat) { + val color = MarkedPlayerManager.config.chatColor.getChatColor() for (markedPlayer in MarkedPlayerManager.playerNamesToMark) { string = string.replace(markedPlayer, "$color$markedPlayer§r") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/chroma/ChromaManager.kt b/src/main/java/at/hannibal2/skyhanni/features/chroma/ChromaManager.kt new file mode 100644 index 000000000..dab2f2cf4 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/chroma/ChromaManager.kt @@ -0,0 +1,28 @@ +package at.hannibal2.skyhanni.features.chroma + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator +import at.hannibal2.skyhanni.config.features.chroma.ChromaConfig +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +object ChromaManager { + + val config get() = SkyHanniMod.feature.gui.chroma + + @JvmStatic + fun resetChromaSettings() { + with(config) { + chromaSize = 30f + chromaSpeed = 6f + chromaSaturation = 0.75f + allChroma = false + ignoreChat = false + chromaDirection = ChromaConfig.Direction.FORWARD_RIGHT + } + } + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { + event.move(31, "chroma", "gui.chroma") + } +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/chroma/ChromaShader.kt b/src/main/java/at/hannibal2/skyhanni/features/chroma/ChromaShader.kt index 96b6d24b7..cfa0ba5ff 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chroma/ChromaShader.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chroma/ChromaShader.kt @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.features.chroma -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.features.chroma.ChromaConfig.Direction import at.hannibal2.skyhanni.data.MinecraftData import at.hannibal2.skyhanni.mixins.transformers.AccessorMinecraft @@ -15,30 +14,29 @@ import net.minecraft.client.Minecraft */ abstract class ChromaShader(vertex: String, fragment: String) : Shader(vertex, fragment) { - val config get() = SkyHanniMod.feature.chroma override fun registerUniforms() { registerUniform(Uniform.UniformType.FLOAT, "chromaSize") { - config.chromaSize * (Minecraft.getMinecraft().displayWidth / 100f) + ChromaManager.config.chromaSize * (Minecraft.getMinecraft().displayWidth / 100f) } registerUniform(Uniform.UniformType.FLOAT, "timeOffset") { var ticks = (MinecraftData.totalTicks / 2) + (Minecraft.getMinecraft() as AccessorMinecraft).timer.renderPartialTicks - ticks = when (config.chromaDirection) { + ticks = when (ChromaManager.config.chromaDirection) { Direction.FORWARD_RIGHT, Direction.BACKWARD_RIGHT -> ticks Direction.FORWARD_LEFT, Direction.BACKWARD_LEFT -> -ticks else -> ticks } - val chromaSpeed = config.chromaSpeed / 360f + val chromaSpeed = ChromaManager.config.chromaSpeed / 360f ticks * chromaSpeed } registerUniform(Uniform.UniformType.FLOAT, "saturation") { - config.chromaSaturation + ChromaManager.config.chromaSaturation } registerUniform(Uniform.UniformType.BOOL, "forwardDirection") { - when (config.chromaDirection) { + when (ChromaManager.config.chromaDirection) { Direction.FORWARD_RIGHT, Direction.FORWARD_LEFT -> true Direction.BACKWARD_RIGHT, Direction.BACKWARD_LEFT -> false else -> true diff --git a/src/main/java/at/hannibal2/skyhanni/features/commands/PartyCommands.kt b/src/main/java/at/hannibal2/skyhanni/features/commands/PartyCommands.kt index 25101ce62..2d595eef7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/commands/PartyCommands.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/commands/PartyCommands.kt @@ -11,7 +11,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent object PartyCommands { - private val config get() = SkyHanniMod.feature.commands + private val config get() = SkyHanniMod.feature.misc.commands fun kickOffline() { if (!config.shortCommands) return @@ -107,6 +107,8 @@ object PartyCommands { @SubscribeEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(5, "commands.usePartyTransferAlias", "commands.shortCommands") + + event.move(31, "commands", "misc.commands") } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/commands/ViewRecipeCommand.kt b/src/main/java/at/hannibal2/skyhanni/features/commands/ViewRecipeCommand.kt index 084060e23..204c39eaa 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/commands/ViewRecipeCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/commands/ViewRecipeCommand.kt @@ -8,7 +8,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent object ViewRecipeCommand { - private val config get() = SkyHanniMod.feature.commands + private val config get() = SkyHanniMod.feature.misc.commands @SubscribeEvent fun onMessageSendToServer(event: MessageSendToServerEvent) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/commands/WarpIsCommand.kt b/src/main/java/at/hannibal2/skyhanni/features/commands/WarpIsCommand.kt index 09dad822c..7d46dbec5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/commands/WarpIsCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/commands/WarpIsCommand.kt @@ -11,7 +11,7 @@ class WarpIsCommand { @SubscribeEvent fun onMessageSendToServer(event: MessageSendToServerEvent) { if (!LorenzUtils.inSkyBlock) return - if (!SkyHanniMod.feature.commands.replaceWarpIs) return + if (!SkyHanniMod.feature.misc.commands.replaceWarpIs) return if (event.message.lowercase() == "/warp is") { event.isCanceled = true diff --git a/src/main/java/at/hannibal2/skyhanni/features/commands/WikiManager.kt b/src/main/java/at/hannibal2/skyhanni/features/commands/WikiManager.kt index 7671ef5a4..ed210ef2b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/commands/WikiManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/commands/WikiManager.kt @@ -22,7 +22,7 @@ object WikiManager { private const val FANDOM_URL_PREFIX = "https://hypixel-skyblock.fandom.com/wiki/" private const val FANDOM_SEARCH_PREFIX = "Special:Search?query=" - private val config get() = SkyHanniMod.feature.commands.betterWiki + private val config get() = SkyHanniMod.feature.misc.commands.betterWiki @SubscribeEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/commands/tabcomplete/GetFromSacksTabComplete.kt b/src/main/java/at/hannibal2/skyhanni/features/commands/tabcomplete/GetFromSacksTabComplete.kt index 331c19fb0..d6c2e85c2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/commands/tabcomplete/GetFromSacksTabComplete.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/commands/tabcomplete/GetFromSacksTabComplete.kt @@ -10,7 +10,7 @@ import at.hannibal2.skyhanni.utils.LorenzUtils object GetFromSacksTabComplete { - private val config get() = SkyHanniMod.feature.commands.tabComplete + private val config get() = SkyHanniMod.feature.misc.commands.tabComplete fun handleTabComplete(command: String): List<String>? { if (!isEnabled()) return null diff --git a/src/main/java/at/hannibal2/skyhanni/features/commands/tabcomplete/PlayerTabComplete.kt b/src/main/java/at/hannibal2/skyhanni/features/commands/tabcomplete/PlayerTabComplete.kt index 3384db554..014df63f7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/commands/tabcomplete/PlayerTabComplete.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/commands/tabcomplete/PlayerTabComplete.kt @@ -13,7 +13,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent object PlayerTabComplete { - private val config get() = SkyHanniMod.feature.commands.tabComplete + private val config get() = SkyHanniMod.feature.misc.commands.tabComplete private var vipVisits = listOf<String>() @SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/commands/tabcomplete/WarpTabComplete.kt b/src/main/java/at/hannibal2/skyhanni/features/commands/tabcomplete/WarpTabComplete.kt index 53a0a8f84..4651040b8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/commands/tabcomplete/WarpTabComplete.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/commands/tabcomplete/WarpTabComplete.kt @@ -8,7 +8,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent object WarpTabComplete { - private val config get() = SkyHanniMod.feature.commands.tabComplete + private val config get() = SkyHanniMod.feature.misc.commands.tabComplete private var warps = listOf<String>() @SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/cosmetics/ArrowTrail.kt b/src/main/java/at/hannibal2/skyhanni/features/cosmetics/ArrowTrail.kt index 90ec54196..d5999c721 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/cosmetics/ArrowTrail.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/cosmetics/ArrowTrail.kt @@ -22,7 +22,7 @@ import kotlin.time.toDuration class ArrowTrail { - private val config get() = SkyHanniMod.feature.misc.cosmetic.arrowTrail + private val config get() = SkyHanniMod.feature.gui.cosmetic.arrowTrail private data class Line(val start: LorenzVec, val end: LorenzVec, val deathTime: SimpleTimeMark) diff --git a/src/main/java/at/hannibal2/skyhanni/features/cosmetics/CosmeticFollowingLine.kt b/src/main/java/at/hannibal2/skyhanni/features/cosmetics/CosmeticFollowingLine.kt index 8f6dd1430..a2dab30cf 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/cosmetics/CosmeticFollowingLine.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/cosmetics/CosmeticFollowingLine.kt @@ -22,7 +22,7 @@ import kotlin.time.Duration.Companion.seconds class CosmeticFollowingLine { - private val config get() = SkyHanniMod.feature.misc.cosmetic.followingLine + private val config get() = SkyHanniMod.feature.gui.cosmetic.followingLine private var locations = mapOf<LorenzVec, LocationSpot>() private var latestLocations = mapOf<LorenzVec, LocationSpot>() @@ -130,5 +130,6 @@ class CosmeticFollowingLine { event.move(9, "misc.cosmeticConfig", "misc.cosmetic") event.move(9, "misc.cosmeticConfig.followingLineConfig", "misc.cosmetic.followingLine") event.move(9, "misc.cosmeticConfig.arrowTrailConfig", "misc.cosmetic.arrowTrail") + event.move(31, "misc.cosmetic", "gui.cosmetic") } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/HighlightBonzoMasks.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/HighlightBonzoMasks.kt index f850b410c..ff9a33587 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HighlightBonzoMasks.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HighlightBonzoMasks.kt @@ -25,7 +25,7 @@ import kotlin.time.TimeSource @OptIn(ExperimentalTime::class) class HighlightBonzoMasks { - private val config get() = SkyHanniMod.feature.itemAbilities + private val config get() = SkyHanniMod.feature.inventory.itemAbilities private val maskTimers = mutableMapOf<String, CooldownTimer>() diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt index bdac13de2..70e458f33 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt @@ -25,6 +25,7 @@ import at.hannibal2.skyhanni.data.PetAPI import at.hannibal2.skyhanni.events.RenderItemTipEvent import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.features.garden.pests.PestAPI +import at.hannibal2.skyhanni.features.skillprogress.SkillProgress import at.hannibal2.skyhanni.features.skillprogress.SkillType import at.hannibal2.skyhanni.utils.ConfigUtils import at.hannibal2.skyhanni.utils.InventoryUtils @@ -168,7 +169,7 @@ object ItemDisplayOverlayFeatures { val level = "" + text.romanToDecimalIfNecessary() val skill = SkillType.getByNameOrNull(skillName) ?: return level val skillInfo = SkillAPI.storage?.get(skill) ?: return level - return if (SkyHanniMod.feature.skillProgress.overflowConfig.enableInSkillMenuAsStackSize) + return if (SkillProgress.config.overflowConfig.enableInSkillMenuAsStackSize) "" + skillInfo.overflowLevel else level } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/ChickenHeadTimer.kt b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/ChickenHeadTimer.kt index 643e15623..88a44640a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/ChickenHeadTimer.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/ChickenHeadTimer.kt @@ -16,7 +16,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.time.Duration.Companion.seconds class ChickenHeadTimer { - private val config get() = SkyHanniMod.feature.itemAbilities.chickenHead + private val config get() = SkyHanniMod.feature.inventory.itemAbilities.chickenHead private var hasChickenHead = false private var lastTime = SimpleTimeMark.farPast() diff --git a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/FireVeilWandParticles.kt b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/FireVeilWandParticles.kt index b5e7fc313..8e6b92bed 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/FireVeilWandParticles.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/FireVeilWandParticles.kt @@ -22,7 +22,7 @@ import kotlin.time.Duration.Companion.seconds class FireVeilWandParticles { - private val config get() = SkyHanniMod.feature.itemAbilities.fireVeilWands + private val config get() = SkyHanniMod.feature.inventory.itemAbilities.fireVeilWands private val item by lazy { "FIRE_VEIL_WAND".asInternalName() } private var lastClick = SimpleTimeMark.farPast() diff --git a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt index 180a09ca2..c7c146ffc 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.itemabilities.abilitycooldown import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.ItemRenderBackground.Companion.background import at.hannibal2.skyhanni.events.ActionBarUpdateEvent import at.hannibal2.skyhanni.events.ItemClickEvent @@ -34,7 +35,7 @@ import kotlin.math.max class ItemAbilityCooldown { - private val config get() = SkyHanniMod.feature.itemAbilities + private val config get() = SkyHanniMod.feature.inventory.itemAbilities private val patternGroup = RepoPattern.group("item.abilities.cooldown") private val youAlignedOthersPattern by patternGroup.pattern( @@ -348,6 +349,11 @@ class ItemAbilityCooldown { } } + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { + event.move(31, "itemAbilities", "inventory.itemAbilities") + } + private fun hasAbility(stack: ItemStack): MutableList<ItemAbility> { val itemName: String = stack.cleanName() val internalName = stack.getInternalName() diff --git a/src/main/java/at/hannibal2/skyhanni/features/minion/InfernoMinionFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/minion/InfernoMinionFeatures.kt index 388941263..e8b317803 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/minion/InfernoMinionFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/minion/InfernoMinionFeatures.kt @@ -16,7 +16,7 @@ import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class InfernoMinionFeatures { - private val config get() = SkyHanniMod.feature.minions + private val config get() = SkyHanniMod.feature.misc.minions private val infernoMinionTitlePattern by RepoPattern.pattern( "minion.infernominiontitle", "Inferno Minion .*" diff --git a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt index 93ba7e540..1f82f52ac 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt @@ -59,7 +59,7 @@ import java.awt.Color class MinionFeatures { - private val config get() = SkyHanniMod.feature.minions + private val config get() = SkyHanniMod.feature.misc.minions private var lastClickedEntity: LorenzVec? = null private var newMinion: LorenzVec? = null private var newMinionName: String? = null @@ -397,5 +397,7 @@ class MinionFeatures { event.move(3, "minions.lastOpenedMinionTime", "minions.lastClickedMinion.time") event.move(3, "minions.emptiedTimeDisplay", "minions.emptiedTime.display") event.move(3, "minions.distance", "minions.emptiedTime.distance") + + event.move(31, "minions", "misc.minions") } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionXp.kt b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionXp.kt index 2f1c14f53..56dddeb13 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionXp.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionXp.kt @@ -28,7 +28,7 @@ import java.util.EnumMap class MinionXp { - private val config get() = SkyHanniMod.feature.minions + private val config get() = SkyHanniMod.feature.misc.minions private val xpItemMap: MutableMap<PrimitiveItemStack, String> = mutableMapOf() private val collectItemXpList: MutableList<String> = mutableListOf() diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/AuctionHousePriceComparison.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/AuctionHousePriceComparison.kt index 187641835..97f1ccd5c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/AuctionHousePriceComparison.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/AuctionHousePriceComparison.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.InventoryOpenEvent import at.hannibal2.skyhanni.events.LorenzToolTipEvent @@ -20,7 +21,7 @@ import java.awt.Color class AuctionHousePriceComparison { - private val config get() = SkyHanniMod.feature.inventory.auctionsPriceComparison + private val config get() = SkyHanniMod.feature.inventory.auctions.auctionsPriceComparison private var slotPriceMap = mapOf<Int, Long>() private var bestPrice = 0L @@ -117,6 +118,11 @@ class AuctionHousePriceComparison { } } + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { + event.move(31, "inventory.auctionsPriceComparison", "inventory.auctions.auctionsPriceComparison") + } + private fun getColorInBetween(color1: Color, color2: Color, percentage: Double): Color { val r1 = color1.red val g1 = color1.green diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/BetterWikiFromMenus.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/BetterWikiFromMenus.kt index 26addd367..653684d08 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/BetterWikiFromMenus.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/BetterWikiFromMenus.kt @@ -13,7 +13,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class BetterWikiFromMenus { - private val config get() = SkyHanniMod.feature.commands.betterWiki + private val config get() = SkyHanniMod.feature.misc.commands.betterWiki @SubscribeEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/MarkedPlayerManager.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/MarkedPlayerManager.kt index 86c7ffc92..0adf1d5ec 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/MarkedPlayerManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/MarkedPlayerManager.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.config.enums.OutsideSbFeature import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.LorenzTickEvent @@ -18,7 +19,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class MarkedPlayerManager { companion object { - private val config get() = SkyHanniMod.feature.markedPlayers + val config get() = SkyHanniMod.feature.gui.markedPlayers val playerNamesToMark = mutableListOf<String>() private val markedPlayers = mutableMapOf<String, EntityOtherPlayerMP>() @@ -117,4 +118,9 @@ class MarkedPlayerManager { } } } + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { + event.move(31, "markedPlayers", "gui.markedPlayers") + } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/PocketSackInASackDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/PocketSackInASackDisplay.kt index 7e34aa009..f60eb930e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/PocketSackInASackDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/PocketSackInASackDisplay.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.GuiRenderItemEvent import at.hannibal2.skyhanni.events.LorenzToolTipEvent import at.hannibal2.skyhanni.utils.ItemUtils @@ -11,7 +12,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class PocketSackInASackDisplay { - private val config get() = SkyHanniMod.feature.misc.pocketSackInASack + private val config get() = SkyHanniMod.feature.inventory.pocketSackInASack private val maxedStitched = 3 @SubscribeEvent @@ -51,4 +52,9 @@ class PocketSackInASackDisplay { } } } -}
\ No newline at end of file + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { + event.move(31, "misc.pocketSackInASack", "inventory.pocketSackInASack") + } +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/AdvancedPlayerList.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/AdvancedPlayerList.kt index 4d96b9bc0..021213117 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/AdvancedPlayerList.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/AdvancedPlayerList.kt @@ -27,7 +27,7 @@ import kotlin.time.Duration.Companion.minutes object AdvancedPlayerList { - private val config get() = SkyHanniMod.feature.misc.compactTabList.advancedPlayerList + private val config get() = SkyHanniMod.feature.gui.compactTabList.advancedPlayerList private val levelPattern by RepoPattern.pattern( "misc.compacttablist.advanced.level", @@ -220,7 +220,7 @@ object AdvancedPlayerList { private fun getSocialScoreIcon(score: Int) = when (score) { // 10 -> "§c§lME" 10 -> "" - 8 -> "${SkyHanniMod.feature.markedPlayers.chatColor.getChatColor()}§lMARKED" + 8 -> "${MarkedPlayerManager.config.chatColor.getChatColor()}§lMARKED" 5 -> "§9§lP" 4 -> "§d§lF" 3 -> "§2§lG" diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListReader.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListReader.kt index bba2ff6aa..42bd78cfc 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListReader.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListReader.kt @@ -13,7 +13,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent // heavily inspired by SBA code object TabListReader { - private val config get() = SkyHanniMod.feature.misc.compactTabList + private val config get() = SkyHanniMod.feature.gui.compactTabList private val patternGroup = RepoPattern.group("misc.compacttablist") val usernamePattern by patternGroup.pattern( diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListRenderer.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListRenderer.kt index a2eacb07e..ccb70bd8f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListRenderer.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListRenderer.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.misc.compacttablist import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.SkipTabListLineEvent import at.hannibal2.skyhanni.utils.CollectionUtils.filterToMutable @@ -19,7 +20,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent object TabListRenderer { - private val config get() = SkyHanniMod.feature.misc.compactTabList + private val config get() = SkyHanniMod.feature.gui.compactTabList const val maxLines = 22 private const val lineHeight = 8 + 1 @@ -224,4 +225,9 @@ object TabListRenderer { event.cancel() } } + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { + event.move(31, "misc.compactTabList", "gui.compactTabList") + } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordRPCManager.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordRPCManager.kt index 2fb3e0241..1693c0a5d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordRPCManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordRPCManager.kt @@ -39,7 +39,7 @@ object DiscordRPCManager : IPCListener { private const val applicationID = 1093298182735282176L private const val updatePeriod = 4200L - private val config get() = feature.misc.discordRPC + val config get() = feature.gui.discordRPC private var client: IPCClient? = null private lateinit var secondLine: DiscordStatus @@ -249,6 +249,8 @@ object DiscordRPCManager : IPCListener { event.transform(11, "misc.discordRPC.autoPriority") { element -> ConfigUtils.migrateIntArrayListToEnumArrayList(element, PriorityEntry::class.java) } + + event.move(31, "misc.discordRPC", "gui.discordRPC") } private fun PriorityEntry.isSelected() = config.autoPriority.contains(this) diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt index de93ad491..e5741807b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt @@ -2,7 +2,6 @@ package at.hannibal2.skyhanni.features.misc.discordrpc // SkyblockAddons code, adapted for SkyHanni with some additions and fixes -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.data.ActionBarStatsData import at.hannibal2.skyhanni.data.GardenCropMilestones.getCounter import at.hannibal2.skyhanni.data.GardenCropMilestones.getTierForCropCount @@ -209,12 +208,12 @@ enum class DiscordStatus(private val displayMessageSupplier: Supplier<String>?) }), CUSTOM({ - SkyHanniMod.feature.misc.discordRPC.customText.get() // custom field in the config + DiscordRPCManager.config.customText.get() // custom field in the config }), AUTO({ var autoReturn = "" - for (statusID in SkyHanniMod.feature.misc.discordRPC.autoPriority) { // for every dynamic that the user wants to see... + for (statusID in DiscordRPCManager.config.autoPriority) { // for every dynamic that the user wants to see... // TODO, change functionality to use enum rather than ordinals val autoStatus = AutoStatus.entries[statusID.ordinal] val result = @@ -227,7 +226,7 @@ enum class DiscordStatus(private val displayMessageSupplier: Supplier<String>?) if (autoReturn == "") { // if we didn't find any useful information, display the fallback val statusNoAuto = DiscordStatus.entries.toMutableList() statusNoAuto.remove(AUTO) - autoReturn = statusNoAuto[SkyHanniMod.feature.misc.discordRPC.auto.get().ordinal].getDisplayString() + autoReturn = statusNoAuto[DiscordRPCManager.config.auto.get().ordinal].getDisplayString() } autoReturn }), diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt index 9040abfe0..fdd6db618 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt @@ -38,7 +38,7 @@ import kotlin.math.roundToLong object EstimatedItemValue { - private val config get() = SkyHanniMod.feature.misc.estimatedItemValues + val config get() = SkyHanniMod.feature.inventory.estimatedItemValues private var display = emptyList<List<Any>>() private val cache = mutableMapOf<ItemStack, List<List<Any>>>() private var lastToolTipTime = 0L @@ -235,5 +235,7 @@ object EstimatedItemValue { event.move(3, "misc.estimatedIemValueEnchantmentsCap", "misc.estimatedItemValues.enchantmentsCap") event.move(3, "misc.estimatedIemValueExactPrice", "misc.estimatedItemValues.exactPrice") event.move(3, "misc.itemPriceDataPos", "misc.estimatedItemValues.itemPriceDataPos") + + event.move(31, "misc.estimatedItemValues", "inventory.estimatedItemValues") } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt index 6b90adba6..a1750e5c0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.features.misc.items -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.CollectionUtils.sortedDesc import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName @@ -56,7 +55,7 @@ import java.util.Locale object EstimatedItemValueCalculator { - private val config get() = SkyHanniMod.feature.misc.estimatedItemValues + private val config get() = EstimatedItemValue.config private val additionalCostFunctions = listOf( ::addAttributeCost, ::addReforgeStone, diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedWardrobePrice.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedWardrobePrice.kt index d3b226744..c36fdbbf5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedWardrobePrice.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedWardrobePrice.kt @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.features.misc.items -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.events.LorenzToolTipEvent @@ -14,7 +13,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class EstimatedWardrobePrice { - private val config get() = SkyHanniMod.feature.misc.estimatedItemValues + private val config get() = EstimatedItemValue.config var data = mutableMapOf<Int, MutableList<ItemStack>>() @SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt b/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt index ee6d1306b..30ccfe672 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt @@ -43,7 +43,7 @@ import kotlin.time.Duration.Companion.seconds object SkillProgress { - private val config get() = SkyHanniMod.feature.skillProgress + val config get() = SkyHanniMod.feature.skillProgress private val barConfig get() = config.skillProgressBarConfig private val allSkillConfig get() = config.allSkillDisplayConfig val etaConfig get() = config.skillETADisplayConfig diff --git a/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillTooltip.kt b/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillTooltip.kt index d9aba8d20..75c69f491 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillTooltip.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillTooltip.kt @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.features.skillprogress -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.api.SkillAPI import at.hannibal2.skyhanni.api.SkillAPI.excludedSkills import at.hannibal2.skyhanni.events.LorenzToolTipEvent @@ -17,9 +16,8 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class SkillTooltip { - private val config get() = SkyHanniMod.feature.skillProgress - private val overflowConfig get() = config.overflowConfig - private val customGoalConfig get() = config.customGoalConfig + private val overflowConfig get() = SkillProgress.config.overflowConfig + private val customGoalConfig get() = SkillProgress.config.customGoalConfig @SubscribeEvent fun onTooltip(event: LorenzToolTipEvent) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/stranded/HighlightPlaceableNpcs.kt b/src/main/java/at/hannibal2/skyhanni/features/stranded/HighlightPlaceableNpcs.kt index 75cadeef5..0ce2d0cb5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/stranded/HighlightPlaceableNpcs.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/stranded/HighlightPlaceableNpcs.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.stranded import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent @@ -16,7 +17,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class HighlightPlaceableNpcs { - private val config get() = SkyHanniMod.feature.stranded + private val config get() = SkyHanniMod.feature.misc.stranded private val locationPattern by RepoPattern.pattern( "stranded.highlightplacement.location", @@ -59,6 +60,11 @@ class HighlightPlaceableNpcs { } } + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { + event.move(31, "stranded", "misc.stranded") + } + private fun isPlaceableNpc(lore: List<String>): Boolean { // Checking if NPC & placeable if (lore.isEmpty() || !(lore.last() == "§ethis NPC!" || lore.last() == "§eyour location!")) { diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/FontRendererHook.kt b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/FontRendererHook.kt index b48b1376c..881a1c42a 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/FontRendererHook.kt +++ b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/FontRendererHook.kt @@ -1,7 +1,7 @@ package at.hannibal2.skyhanni.mixins.hooks -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.features.chroma.ChromaFontRenderer +import at.hannibal2.skyhanni.features.chroma.ChromaManager import at.hannibal2.skyhanni.mixins.transformers.AccessorFontRenderer import at.hannibal2.skyhanni.utils.LorenzUtils import net.minecraft.client.Minecraft @@ -63,8 +63,8 @@ object FontRendererHook { @JvmStatic fun beginChromaRendering(text: String, shadow: Boolean) { if (!LorenzUtils.inSkyBlock) return - if (!SkyHanniMod.feature.chroma.enabled) return - if (SkyHanniMod.feature.chroma.allChroma && SkyHanniMod.feature.chroma.ignoreChat && cameFromChat) { + if (!ChromaManager.config.enabled) return + if (ChromaManager.config.allChroma && ChromaManager.config.ignoreChat && cameFromChat) { endChromaFont() return } @@ -84,7 +84,7 @@ object FontRendererHook { } // Best feature ngl - if (SkyHanniMod.feature.chroma.allChroma) { + if (ChromaManager.config.allChroma) { // Handles setting the base color of text when they don't use color codes i.e. MoulConfig if (shadow) { GlStateManager.color(0.33f, 0.33f, 0.33f, 1f) @@ -108,7 +108,7 @@ object FontRendererHook { fun forceWhiteColorCode(i1: Int): Int { if (!LorenzUtils.inSkyBlock) return i1 - if (!SkyHanniMod.feature.chroma.enabled) return i1 + if (!ChromaManager.config.enabled) return i1 val drawState = currentDrawState ?: return i1 if (drawState.getChromaState()) { @@ -123,7 +123,7 @@ object FontRendererHook { @JvmStatic fun restoreChromaState() { if (!LorenzUtils.inSkyBlock) return - if (!SkyHanniMod.feature.chroma.enabled) return + if (!ChromaManager.config.enabled) return currentDrawState?.restoreChromaEnv() } @@ -131,21 +131,21 @@ object FontRendererHook { @JvmStatic fun endChromaRendering() { if (!LorenzUtils.inSkyBlock) return - if (!SkyHanniMod.feature.chroma.enabled) return + if (!ChromaManager.config.enabled) return if (previewChroma) { previewChroma = false endChromaFont() } - if (SkyHanniMod.feature.chroma.allChroma) endChromaFont() + if (ChromaManager.config.allChroma) endChromaFont() currentDrawState?.endChromaEnv() } @JvmStatic fun insertZColorCode(constant: String): String { - return if (LorenzUtils.inSkyBlock && !SkyHanniMod.feature.chroma.enabled) constant else "0123456789abcdefklmnorz" + return if (LorenzUtils.inSkyBlock && !ChromaManager.config.enabled) constant else "0123456789abcdefklmnorz" } // TODO add better parameter names @@ -159,7 +159,7 @@ object FontRendererHook { i1: Int, ): Boolean { if (!LorenzUtils.inSkyBlock) return false - if (!SkyHanniMod.feature.chroma.enabled) return false + if (!ChromaManager.config.enabled) return false if (i1 == 22) { toggleChromaOn() return true diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/MixinPatcherFontRendererHookHook.kt b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/MixinPatcherFontRendererHookHook.kt index 6bbbbf6e4..92e545a44 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/MixinPatcherFontRendererHookHook.kt +++ b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/MixinPatcherFontRendererHookHook.kt @@ -1,6 +1,6 @@ package at.hannibal2.skyhanni.mixins.hooks -import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.features.chroma.ChromaManager import at.hannibal2.skyhanni.utils.LorenzUtils import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable @@ -11,7 +11,7 @@ class MixinPatcherFontRendererHookHook { fun overridePatcherFontRenderer(string: String, shadow: Boolean, cir: CallbackInfoReturnable<Boolean>) { if (!LorenzUtils.onHypixel) return - if (SkyHanniMod.feature.chroma.enabled) { + if (ChromaManager.config.enabled) { cir.cancel() cir.returnValue = false } |