diff options
author | CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> | 2023-10-14 21:45:26 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-14 12:45:26 +0200 |
commit | 7a634386ec4dd842e946bd3ba331c0d565faf173 (patch) | |
tree | 558cc86b80b6e1af0d2a8ba857324b1d72ed774b /src/main/java/at/hannibal2/skyhanni/config | |
parent | 16ef943b3c2ce8db2331332261143a12bdba61cf (diff) | |
download | skyhanni-7a634386ec4dd842e946bd3ba331c0d565faf173.tar.gz skyhanni-7a634386ec4dd842e946bd3ba331c0d565faf173.tar.bz2 skyhanni-7a634386ec4dd842e946bd3ba331c0d565faf173.zip |
Feature: Modify Visual Words (#492)
Added /shwords. #492
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/config')
4 files changed, 43 insertions, 1 deletions
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; @@ -37,6 +38,9 @@ public class Storage { public Map<Long, List<CropType>> gardenJacobFarmingContestTimes = new HashMap<>(); @Expose + public List<VisualWord> modifiedWords = new ArrayList<>(); + + @Expose public Boolean contestSendingAsked = false; @Expose 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<String>) { @@ -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); |