aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2021-11-23 21:41:31 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2021-11-23 21:41:31 +0800
commitce112c714b740c0e9e958f2016091bd3f01d7ba6 (patch)
treebb6e0142073cc1f378b7ae98249f2f17187583ac
parent28193e6ed424acd2fcd2a47f1d5e4be53b23e63f (diff)
downloadSoopyV2-ce112c714b740c0e9e958f2016091bd3f01d7ba6.tar.gz
SoopyV2-ce112c714b740c0e9e958f2016091bd3f01d7ba6.tar.bz2
SoopyV2-ce112c714b740c0e9e958f2016091bd3f01d7ba6.zip
Add onboarding menu
-rw-r--r--features/globalSettings/index.js25
-rw-r--r--features/soopyGui/index.js2
-rw-r--r--metadata.json4
3 files changed, 23 insertions, 8 deletions
diff --git a/features/globalSettings/index.js b/features/globalSettings/index.js
index eb1e088..58e84e4 100644
--- a/features/globalSettings/index.js
+++ b/features/globalSettings/index.js
@@ -41,16 +41,31 @@ class Hud extends Feature {
this.privacySettings = [this.reportErrorsSetting, this.sendChatSetting]
- // this.GuiPage = new FirstLoadingPage(this)
+ this.firstLoadPageData = JSON.parse(FileLib.read("soopyAddonsData", "soopyv2firstloaddata.json") || "{}") || {}
+
+ this.GuiPage = new FirstLoadingPage(this)
soopyV2Server.reportErrorsSetting = this.reportErrorsSetting
this.registerChat("&aYour new API key is &r&b${key}&r", this.newKey)
- // new Thread(()=>{
- // Thread.sleep(1000) //TODO: DO ON 2nd WORLDLOAD
- // ChatLib.command("soopyv2 first_load_thing", true)//TODO: ONLY RUN ON FIRST INSTALL
- // }).start()
+ this.registerEvent("worldLoad", this.worldLoad)
+
+ this.ranFirstLoadThing = false
+
+ setTimeout(()=>{
+ this.worldLoad.call(this)
+ }, 1000)
+ }
+
+ worldLoad(){
+ if(!this.ranFirstLoadThing && World && !this.firstLoadPageData.shown){
+ ChatLib.command("soopyv2 first_load_thing", true)
+ this.ranFirstLoadThing = true
+ this.firstLoadPageData.shown = true
+ this.firstLoadPageData.version = 1
+ FileLib.write("soopyAddonsData", "soopyv2firstloaddata.json", JSON.stringify(this.firstLoadPageData))
+ }
}
findKey(){
diff --git a/features/soopyGui/index.js b/features/soopyGui/index.js
index aa4f691..904176a 100644
--- a/features/soopyGui/index.js
+++ b/features/soopyGui/index.js
@@ -98,7 +98,7 @@ class SoopyGui extends Feature {
this.buttonListElm.children = []
this.pages.forEach((p, i)=>{
- let settingsButton = new ButtonWithArrow().setText("§0" + p.name).setLocation(0, 0.25*i, 1, 0.2)
+ let settingsButton = new ButtonWithArrow().setText("§0" + p.name).setLocation(0, 0.225*i, 1, 0.2)
settingsButton.addEvent(new SoopyMouseClickEvent().setHandler(()=>{this.clickedOpen(p)}))
this.buttonListElm.addChild(settingsButton)
})
diff --git a/metadata.json b/metadata.json
index b30672d..5d42977 100644
--- a/metadata.json
+++ b/metadata.json
@@ -5,8 +5,8 @@
"entry": "index.js",
"description": "Soopy addons v2",
"name": "SoopyV2",
- "version": "2.0.12",
- "versionId": 122,
+ "version": "2.0.13",
+ "versionId": 123,
"requires": [
"soopyApis",
"soopyAddonsData",