From 9cfdf252304e3fe270bd84ddcae292273a9927aa Mon Sep 17 00:00:00 2001 From: Obsidian <108832807+Obsidianninja11@users.noreply.github.com> Date: Fri, 9 Feb 2024 13:40:02 -0900 Subject: SkyHanni's own /wiki command logic now works better in SkyBlock Level guide and allows to change weather to use official Hypixel Wiki or the older Fandom Wiki. #831 --- .../hannibal2/skyhanni/config/commands/Commands.kt | 17 +++++++++ .../features/commands/BetterWikiCommandConfig.java | 44 ++++++++++++++++++++++ .../config/features/commands/CommandsConfig.java | 4 +- .../features/commands/FandomWikiCommandConfig.java | 27 ------------- 4 files changed, 63 insertions(+), 29 deletions(-) create mode 100644 src/main/java/at/hannibal2/skyhanni/config/features/commands/BetterWikiCommandConfig.java delete mode 100644 src/main/java/at/hannibal2/skyhanni/config/features/commands/FandomWikiCommandConfig.java (limited to 'src/main/java/at/hannibal2/skyhanni/config') diff --git a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt index 771bf7055..e2868a931 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt @@ -14,6 +14,7 @@ import at.hannibal2.skyhanni.features.chat.Translator import at.hannibal2.skyhanni.features.combat.endernodetracker.EnderNodeTracker import at.hannibal2.skyhanni.features.combat.ghostcounter.GhostUtil import at.hannibal2.skyhanni.features.commands.PartyCommands +import at.hannibal2.skyhanni.features.commands.WikiManager import at.hannibal2.skyhanni.features.event.diana.BurrowWarpHelper import at.hannibal2.skyhanni.features.event.diana.DianaProfitTracker import at.hannibal2.skyhanni.features.event.diana.GriffinBurrowHelper @@ -237,6 +238,22 @@ object Commands { "shresetseacreaturetracker", "Resets the Sea Creature Tracker" ) { SeaCreatureTracker.resetCommand(it) } + registerCommand( + "shfandomwiki", + "Searches the fandom wiki with SkyHanni's own method." + ) {WikiManager.otherWikiCommands(it, true)} + registerCommand( + "shfandomwikithis", + "Searches the fandom wiki with SkyHanni's own method." + ) {WikiManager.otherWikiCommands(it, true, true)} + registerCommand( + "shofficialwiki", + "Searches the official wiki with SkyHanni's own method." + ) {WikiManager.otherWikiCommands(it, false)} + registerCommand( + "shofficialwikithis", + "Searches the official wiki with SkyHanni's own method." + ) {WikiManager.otherWikiCommands(it, false, true)} registerCommand0("shcalccrop", "Calculate how many crops need to be farmed between different crop milestones.", { FarmingMilestoneCommand.onCommand(it.getOrNull(0), it.getOrNull(1), it.getOrNull(2), false) }, FarmingMilestoneCommand::onComplete) diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/commands/BetterWikiCommandConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/commands/BetterWikiCommandConfig.java new file mode 100644 index 000000000..68356dd9e --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/features/commands/BetterWikiCommandConfig.java @@ -0,0 +1,44 @@ +package at.hannibal2.skyhanni.config.features.commands; + +import at.hannibal2.skyhanni.config.FeatureToggle; +import com.google.gson.annotations.Expose; +import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean; +import io.github.moulberry.moulconfig.annotations.ConfigEditorKeybind; +import io.github.moulberry.moulconfig.annotations.ConfigOption; +import org.lwjgl.input.Keyboard; + +public class BetterWikiCommandConfig { + + @Expose + @ConfigOption(name = "Enabled", desc = "Improve the functionality of the /wiki command.\nThis is required for all of the below features.") + @ConfigEditorBoolean + @FeatureToggle + public boolean enabled = false; + + @Expose + @ConfigOption(name = "SkyBlock Guide", desc = "Use SkyHanni's method in the SkyBlock Guide.") // TODO Make this method not suck + @ConfigEditorBoolean + @FeatureToggle + public boolean sbGuide = false; + + @Expose + @ConfigOption(name = "Use Fandom Wiki", desc = "Use Fandom Wiki (§ehypixel-skyblock.fandom.com§7) instead of the Hypixel wiki (§ewiki.hypixel.net§7) in most wiki-related chat messages.") + @ConfigEditorBoolean + @FeatureToggle + public boolean useFandom = false; + + @Expose + @ConfigOption(name = "Auto Open", desc = "Directly opens the Wiki when running the command instead of having to click a message in chat.") + @ConfigEditorBoolean + public boolean autoOpenWiki = false; + + @Expose + @ConfigOption(name = "Open from Menus", desc = "Directly opens the Wiki from menus instead of having to click a message in chat.") + @ConfigEditorBoolean + public boolean menuOpenWiki = false; + + @Expose + @ConfigOption(name = "Fandom Wiki Key", desc = "Search for an item on Wiki with this keybind.\n§4For optimal experiences, do §lNOT§r §4bind this to a mouse button.") + @ConfigEditorKeybind(defaultKey = Keyboard.KEY_NONE) + public int wikiKeybind = Keyboard.KEY_NONE; +} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/commands/CommandsConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/commands/CommandsConfig.java index 4003cfb99..01f831246 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/commands/CommandsConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/commands/CommandsConfig.java @@ -13,10 +13,10 @@ public class CommandsConfig { @Expose public TabCompleteConfig tabComplete = new TabCompleteConfig(); - @ConfigOption(name = "Fandom Wiki for §e/wiki", desc = "") + @ConfigOption(name = "Better §e/wiki", desc = "") @Accordion @Expose - public FandomWikiCommandConfig fandomWiki = new FandomWikiCommandConfig(); + public BetterWikiCommandConfig betterWiki = new BetterWikiCommandConfig(); @ConfigOption(name = "Party Commands", desc = "Shortens party commands and allows tab-completing for them. " + "\n§eCommands: /pt /pp /pko /pk /pd §7SkyBlock command §e/pt §7to check the play time still works.") diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/commands/FandomWikiCommandConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/commands/FandomWikiCommandConfig.java deleted file mode 100644 index c8a25a204..000000000 --- a/src/main/java/at/hannibal2/skyhanni/config/features/commands/FandomWikiCommandConfig.java +++ /dev/null @@ -1,27 +0,0 @@ -package at.hannibal2.skyhanni.config.features.commands; - -import at.hannibal2.skyhanni.config.FeatureToggle; -import com.google.gson.annotations.Expose; -import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean; -import io.github.moulberry.moulconfig.annotations.ConfigEditorKeybind; -import io.github.moulberry.moulconfig.annotations.ConfigOption; -import org.lwjgl.input.Keyboard; - -public class FandomWikiCommandConfig { - - @Expose - @ConfigOption(name = "Enabled", desc = "Use Fandom Wiki (§ehypixel-skyblock.fandom.com§7) instead of the Hypixel wiki (§ewiki.hypixel.net§7) in most wiki-related chat messages.") - @ConfigEditorBoolean - @FeatureToggle - public boolean enabled = false; - - @Expose - @ConfigOption(name = "Skip Chat", desc = "Directly opens the Fandom Wiki instead of sending the §e\"Click to search for this thing on the Fandom Wiki\"§7 message beforehand.") - @ConfigEditorBoolean - public boolean skipWikiChat = false; - - @Expose - @ConfigOption(name = "Fandom Wiki Key", desc = "Search for an item on Fandom Wiki with this keybind.\n§4For optimal experiences, do §lNOT§r §4bind this to a mouse button.") - @ConfigEditorKeybind(defaultKey = Keyboard.KEY_NONE) - public int fandomWikiKeybind = Keyboard.KEY_NONE; -} -- cgit