This commit is contained in:
gamerbross 2024-11-10 00:28:53 +00:00 committed by GitHub
commit 1b5946f905
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -859,9 +859,9 @@ class Save
switch (inputType)
{
case Keys:
return (playerId == 0) ? data?.options?.controls?.p1.keyboard : data?.options?.controls?.p2.keyboard;
return (playerId == 1) ? data?.options?.controls?.p1.keyboard : data?.options?.controls?.p2.keyboard;
case Gamepad(_):
return (playerId == 0) ? data?.options?.controls?.p1.gamepad : data?.options?.controls?.p2.gamepad;
return (playerId == 1) ? data?.options?.controls?.p1.gamepad : data?.options?.controls?.p2.gamepad;
}
}
@ -876,27 +876,7 @@ class Save
public function setControls(playerId:Int, inputType:Device, controls:SaveControlsData):Void
{
switch (inputType)
{
case Keys:
if (playerId == 0)
{
data.options.controls.p1.keyboard = controls;
}
else
{
data.options.controls.p2.keyboard = controls;
}
case Gamepad(_):
if (playerId == 0)
{
data.options.controls.p1.gamepad = controls;
}
else
{
data.options.controls.p2.gamepad = controls;
}
}
getControls(playerId, inputType) = controls;
flush();
}