diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-10-05 10:00:20 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-10-05 10:00:20 +0800 |
commit | e2f1ef15eff6433b1afacf5f79b1fc97218fc290 (patch) | |
tree | 59ab045541097074ff6f6f0031534e0f0df1368e /src/features | |
parent | bb3f4a4c373fef85a087848f1658e949e7a0af4e (diff) | |
download | SoopyV2-e2f1ef15eff6433b1afacf5f79b1fc97218fc290.tar.gz SoopyV2-e2f1ef15eff6433b1afacf5f79b1fc97218fc290.tar.bz2 SoopyV2-e2f1ef15eff6433b1afacf5f79b1fc97218fc290.zip |
bettermap download command!
Diffstat (limited to 'src/features')
-rw-r--r-- | src/features/changeLogGUI/index.js | 44 | ||||
-rw-r--r-- | src/features/dungeonMap/index.js | 1 |
2 files changed, 45 insertions, 0 deletions
diff --git a/src/features/changeLogGUI/index.js b/src/features/changeLogGUI/index.js index d8287ea..43e34c8 100644 --- a/src/features/changeLogGUI/index.js +++ b/src/features/changeLogGUI/index.js @@ -33,6 +33,50 @@ class ChangeLogGui extends Feature { this.registerStep(false, 60 * 5, () => { this.ChangelogPage.loadChangeLog() }) + + this.registerCommand("downloadbettermap", () => { + new Thread(() => { + ChatLib.chat("Downloading...") + + let url = FileLib.getUrlContent("http://soopy.dev/api/bettermap/downloadurl") + + new File("./config/ChatTriggers/modules/BetterMapTempDownload").mkdir() + + this.ChangelogPage.urlToFile(url, "./config/ChatTriggers/modules/BetterMapTempDownload/BetterMap.zip", 10000, 20000) + + FileLib.unzip("./config/ChatTriggers/modules/BetterMapTempDownload/BetterMap.zip", "./config/ChatTriggers/modules/BetterMapTempDownload/BetterMap/") + + FileLib.deleteDirectory(new File("./config/ChatTriggers/modules/BetterMap")) + + new File("./config/ChatTriggers/modules/BetterMapTempDownload/BetterMap/BetterMap").renameTo(new File("./config/ChatTriggers/modules/BetterMap")) + + FileLib.deleteDirectory(new File("./config/ChatTriggers/modules/BetterMapTempDownload")) + + ChatLib.command("ct load", true) + }).start() + }) + + this.registerCommand("updatebettermap", () => { + new Thread(() => { + ChatLib.chat("Updating...") + + let url = FileLib.getUrlContent("http://soopy.dev/api/bettermap/downloadurl") + + new File("./config/ChatTriggers/modules/BetterMapTempDownload").mkdir() + + this.ChangelogPage.urlToFile(url, "./config/ChatTriggers/modules/BetterMapTempDownload/BetterMap.zip", 10000, 20000) + + FileLib.unzip("./config/ChatTriggers/modules/BetterMapTempDownload/BetterMap.zip", "./config/ChatTriggers/modules/BetterMapTempDownload/BetterMap/") + + FileLib.deleteDirectory(new File("./config/ChatTriggers/modules/BetterMap")) + + new File("./config/ChatTriggers/modules/BetterMapTempDownload/BetterMap/BetterMap").renameTo(new File("./config/ChatTriggers/modules/BetterMap")) + + FileLib.deleteDirectory(new File("./config/ChatTriggers/modules/BetterMapTempDownload")) + + ChatLib.command("ct load", true) + }).start() + }) } worldLoad() { diff --git a/src/features/dungeonMap/index.js b/src/features/dungeonMap/index.js index 1f70ece..b3f1e5f 100644 --- a/src/features/dungeonMap/index.js +++ b/src/features/dungeonMap/index.js @@ -33,6 +33,7 @@ class DungeonMap extends Feature { onEnable() { this.initVariables() + this.mapInfo2 = new SettingBase("NOTE: This will soon be replaced with bettermap", "Do /downloadbettermap to download.", undefined, "map_info2", this) this.mapInfo = new SettingBase("NOTE: The more players in the party with this", "category enabled the more accurate the map will be.", undefined, "map_info", this) this.renderMap = new ToggleSetting("Render Map", "Toggles Rendering the map on the hud", false, "dmap_render", this) this.mapIcons = new ToggleSetting("Icons for puzzles on map", "Toggles Rendering the puzzle icons on map", true, "dmap_icons", this).requires(this.renderMap) |