From f239b918ebb0fa540fbf9ada0ccb9769ccc5e01b Mon Sep 17 00:00:00 2001 From: Joalor64 Date: Fri, 1 Nov 2024 22:08:24 -0400 Subject: [PATCH] i'll fix it tomorrrow idk --- source/options/ControlsSubState.hx | 66 ++++++++++-------------------- 1 file changed, 22 insertions(+), 44 deletions(-) diff --git a/source/options/ControlsSubState.hx b/source/options/ControlsSubState.hx index 06b1ff4..016f7b9 100644 --- a/source/options/ControlsSubState.hx +++ b/source/options/ControlsSubState.hx @@ -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();