aboutsummaryrefslogtreecommitdiff
path: root/features/settings/settingsCommunicator.js
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-09-17 19:39:05 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-09-17 19:39:05 +0800
commit431e4fc9d1657a50ebc34b8ac24f9bfaea06417f (patch)
tree5987bb14f38d2999c682970429f34b41eb3e5826 /features/settings/settingsCommunicator.js
parente73f2efdf0f50aa775c540317394d46428e9704f (diff)
downloadSoopyV2-431e4fc9d1657a50ebc34b8ac24f9bfaea06417f.tar.gz
SoopyV2-431e4fc9d1657a50ebc34b8ac24f9bfaea06417f.tar.bz2
SoopyV2-431e4fc9d1657a50ebc34b8ac24f9bfaea06417f.zip
Initial move to babel + change fetch to use async/await
Diffstat (limited to 'features/settings/settingsCommunicator.js')
-rw-r--r--features/settings/settingsCommunicator.js35
1 files changed, 0 insertions, 35 deletions
diff --git a/features/settings/settingsCommunicator.js b/features/settings/settingsCommunicator.js
deleted file mode 100644
index 053a7c1..0000000
--- a/features/settings/settingsCommunicator.js
+++ /dev/null
@@ -1,35 +0,0 @@
-//So features can add settings by adding to this class, then the gui will load data from this class
-//this makes it so i can add settings before the settings gui is loaded
-//and so that settings gui can still be dynamicly reloaded and not break things
-
-class SettingsCommunicator {
- constructor(){
- this.settings = {}
- }
-
- addSetting(module, settingID, settingObject){
- if(!this.settings[module]) this.settings[module] = {}
-
- this.settings[module][settingID] = settingObject
- }
- removeSetting(module, settingID){
- if(!this.settings[module]) return;
- delete this.settings[module][settingID]
- }
- getSetting(module, settingID){
- return this.settings[module][settingID]
- }
- getModuleSettings(module){
- return Object.values(this.settings[module] || [])
- }
-}
-
-if(!global.soopyv2SettingsCommunicator){
- global.soopyv2SettingsCommunicator = new SettingsCommunicator()
-
- register("gameUnload", ()=>{
- global.soopyv2SettingsCommunicator = undefined
- })
-}
-
-export default global.soopyv2SettingsCommunicator \ No newline at end of file