aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-10-05 10:00:20 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-10-05 10:00:20 +0800
commite2f1ef15eff6433b1afacf5f79b1fc97218fc290 (patch)
tree59ab045541097074ff6f6f0031534e0f0df1368e /src
parentbb3f4a4c373fef85a087848f1658e949e7a0af4e (diff)
downloadSoopyV2-e2f1ef15eff6433b1afacf5f79b1fc97218fc290.tar.gz
SoopyV2-e2f1ef15eff6433b1afacf5f79b1fc97218fc290.tar.bz2
SoopyV2-e2f1ef15eff6433b1afacf5f79b1fc97218fc290.zip
bettermap download command!
Diffstat (limited to 'src')
-rw-r--r--src/features/changeLogGUI/index.js44
-rw-r--r--src/features/dungeonMap/index.js1
-rw-r--r--src/metadata.json4
3 files changed, 47 insertions, 2 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)
diff --git a/src/metadata.json b/src/metadata.json
index 3495317..b251f46 100644
--- a/src/metadata.json
+++ b/src/metadata.json
@@ -5,8 +5,8 @@
"entry": "index.js",
"description": "SoopyV2",
"name": "SoopyV2",
- "version": "2.1.174",
- "versionId": 301,
+ "version": "2.1.175",
+ "versionId": 302,
"requires": [
"soopyApis",
"soopyAddonsData",