@@ -14,18 +14,10 @@ const [levelTab, cheatsTab, variablesTab] = tab.pages;
1414
1515const stringifyProxy = ( obj ) =>
1616 new Proxy ( obj , {
17- get : ( t , k ) =>
18- typeof t [ k ] === "object" && t [ k ] !== null
19- ? JSON . stringify ( t [ k ] )
20- : String ( t [ k ] ) ,
17+ get : ( t , k ) => ( typeof t [ k ] === "object" && t [ k ] !== null ? JSON . stringify ( t [ k ] ) : String ( t [ k ] ) ) ,
2118 } ) ;
2219
23- function syncKeys ( {
24- keys,
25- bindings,
26- add,
27- remove,
28- } ) {
20+ function syncKeys ( { keys, bindings, add, remove } ) {
2921 for ( const k of bindings . keys ( ) ) {
3022 if ( ! keys . includes ( k ) ) {
3123 remove ( k ) ;
@@ -50,8 +42,12 @@ function dynamicObjectFolder(container, source, title, { expanded = false, inclu
5042
5143 const validKeys = ( ) =>
5244 Object . keys ( obj ) . filter ( ( k ) => {
53- if ( exclude . includes ( k ) ) { return false ; }
54- if ( include && ! include . includes ( k ) ) { return false ; }
45+ if ( exclude . includes ( k ) ) {
46+ return false ;
47+ }
48+ if ( include && ! include . includes ( k ) ) {
49+ return false ;
50+ }
5551 return typeof obj [ k ] !== "function" ;
5652 } ) ;
5753
@@ -85,7 +81,9 @@ function dynamicObjectFolder(container, source, title, { expanded = false, inclu
8581 folder,
8682 observed,
8783 setSource ( newObj ) {
88- for ( const b of bindings . values ( ) ) { b . dispose ( ) ; }
84+ for ( const b of bindings . values ( ) ) {
85+ b . dispose ( ) ;
86+ }
8987 bindings . clear ( ) ;
9088 obj = newObj ;
9189 proxy = stringifyProxy ( obj ) ;
@@ -104,19 +102,17 @@ function dynamicArrayFolder(container, array, title, { expanded = false, itemExp
104102
105103 const syncItem = ( i ) => {
106104 const el = arr [ i ] ;
107- if ( ! el || typeof el !== "object" ) { return ; }
105+ if ( ! el || typeof el !== "object" ) {
106+ return ;
107+ }
108108
109109 const entry = items . get ( i ) ;
110110 const keys = Object . keys ( el ) . filter ( ( k ) => typeof el [ k ] !== "function" ) ;
111111
112112 syncKeys ( {
113113 keys,
114114 bindings : entry . bindings ,
115- add : ( k ) =>
116- entry . bindings . set (
117- k ,
118- entry . folder . addBinding ( entry . proxy , k , { readonly : true } )
119- ) ,
115+ add : ( k ) => entry . bindings . set ( k , entry . folder . addBinding ( entry . proxy , k , { readonly : true } ) ) ,
120116 remove : ( k ) => {
121117 entry . bindings . get ( k ) . dispose ( ) ;
122118 entry . bindings . delete ( k ) ;
@@ -134,7 +130,9 @@ function dynamicArrayFolder(container, array, title, { expanded = false, itemExp
134130
135131 for ( let i = 0 ; i < arr . length ; i ++ ) {
136132 const el = arr [ i ] ;
137- if ( ! el || typeof el !== "object" ) { continue ; }
133+ if ( ! el || typeof el !== "object" ) {
134+ continue ;
135+ }
138136
139137 if ( ! items . has ( i ) ) {
140138 const entry = {
@@ -147,7 +145,9 @@ function dynamicArrayFolder(container, array, title, { expanded = false, itemExp
147145 syncItem ( i ) ;
148146 } else if ( items . get ( i ) . source !== el ) {
149147 const entry = items . get ( i ) ;
150- for ( const b of entry . bindings . values ( ) ) { b . dispose ( ) ; }
148+ for ( const b of entry . bindings . values ( ) ) {
149+ b . dispose ( ) ;
150+ }
151151 entry . bindings . clear ( ) ;
152152 entry . proxy = stringifyProxy ( el ) ;
153153 entry . source = el ;
@@ -178,12 +178,7 @@ function dynamicArrayFolder(container, array, title, { expanded = false, itemExp
178178
179179const osFolder = dynamicObjectFolder ( variablesTab , oS , "oS" ) ;
180180const userFolder = dynamicObjectFolder ( variablesTab , $User , "$User" ) ;
181- const soundsFolder = dynamicArrayFolder (
182- variablesTab ,
183- playingSounds ,
184- "playingSounds" ,
185- { itemExpanded : true }
186- ) ;
181+ const soundsFolder = dynamicArrayFolder ( variablesTab , playingSounds , "playingSounds" , { itemExpanded : true } ) ;
187182
188183window . oS = osFolder . observed ;
189184window . $User = userFolder . observed ;
@@ -246,12 +241,7 @@ const sun = cheatsTab.addBlade({
246241} ) ;
247242
248243cheatsTab . addButton ( { title : "Gain Sun" } ) . on ( "click" , ( ) => {
249- const id = AppearSun (
250- $User . Mouse . x - 45 ,
251- $User . Mouse . y + 45 ,
252- Math . round ( sun . value ) ,
253- false
254- ) ;
244+ const id = AppearSun ( $User . Mouse . x - 45 , $User . Mouse . y + 45 , Math . round ( sun . value ) , false ) ;
255245
256246 if ( ! oS . AutoSun ) {
257247 oSym . addTask ( Math . round ( 1000 / oSym . TimeStep ) , ClickSun , [ id ] ) ;
0 commit comments