From 71ae701c364f586c34ae2d1e5f82e4df89e1d851 Mon Sep 17 00:00:00 2001 From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> Date: Tue, 30 Nov 2021 23:28:02 +0800 Subject: Allow for dynamic updating of module code in the fly --- features/soopyGui/GuiPage.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'features/soopyGui/GuiPage.js') 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); } -- cgit