aboutsummaryrefslogtreecommitdiff
path: root/src/features
diff options
context:
space:
mode:
Diffstat (limited to 'src/features')
-rw-r--r--src/features/changeLogGUI/index.js44
-rw-r--r--src/features/dungeonMap/index.js1
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)