diff options
Diffstat (limited to 'src/features/settings/settingThings/settingBase.js')
-rw-r--r-- | src/features/settings/settingThings/settingBase.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/features/settings/settingThings/settingBase.js b/src/features/settings/settingThings/settingBase.js index 5320f40..2346f32 100644 --- a/src/features/settings/settingThings/settingBase.js +++ b/src/features/settings/settingThings/settingBase.js @@ -30,12 +30,12 @@ class SettingBase { this.helpButton = new BoxWithText().setText("ยง0?").setLocation(3, 3, 0.05, 0.5) this.helpButton.location.location.setRelative(false, false) - this.helpButton.addEvent(new SoopyMouseClickEvent().setHandler(() => { + this.helpButton.addEvent(new SoopyMouseClickEvent().setHandler(async () => { module.FeatureManager.features.soopyGui.class.openSidebarPage(new SoopyGuiElement().setLocation(0.05, 0.05, 0.9, 0.9).setScrollable(true).addChild(new SoopyMarkdownElement().setLocation(0, 0, 1, 1).setText("Loading..."))) - this.getHelp(helpText => { - module.FeatureManager.features.soopyGui.class.openSidebarPage(new SoopyGuiElement().setLocation(0.05, 0.05, 0.9, 0.9).setScrollable(true).addChild(new SoopyMarkdownElement().setLocation(0, 0, 1, 1).setText(helpText))) - }) + let helpText = await this.getHelp() + + module.FeatureManager.features.soopyGui.class.openSidebarPage(new SoopyGuiElement().setLocation(0.05, 0.05, 0.9, 0.9).setScrollable(true).addChild(new SoopyMarkdownElement().setLocation(0, 0, 1, 1).setText(helpText))) })) this.helpButton.setLore(["Click for more information about this setting"]) @@ -79,8 +79,8 @@ class SettingBase { return helpDataLoader.hasData(this.moduleId, this.settingId) } - getHelp(callback) { - helpDataLoader.getData(this.moduleId, this.settingId, callback) + async getHelp() { + return await helpDataLoader.getData(this.moduleId, this.settingId) } getValue() { |