diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-06-03 15:41:40 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-06-03 15:41:40 +0800 |
commit | 578a7e1720c0c85b1023151172eb8e077f5bf126 (patch) | |
tree | af7096c0a2577d4ef6665c2ccaac537e70977054 /features/settings/locationSettingHolder.js | |
parent | ac1fb62d61fa6a16a43667ac4f16c324f806a54e (diff) | |
download | SoopyV2-578a7e1720c0c85b1023151172eb8e077f5bf126.tar.gz SoopyV2-578a7e1720c0c85b1023151172eb8e077f5bf126.tar.bz2 SoopyV2-578a7e1720c0c85b1023151172eb8e077f5bf126.zip |
+ fix there being multiple of the same hud element in the edit gui locations button sometimes
Diffstat (limited to 'features/settings/locationSettingHolder.js')
-rw-r--r-- | features/settings/locationSettingHolder.js | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/features/settings/locationSettingHolder.js b/features/settings/locationSettingHolder.js index 14256d3..af6f507 100644 --- a/features/settings/locationSettingHolder.js +++ b/features/settings/locationSettingHolder.js @@ -1,21 +1,25 @@ class LocationSettingHolder { constructor() { - this.data = []; + this.data = new Set(); } - addLocationSetting(setting){ - this.data.push(setting) + addLocationSetting(setting) { + this.data.add(setting) } - getData(){ - return this.data + removeLocationSetting(setting) { + this.data.delete(setting) + } + + getData() { + return [...this.data] } } -if(!global.LocationSettingHolder){ +if (!global.LocationSettingHolder) { global.LocationSettingHolder = new LocationSettingHolder(); - - register("gameUnload", ()=>{ + + register("gameUnload", () => { global.LocationSettingHolder = undefined }) } |