From 7a634386ec4dd842e946bd3ba331c0d565faf173 Mon Sep 17 00:00:00 2001 From: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> Date: Sat, 14 Oct 2023 21:45:26 +1100 Subject: Feature: Modify Visual Words (#492) Added /shwords. #492 --- .../java/at/hannibal2/skyhanni/config/Storage.java | 4 ++++ .../hannibal2/skyhanni/config/commands/Commands.kt | 11 +++++++++ .../skyhanni/config/features/GUIConfig.java | 27 ++++++++++++++++++++++ .../skyhanni/config/features/GardenConfig.java | 2 +- 4 files changed, 43 insertions(+), 1 deletion(-) (limited to 'src/main/java/at/hannibal2/skyhanni/config') diff --git a/src/main/java/at/hannibal2/skyhanni/config/Storage.java b/src/main/java/at/hannibal2/skyhanni/config/Storage.java index a80211e3a..9f1455605 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/Storage.java +++ b/src/main/java/at/hannibal2/skyhanni/config/Storage.java @@ -13,6 +13,7 @@ import at.hannibal2.skyhanni.features.misc.FrozenTreasure; import at.hannibal2.skyhanni.features.misc.ghostcounter.GhostData; import at.hannibal2.skyhanni.features.misc.powdertracker.PowderChestReward; import at.hannibal2.skyhanni.features.misc.trevor.TrevorTracker; +import at.hannibal2.skyhanni.features.misc.visualwords.VisualWord; import at.hannibal2.skyhanni.features.rift.area.westvillage.KloonTerminal; import at.hannibal2.skyhanni.utils.LorenzVec; import at.hannibal2.skyhanni.utils.NEUInternalName; @@ -36,6 +37,9 @@ public class Storage { @Expose public Map> gardenJacobFarmingContestTimes = new HashMap<>(); + @Expose + public List modifiedWords = new ArrayList<>(); + @Expose public Boolean contestSendingAsked = false; 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 7d21fa92e..57f95b56b 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt @@ -28,6 +28,7 @@ import at.hannibal2.skyhanni.features.misc.MarkedPlayerManager import at.hannibal2.skyhanni.features.misc.discordrpc.DiscordRPCManager import at.hannibal2.skyhanni.features.misc.ghostcounter.GhostUtil import at.hannibal2.skyhanni.features.misc.massconfiguration.DefaultConfigFeatures +import at.hannibal2.skyhanni.features.misc.visualwords.VisualWordGui import at.hannibal2.skyhanni.features.slayer.SlayerItemProfitTracker import at.hannibal2.skyhanni.test.PacketTest import at.hannibal2.skyhanni.test.SkyHanniConfigSearchResetCommand @@ -277,6 +278,7 @@ object Commands { // "shsendtranslation", // "Respond with a translation of the message that the user clicks" // ) { Translator.toEnglish(it) } + registerCommand("shwords", "Opens the config list for modifying visual words") { openVisualWords() } } private fun commandHelp(args: Array) { @@ -325,6 +327,15 @@ object Commands { } } + @JvmStatic + fun openVisualWords() { + if (!LorenzUtils.onHypixel) { + LorenzUtils.chat("§cYou need to join Hypixel to use this feature!") + } else { + SkyHanniMod.screenToOpen = VisualWordGui() + } + } + private fun clearFarmingItems() { val config = GardenAPI.config?.fortune ?: return LorenzUtils.chat("§e[SkyHanni] clearing farming items") diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/GUIConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/GUIConfig.java index ed365809c..47b62e9e5 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/GUIConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/GUIConfig.java @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.config.features; import at.hannibal2.skyhanni.config.FeatureToggle; +import at.hannibal2.skyhanni.config.commands.Commands; import at.hannibal2.skyhanni.config.core.config.Position; import at.hannibal2.skyhanni.data.GuiEditManager; import com.google.gson.annotations.Expose; @@ -30,6 +31,32 @@ public class GUIConfig { @ConfigEditorSlider(minValue = 0.1F, maxValue = 10, minStep = 0.05F) public float globalScale = 1F; + + @Expose + @ConfigOption(name = "Modify Visual Words", desc = "") + @Accordion + public ModifyWords modifyWords = new ModifyWords(); + + public static class ModifyWords { + + @Expose + @ConfigOption(name = "Enabled", desc = "Enables replacing all instances of a word or phrase with another word or phrase.") + @ConfigEditorBoolean + @FeatureToggle + public boolean enabled = true; + + @Expose + @ConfigOption(name = "Work Outside SkyBlock", desc = "Allows modifying visual words anywhere on Hypixel.") + @ConfigEditorBoolean + @FeatureToggle + public boolean workOutside = false; + + @ConfigOption(name = "Open Config", desc = "Opens the menu to setup the visual words.\n§eCommand: /shwords") + @ConfigEditorButton(buttonText = "Open") + public Runnable open = Commands::openVisualWords; + + } + @Expose @ConfigOption(name = "Custom Text Box", desc = "") @Accordion diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/GardenConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/GardenConfig.java index 2bb959f44..a74895a7f 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/GardenConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/GardenConfig.java @@ -1270,7 +1270,7 @@ public class GardenConfig { @ConfigOption(name = "Farming Fortune Guide", desc = "Opens a guide that breaks down your Farming Fortune.\n§eCommand: /ff") @ConfigEditorButton(buttonText = "Open") - public Runnable positions = Commands::openFortuneGuide; + public Runnable open = Commands::openFortuneGuide; @Expose public Position farmingFortunePos = new Position(5, -180, false, true); -- cgit