@@ -58,7 +58,7 @@ for (index => category in categories)
5858 var obj : BaseOption ;
5959
6060 for (option in category .options )
61- if ((option .platform == ' desktop' && ! CoolVars .mobileControls ) || (option .platform == ' mobile' && CoolVars .mobileControls ) || option .platform == null )
61+ if ((option .platform == ' desktop' && ! CoolVars .mobile ) || (option .platform == ' mobile' && CoolVars .mobile ) || option .platform == null )
6262 createOption (index ,
6363 switch (option .type .toUpperCase ())
6464 {
@@ -154,42 +154,22 @@ function onUpdate(elapsed:Float)
154154 }
155155}
156156
157- var mobileCamera : FlxCamera ;
158-
159- function postCreate ()
160- {
161- if (CoolVars .mobileControls )
162- {
163- mobileCamera = new ALECamera ();
164-
165- FlxG .cameras .add (mobileCamera , false );
166-
167- var buttonMap : Array <Dynamic > = [
168- [50 , 485 , ClientPrefs .controls .ui .left , ' < normal' ],
169- [360 , 485 , ClientPrefs .controls .ui .right , ' > normal' ],
170- [205 , 395 , ClientPrefs .controls .ui .up , ' < normal' , 90 ],
171- [205 , 550 , ClientPrefs .controls .ui .down , ' > normal' , 90 ],
172- [1105 , 485 , ClientPrefs .controls .ui .accept , ' a uppercase' ],
173- [950 , 485 , ClientPrefs .controls .ui .back , ' b uppercase' ]
174- ];
175-
176- for (button in buttonMap )
177- {
178- var obj : MobileButton = new MobileButton (button [0 ], button [1 ], button [2 ], button [3 ]);
179- add (obj );
180- obj .label .angle = button [4 ] ?? 0 ;
181- obj .cameras = [mobileCamera ];
182- }
183- }
184- }
185-
186157function onDestroy ()
187158{
188- if (CoolVars .mobileControls )
189- FlxG .cameras .remove (mobileCamera );
190-
191159 CoolUtil .save .custom .data .optionsMenu = selInt ;
192160
193161 CoolUtil .save .save ();
194162 CoolUtil .save .load ();
195- }
163+ }
164+
165+ MobileAPI .createButtons (FlxG .width - 300 , FlxG .height - 200 , [
166+ {label : ' A' , keys : ClientPrefs .controls .ui .accept },
167+ {label : ' B' , keys : ClientPrefs .controls .ui .back },
168+ ]);
169+
170+ MobileAPI .createButtons (100 , FlxG .height - 300 , [
171+ {label : ' R' , keys : ClientPrefs .controls .ui .right },
172+ {label : ' D' , keys : ClientPrefs .controls .ui .down },
173+ {label : ' L' , keys : ClientPrefs .controls .ui .left },
174+ {label : ' U' , keys : ClientPrefs .controls .ui .up },
175+ ]);
0 commit comments