diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2021-11-23 23:01:10 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2021-11-23 23:01:10 +0800 |
commit | d36dbde865aec68f7fd564977cdf8e9c5912edbe (patch) | |
tree | 41bb451cd1f8407a094a834a1cb1db301ff92bf7 /features/globalSettings/firstLoadPages.js | |
parent | ce112c714b740c0e9e958f2016091bd3f01d7ba6 (diff) | |
download | SoopyV2-d36dbde865aec68f7fd564977cdf8e9c5912edbe.tar.gz SoopyV2-d36dbde865aec68f7fd564977cdf8e9c5912edbe.tar.bz2 SoopyV2-d36dbde865aec68f7fd564977cdf8e9c5912edbe.zip |
- Finish streamgui
- some more information in settings menus
- random fixes
Diffstat (limited to 'features/globalSettings/firstLoadPages.js')
-rw-r--r-- | features/globalSettings/firstLoadPages.js | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/features/globalSettings/firstLoadPages.js b/features/globalSettings/firstLoadPages.js index eebd5be..6185bd5 100644 --- a/features/globalSettings/firstLoadPages.js +++ b/features/globalSettings/firstLoadPages.js @@ -2,6 +2,8 @@ import SoopyMouseClickEvent from "../../../guimanager/EventListener/SoopyMouseCl import ButtonWithArrow from "../../../guimanager/GuiElement/ButtonWithArrow"; import SoopyGuiElement from "../../../guimanager/GuiElement/SoopyGuiElement"; import SoopyTextElement from "../../../guimanager/GuiElement/SoopyTextElement"; +import Notification from "../../../guimanager/Notification"; +import FeatureManager from "../../featureClass/featureManager"; import FirstLoadPage from "./firstLoadPage"; class WelcomePage extends FirstLoadPage{ @@ -89,4 +91,44 @@ class HowToOpenMenuPage extends FirstLoadPage{ } } -export default [new WelcomePage(), new ApiKeyPage(), new HowToOpenMenuPage()]
\ No newline at end of file +class DisableFeatures extends FirstLoadPage{ + constructor(){ + super() + + this.addChild(new SoopyTextElement().setText("§0Lastly do you want to disable all features?").setLocation(0.1, 0.1,0.8,0.3).setMaxTextScale(10)); + + this.addChild(new SoopyTextElement().setText("§7(So you can only enable the ones you want)").setLocation(0.1, 0.3,0.8,0.1).setMaxTextScale(10)); + + let openSettingsButton = new ButtonWithArrow().setText("§0Disable all features").setLocation(0.35, 0.5,0.3,0.2) + + openSettingsButton.addEvent(new SoopyMouseClickEvent().setHandler(()=>{ + + new Thread(()=>{ + new Notification("Disabling features...", []) + Object.keys(FeatureManager.featureMetas).forEach((f)=>{ + let meta = FeatureManager.featureMetas[f] + + let isHidden = meta.isHidden + if(typeof isHidden === "string"){ + return + } + if(isHidden) return + if(!meta.isTogglable) return + + FeatureManager.featureSettingsData[f].enabled = false + FeatureManager.featureSettingsDataLastUpdated = true + + if(FeatureManager.isFeatureLoaded(f)){ + FeatureManager.unloadFeature(f) + } + }) + new Notification("Disabled all features!", []) + }).start() + })) + + this.addChild(openSettingsButton); + + } +} + +export default [new WelcomePage(), new ApiKeyPage(), new DisableFeatures(), new HowToOpenMenuPage()]
\ No newline at end of file |