From e8b67d3be1e9cd385c7bbc3e90b7d3d6e236cdb3 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Sat, 21 Jun 2025 13:30:19 +0200 Subject: [PATCH] =?UTF-8?q?fix=20Director:=20corregit=20els=20bindGameCont?= =?UTF-8?q?rollerButton()=20per=20al=20men=C3=BA=20de=20servei?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/director.cpp | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/source/director.cpp b/source/director.cpp index dbdc455..ed221ff 100644 --- a/source/director.cpp +++ b/source/director.cpp @@ -161,10 +161,12 @@ void Director::bindInputs() Input::get()->bindKey(InputAction::LEFT, SDL_SCANCODE_LEFT); Input::get()->bindKey(InputAction::RIGHT, SDL_SCANCODE_RIGHT); + // Teclado - Disparo del jugador Input::get()->bindKey(InputAction::FIRE_LEFT, SDL_SCANCODE_Q); Input::get()->bindKey(InputAction::FIRE_CENTER, SDL_SCANCODE_W); Input::get()->bindKey(InputAction::FIRE_RIGHT, SDL_SCANCODE_E); + // Teclado - Interfaz Input::get()->bindKey(InputAction::START, SDL_SCANCODE_RETURN); // Teclado - Menu de servicio @@ -189,7 +191,6 @@ void Director::bindInputs() Input::get()->bindKey(InputAction::CHANGE_LANG, SDL_SCANCODE_F9); Input::get()->bindKey(InputAction::RESET, SDL_SCANCODE_F10); - Input::get()->bindKey(InputAction::SHOW_INFO, SDL_SCANCODE_F12); // Asigna botones a inputs @@ -202,16 +203,14 @@ void Director::bindInputs() Input::get()->bindGameControllerButton(i, InputAction::LEFT, SDL_GAMEPAD_BUTTON_DPAD_LEFT); Input::get()->bindGameControllerButton(i, InputAction::RIGHT, SDL_GAMEPAD_BUTTON_DPAD_RIGHT); + // Mando - Disparo del jugador Input::get()->bindGameControllerButton(i, InputAction::FIRE_LEFT, SDL_GAMEPAD_BUTTON_WEST); Input::get()->bindGameControllerButton(i, InputAction::FIRE_CENTER, SDL_GAMEPAD_BUTTON_NORTH); Input::get()->bindGameControllerButton(i, InputAction::FIRE_RIGHT, SDL_GAMEPAD_BUTTON_EAST); + // Mando - Interfaz Input::get()->bindGameControllerButton(i, InputAction::START, SDL_GAMEPAD_BUTTON_START); - - // Teclado - Menu de servicio Input::get()->bindGameControllerButton(i, InputAction::SERVICE, SDL_GAMEPAD_BUTTON_BACK); - Input::get()->bindGameControllerButton(i, InputAction::SM_SELECT, SDL_GAMEPAD_BUTTON_WEST); - Input::get()->bindGameControllerButton(i, InputAction::SM_BACK, SDL_GAMEPAD_BUTTON_NORTH); } // Mapea las asignaciones a los botones desde el archivo de configuración, si se da el caso @@ -233,14 +232,9 @@ void Director::bindInputs() // Asigna botones a inputs desde otros inputs for (int i = 0; i < NUM_GAMEPADS; ++i) { - Input::get()->bindGameControllerButton(i, InputAction::EXIT, InputAction::START); - Input::get()->bindGameControllerButton(i, InputAction::RESET, InputAction::FIRE_CENTER); - Input::get()->bindGameControllerButton(i, InputAction::PAUSE, InputAction::FIRE_RIGHT); - Input::get()->bindGameControllerButton(i, InputAction::TOGGLE_VIDEO_SHADERS, InputAction::FIRE_LEFT); - Input::get()->bindGameControllerButton(i, InputAction::TOGGLE_AUDIO, InputAction::LEFT); - Input::get()->bindGameControllerButton(i, InputAction::SHOW_INFO, InputAction::RIGHT); - Input::get()->bindGameControllerButton(i, InputAction::CONFIG, InputAction::DOWN); - Input::get()->bindGameControllerButton(i, InputAction::SWAP_CONTROLLERS, InputAction::UP); + // Mando - Menu de servicio + Input::get()->bindGameControllerButton(i, InputAction::SM_SELECT, InputAction::FIRE_LEFT); + Input::get()->bindGameControllerButton(i, InputAction::SM_BACK, InputAction::FIRE_CENTER); } // Guarda las asignaciones de botones en las opciones de los dos primeros mandos