diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-09-17 08:57:23 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-09-17 08:57:23 +0200 |
commit | dcc0a269be6ab53099574d79dda92f1516dfa539 (patch) | |
tree | 2114231bafc588beb9a2763f6ede019a98cb9521 /src/main | |
parent | f00efbd001ab2c00e6ff9054235efc27bd36a526 (diff) | |
download | skyhanni-dcc0a269be6ab53099574d79dda92f1516dfa539.tar.gz skyhanni-dcc0a269be6ab53099574d79dda92f1516dfa539.tar.bz2 skyhanni-dcc0a269be6ab53099574d79dda92f1516dfa539.zip |
migrate tab complete config into commands
Diffstat (limited to 'src/main')
5 files changed, 58 insertions, 51 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/CommandsConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/CommandsConfig.java index e7be4768f..7d5633e51 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/CommandsConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/CommandsConfig.java @@ -2,11 +2,60 @@ package at.hannibal2.skyhanni.config.features; 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.ConfigOption; public class CommandsConfig { + @ConfigOption(name = "Tab Complete", desc = "") + @Accordion + @Expose + public TabCompleteConfig tabComplete = new TabCompleteConfig(); + + public static class TabCompleteConfig { + + @Expose + @ConfigOption(name = "Warps", desc = "Tab complete the warp-point names when typing §e/warp <TAB>§7.") + @ConfigEditorBoolean + @FeatureToggle + public boolean warps = true; + + @Expose + @ConfigOption(name = "Island Players", desc = "Tab complete other players on the same island.") + public boolean islandPlayers = true; + + @Expose + @ConfigOption(name = "Friends", desc = "Tab complete friends from your friends list.") + @ConfigEditorBoolean + @FeatureToggle + public boolean friends = true; + + @Expose + @ConfigOption(name = "Only Best Friends", desc = "Only Tab Complete best friends.") + @ConfigEditorBoolean + @FeatureToggle + public boolean onlyBestFriends = false; + + @Expose + @ConfigOption(name = "Party", desc = "Tab complete Party Members.") + @ConfigEditorBoolean + @FeatureToggle + public boolean party = true; + + @Expose + @ConfigOption(name = "VIP Visits", desc = "Tab complete the visit to special users with cake souls on it.") + @ConfigEditorBoolean + @FeatureToggle + public boolean vipVisits = true; + + @Expose + @ConfigOption(name = "/gfs Sack", desc = "Tab complete /gfs sack items.") + @ConfigEditorBoolean + @FeatureToggle + public boolean gfsSack = true; + } + @Expose @ConfigOption(name = "Fandom Wiki", desc = "Use Fandom wiki (§ehypixel-skyblock.fandom.com§7) instead of the Hypixel wiki (§ewiki.hypixel.net§7).") @ConfigEditorBoolean diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java index b4e405526..ccd444b69 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java @@ -470,54 +470,6 @@ public class MiscConfig { public Position pos = new Position(150, 150, false, true); } - @ConfigOption(name = "Tab Complete Commands", desc = "") - @Accordion - @Expose - public TabCompleteCommands tabCompleteCommands = new TabCompleteCommands(); - - public static class TabCompleteCommands { - - @Expose - @ConfigOption(name = "Warps", desc = "Tab complete the warp-point names when typing §e/warp <TAB>§7.") - @ConfigEditorBoolean - @FeatureToggle - public boolean warps = true; - - @Expose - @ConfigOption(name = "Island Players", desc = "Tab complete other players on the same island.") - public boolean islandPlayers = true; - - @Expose - @ConfigOption(name = "Friends", desc = "Tab complete friends from your friends list.") - @ConfigEditorBoolean - @FeatureToggle - public boolean friends = true; - - @Expose - @ConfigOption(name = "Only Best Friends", desc = "Only Tab Complete best friends.") - @ConfigEditorBoolean - @FeatureToggle - public boolean onlyBestFriends = false; - - @Expose - @ConfigOption(name = "Party", desc = "Tab complete Party Members.") - @ConfigEditorBoolean - @FeatureToggle - public boolean party = true; - - @Expose - @ConfigOption(name = "VIP Visits", desc = "Tab complete the visit to special users with cake souls on it.") - @ConfigEditorBoolean - @FeatureToggle - public boolean vipVisits = true; - - @Expose - @ConfigOption(name = "/gfs Sack", desc = "Tab complete /gfs sack items.") - @ConfigEditorBoolean - @FeatureToggle - public boolean gfsSack = true; - } - @ConfigOption(name = "Pocket Sack-In-A-Sack", desc = "") @Accordion @Expose diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/tabcomplete/GetFromSacksTabComplete.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/tabcomplete/GetFromSacksTabComplete.kt index b8e3f56ad..50d1724e5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/tabcomplete/GetFromSacksTabComplete.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/tabcomplete/GetFromSacksTabComplete.kt @@ -9,7 +9,7 @@ import net.minecraft.network.play.client.C01PacketChatMessage import net.minecraftforge.fml.common.eventhandler.SubscribeEvent object GetFromSacksTabComplete { - private val config get() = SkyHanniMod.feature.misc.tabCompleteCommands + private val config get() = SkyHanniMod.feature.commands.tabComplete private var sackList = emptyList<String>() private val commands = arrayOf("gfs", "getfromsacks") diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/tabcomplete/PlayerTabComplete.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/tabcomplete/PlayerTabComplete.kt index 5bf74e44c..27430c5de 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/tabcomplete/PlayerTabComplete.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/tabcomplete/PlayerTabComplete.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.misc.tabcomplete import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.FriendAPI import at.hannibal2.skyhanni.data.PartyAPI import at.hannibal2.skyhanni.events.RepositoryReloadEvent @@ -11,7 +12,7 @@ import net.minecraft.client.entity.EntityOtherPlayerMP import net.minecraftforge.fml.common.eventhandler.SubscribeEvent object PlayerTabComplete { - private val config get() = SkyHanniMod.feature.misc.tabCompleteCommands + private val config get() = SkyHanniMod.feature.commands.tabComplete private var vipVisitsJson: VipVisitsJson? = null @SubscribeEvent @@ -19,6 +20,11 @@ object PlayerTabComplete { vipVisitsJson = event.getConstant<VipVisitsJson>("VipVisits") } + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { + event.move(2, "misc.tabCompleteCommands", "commands.tabComplete") + } + enum class PlayerCategory { PARTY, FRIENDS, diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/tabcomplete/WarpTabComplete.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/tabcomplete/WarpTabComplete.kt index cc948c86e..034ea12dc 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/tabcomplete/WarpTabComplete.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/tabcomplete/WarpTabComplete.kt @@ -7,7 +7,7 @@ import at.hannibal2.skyhanni.utils.jsonobjects.WarpsJson import net.minecraftforge.fml.common.eventhandler.SubscribeEvent object WarpTabComplete { - private val config get() = SkyHanniMod.feature.misc.tabCompleteCommands + private val config get() = SkyHanniMod.feature.commands.tabComplete private var warpsJson: WarpsJson? = null @SubscribeEvent |