Skip to content

Commit

Permalink
i'll fix it tomorrrow idk
Browse files Browse the repository at this point in the history
  • Loading branch information
Joalor64GH authored Nov 2, 2024
1 parent a200323 commit f239b91
Showing 1 changed file with 22 additions and 44 deletions.
66 changes: 22 additions & 44 deletions source/options/ControlsSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -160,75 +160,53 @@ class ControlsSubState extends ExtendableSubState {
if (gamepad != null && gamepad.anyJustPressed([ANY]) && keyPressed.toString() != FlxGamepadInputID.NONE) {
switch (curSelected) {
case 0:
Input.binds.set('left', keyPressed).gamepad[0];
SaveData.settings.gamepadBinds[0][0] = Input.binds.get('left').gamepad[0];
SaveData.settings.gamepadBinds[0][0] = keyPressed;
case 1:
Input.binds.set('left', keyPressed).gamepad[1];
SaveData.settings.gamepadBinds[0][1] = Input.binds.get('left').gamepad[1];
SaveData.settings.gamepadBinds[0][1] = keyPressed;
case 2:
Input.binds.set('down', keyPressed).gamepad[0];
SaveData.settings.gamepadBinds[1][0] = Input.binds.get('down').gamepad[0];
SaveData.settings.gamepadBinds[1][0] = keyPressed;
case 3:
Input.binds.set('down', keyPressed).gamepad[1];
SaveData.settings.gamepadBinds[1][1] = Input.binds.get('down').gamepad[1];
SaveData.settings.gamepadBinds[1][1] = keyPressed;
case 4:
Input.binds.set('up', keyPressed).gamepad[0];
SaveData.settings.gamepadBinds[2][0] = Input.binds.get('up').gamepad[0];
SaveData.settings.gamepadBinds[2][0] = keyPressed;
case 5:
Input.binds.set('up', keyPressed).gamepad[1];
SaveData.settings.gamepadBinds[2][1] = Input.binds.get('up').gamepad[1];
SaveData.settings.gamepadBinds[2][1] = keyPressed;
case 6:
Input.binds.set('right', keyPressed).gamepad[0];
SaveData.settings.gamepadBinds[3][0] = Input.binds.get('right').gamepad[0];
SaveData.settings.gamepadBinds[3][0] = keyPressed;
case 7:
Input.binds.set('right', keyPressed).gamepad[1];
SaveData.settings.gamepadBinds[3][1] = Input.binds.get('right').gamepad[1];
SaveData.settings.gamepadBinds[3][1] = keyPressed;
case 8:
Input.binds.set('accept', keyPressed).gamepad[0];
SaveData.settings.gamepadBinds[4][0] = Input.binds.get('accept').gamepad[0];
SaveData.settings.gamepadBinds[4][0] = keyPressed;
case 9:
Input.binds.set('exit', keyPressed).gamepad[0];
SaveData.settings.gamepadBinds[5][0] = Input.binds.get('exit').gamepad[0];
SaveData.settings.gamepadBinds[5][0] = keyPressed;
case 10:
Input.binds.set('reset', keyPressed).gamepad[0];
SaveData.settings.gamepadBinds[6][0] = Input.binds.get('reset').gamepad[0];
SaveData.settings.gamepadBinds[6][0] = keyPressed;
}
}
} else {
switch (curSelected) {
case 0:
Input.binds.set('left', FlxG.keys.firstJustPressed()).key[0];
SaveData.settings.keyboardBinds[0][0] = Input.binds.get('left').key[0];
SaveData.settings.keyboardBinds[0][0] = FlxG.keys.firstJustPressed();
case 1:
Input.binds.set('left', FlxG.keys.firstJustPressed()).key[1];
SaveData.settings.keyboardBinds[0][1] = Input.binds.get('left').key[1];
SaveData.settings.keyboardBinds[0][1] = FlxG.keys.firstJustPressed();
case 2:
Input.binds.set('down', FlxG.keys.firstJustPressed()).key[0];
SaveData.settings.keyboardBinds[1][0] = Input.binds.get('down').key[0];
SaveData.settings.keyboardBinds[1][0] = FlxG.keys.firstJustPressed();
case 3:
Input.binds.set('down', FlxG.keys.firstJustPressed()).key[1];
SaveData.settings.keyboardBinds[1][1] = Input.binds.get('down').key[1];
SaveData.settings.keyboardBinds[1][1] = FlxG.keys.firstJustPressed();
case 4:
Input.binds.set('up', FlxG.keys.firstJustPressed()).key[0];
SaveData.settings.keyboardBinds[2][0] = Input.binds.get('up').key[0];
SaveData.settings.keyboardBinds[2][0] = FlxG.keys.firstJustPressed();
case 5:
Input.binds.set('up', FlxG.keys.firstJustPressed()).key[1];
SaveData.settings.keyboardBinds[2][1] = Input.binds.get('up').key[1];
SaveData.settings.keyboardBinds[2][1] = FlxG.keys.firstJustPressed();
case 6:
Input.binds.set('right', FlxG.keys.firstJustPressed()).key[0];
SaveData.settings.keyboardBinds[3][0] = Input.binds.get('right').key[0];
SaveData.settings.keyboardBinds[3][0] = FlxG.keys.firstJustPressed();
case 7:
Input.binds.set('right', FlxG.keys.firstJustPressed()).key[1];
SaveData.settings.keyboardBinds[3][1] = Input.binds.get('right').key[1];
SaveData.settings.keyboardBinds[3][1] = FlxG.keys.firstJustPressed();
case 8:
Input.binds.set('accept', FlxG.keys.firstJustPressed()).key[0];
SaveData.settings.keyboardBinds[4][0] = Input.binds.get('accept').key[0];
SaveData.settings.keyboardBinds[4][0] = FlxG.keys.firstJustPressed();
case 9:
Input.binds.set('exit', FlxG.keys.firstJustPressed()).key[0];
SaveData.settings.keyboardBinds[5][0] = Input.binds.get('exit').key[0];
SaveData.settings.keyboardBinds[5][0] = FlxG.keys.firstJustPressed();
case 10:
Input.binds.set('reset', FlxG.keys.firstJustPressed()).key[0];
SaveData.settings.keyboardBinds[6][0] = Input.binds.get('reset').key[0];
SaveData.settings.keyboardBinds[6][0] = FlxG.keys.firstJustPressed();
}
}
SaveData.saveSettings();
Expand Down

0 comments on commit f239b91

Please sign in to comment.