From 8fc13f59b30eb19be78aa2d1da4073459d1add1d Mon Sep 17 00:00:00 2001 From: Sapodilla Date: Thu, 8 Sep 2022 01:41:45 +0100 Subject: Added warp autocompletes also fixed ordering of setTabCompletions inside featureManager --- features/globalSettings/index.js | 13 ++++++++++++ features/globalSettings/warps.json | 41 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 features/globalSettings/warps.json (limited to 'features/globalSettings') diff --git a/features/globalSettings/index.js b/features/globalSettings/index.js index e8b86ab..a1c6a3c 100644 --- a/features/globalSettings/index.js +++ b/features/globalSettings/index.js @@ -60,6 +60,7 @@ class GlobalSettings extends Feature { this.itemWorth = new ToggleSetting("(Approximate) Item worth in lore", "Accounts for stuff like enchants/recombs ect", false, "item_worth", this) this.showHecatomb = new ToggleSetting("Show hecatomb enchant info in lore", "", true, "show_hecatomb", this) this.showChampion = new ToggleSetting("Show champion enchant info in lore", "", true, "show_champion", this) + this.warpCompletions = new ToggleSetting("Autocomplete warp locations with tab", "", true, "show_champion", this) this.thunderBottle = new ToggleSetting("Thunder Bottle Progress Display", "shows you the progress of thunder bottle in your inventory", false, "thunder_bottle", this); this.thunderBottleElement = new HudTextElement() @@ -141,6 +142,18 @@ class GlobalSettings extends Feature { } }) + this.warps = JSON.parse(FileLib.read("SoopyV2", "features/globalSettings/warps.json")) + + this.registerCommand("warp", (...name) => { + //send command to server + ChatLib.command("warp " + (name[0] || "")); + }, (args) => { + if (this.warpCompletions.getValue()) + { + return this.warps.filter(v => v.toLowerCase().startsWith(args[0])) + } else return [] + }) + this.registerStep(true, 4, this.mobThings) this.firstPageSettings = [this.darkTheme] diff --git a/features/globalSettings/warps.json b/features/globalSettings/warps.json new file mode 100644 index 0000000..e84c78c --- /dev/null +++ b/features/globalSettings/warps.json @@ -0,0 +1,41 @@ +[ + "hub", + "village", + "home", + "island", + "spider", + "spiders", + "end", + "park", + "gold", + "deep", + "mines", + "forge", + "crystals", + "hollows", + "ch", + "nucleus", + "barn", + "desert", + "castle", + "museum", + "da", + "crypt", + "crypts", + "nest", + "crimson", + "isle", + "nether", + "dragontail", + "scarleton", + "skull", + "tomb", + "smoldering", + "void", + "drag", + "jungle", + "howl", + "dungeon_hub", + "dungeons", + "dhub" +] \ No newline at end of file -- cgit From d93b1e169f4d1066397a6895834906386b8eea2f Mon Sep 17 00:00:00 2001 From: Sapodilla Date: Thu, 8 Sep 2022 05:18:37 +0100 Subject: Removed warp autocomplete toggle --- features/globalSettings/index.js | 4 ---- 1 file changed, 4 deletions(-) (limited to 'features/globalSettings') diff --git a/features/globalSettings/index.js b/features/globalSettings/index.js index a1c6a3c..9ffbd36 100644 --- a/features/globalSettings/index.js +++ b/features/globalSettings/index.js @@ -60,7 +60,6 @@ class GlobalSettings extends Feature { this.itemWorth = new ToggleSetting("(Approximate) Item worth in lore", "Accounts for stuff like enchants/recombs ect", false, "item_worth", this) this.showHecatomb = new ToggleSetting("Show hecatomb enchant info in lore", "", true, "show_hecatomb", this) this.showChampion = new ToggleSetting("Show champion enchant info in lore", "", true, "show_champion", this) - this.warpCompletions = new ToggleSetting("Autocomplete warp locations with tab", "", true, "show_champion", this) this.thunderBottle = new ToggleSetting("Thunder Bottle Progress Display", "shows you the progress of thunder bottle in your inventory", false, "thunder_bottle", this); this.thunderBottleElement = new HudTextElement() @@ -148,10 +147,7 @@ class GlobalSettings extends Feature { //send command to server ChatLib.command("warp " + (name[0] || "")); }, (args) => { - if (this.warpCompletions.getValue()) - { return this.warps.filter(v => v.toLowerCase().startsWith(args[0])) - } else return [] }) this.registerStep(true, 4, this.mobThings) -- cgit