aboutsummaryrefslogtreecommitdiff
path: root/features/settings/settingThings/FakeRequireToggle.js
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2021-12-24 01:23:11 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2021-12-24 01:23:11 +0800
commita9b64d621f31d7b3f92c27115c2bb50139788e15 (patch)
tree0e3fb96cf11d18b8f31c02a6af446b59e9dd6bc3 /features/settings/settingThings/FakeRequireToggle.js
parentaf90f8e220733b26098d3c4f4758bccf9f08908c (diff)
downloadSoopyV2-a9b64d621f31d7b3f92c27115c2bb50139788e15.tar.gz
SoopyV2-a9b64d621f31d7b3f92c27115c2bb50139788e15.tar.bz2
SoopyV2-a9b64d621f31d7b3f92c27115c2bb50139788e15.zip
make ingame toggle for cosmetics
Diffstat (limited to 'features/settings/settingThings/FakeRequireToggle.js')
-rw-r--r--features/settings/settingThings/FakeRequireToggle.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/features/settings/settingThings/FakeRequireToggle.js b/features/settings/settingThings/FakeRequireToggle.js
new file mode 100644
index 0000000..41932f3
--- /dev/null
+++ b/features/settings/settingThings/FakeRequireToggle.js
@@ -0,0 +1,27 @@
+
+class FakeRequireToggle{
+ constructor(val){
+ this.val = val
+
+ this.thisToggleEvents = []
+
+ this.toggleObject = {
+ addEvent: (event)=>{
+ this.thisToggleEvents.push(event)
+ }
+ }
+ }
+
+ set(newVal){
+ if(this.val === newVal) return
+ this.val = newVal
+
+ this.thisToggleEvents.forEach(e=>e._trigger(this, [this.val]))
+ }
+
+ getValue(){
+ return this.val
+ }
+}
+
+export default FakeRequireToggle \ No newline at end of file