diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2021-11-30 23:28:02 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2021-11-30 23:28:02 +0800 |
commit | 71ae701c364f586c34ae2d1e5f82e4df89e1d851 (patch) | |
tree | 8ed41d1b9fbdf72bbf256cb60d83a82adf8446b6 /features/soopyGui/GuiPage.js | |
parent | 5f481b984dfeb8ec6d6eb1762928726d728e775d (diff) | |
download | SoopyV2-71ae701c364f586c34ae2d1e5f82e4df89e1d851.tar.gz SoopyV2-71ae701c364f586c34ae2d1e5f82e4df89e1d851.tar.bz2 SoopyV2-71ae701c364f586c34ae2d1e5f82e4df89e1d851.zip |
Allow for dynamic updating of module code in the fly
Diffstat (limited to 'features/soopyGui/GuiPage.js')
-rw-r--r-- | features/soopyGui/GuiPage.js | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/features/soopyGui/GuiPage.js b/features/soopyGui/GuiPage.js index 13778fe..fb93bbe 100644 --- a/features/soopyGui/GuiPage.js +++ b/features/soopyGui/GuiPage.js @@ -5,15 +5,31 @@ class GuiPage{ this.currentPageId = 0; this.priority = priority - this.soopyGui = require('./index.js').class; + this.soopyGui = undefined; + new Thread(()=>{ + while(global.soopyv2featuremanagerthing.features["soopyGui"] === undefined){ + Thread.sleep(100) + } + + this.soopyGui = global.soopyv2featuremanagerthing.features["soopyGui"].class; + + if(this.finalisedLoading){ + this.finaliseLoading() + } + }).start() this.name = "" this.pages = {} this.showBackButton = true + this.finalisedLoading = false } finaliseLoading(){ + if(!this.soopyGui){ + this.finalisedLoading = true + return + } this.soopyGui.addCategory(this); } |