mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-11-26 06:09:02 +00:00
save file fixins in progress
This commit is contained in:
parent
36ab5d441c
commit
8ac59d80ec
|
|
@ -555,20 +555,22 @@ class Save
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getControls(playerId:Int, inputType:Device):SaveControlsData
|
public function getControls(playerId:Int, inputType:Device):Null<SaveControlsData>
|
||||||
{
|
{
|
||||||
switch (inputType)
|
switch (inputType)
|
||||||
{
|
{
|
||||||
case Keys:
|
case Keys:
|
||||||
return (playerId == 0) ? data.options.controls.p1.keyboard : data.options.controls.p2.keyboard;
|
return (playerId == 0) ? data?.options?.controls?.p1.keyboard : data?.options?.controls?.p2.keyboard;
|
||||||
case Gamepad(_):
|
case Gamepad(_):
|
||||||
return (playerId == 0) ? data.options.controls.p1.gamepad : data.options.controls.p2.gamepad;
|
return (playerId == 0) ? data?.options?.controls?.p1.gamepad : data?.options?.controls?.p2.gamepad;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function hasControls(playerId:Int, inputType:Device):Bool
|
public function hasControls(playerId:Int, inputType:Device):Bool
|
||||||
{
|
{
|
||||||
var controls = getControls(playerId, inputType);
|
var controls = getControls(playerId, inputType);
|
||||||
|
if (controls == null) return false;
|
||||||
|
|
||||||
var controlsFields = Reflect.fields(controls);
|
var controlsFields = Reflect.fields(controls);
|
||||||
return controlsFields.length > 0;
|
return controlsFields.length > 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue