fix: controls en el mando

This commit is contained in:
2026-04-13 17:57:13 +02:00
parent 5f293cbddf
commit e67aeb10fe
7 changed files with 44 additions and 13 deletions

View File

@@ -93,10 +93,16 @@ void Title::handleEvent(const SDL_Event& event) {
}
// Qualsevol botó del comandament al menú principal inicia partida directament
// (els bindings ja estan definits, no cal "pulsar 1" amb el teclat).
// (els bindings ja estan definits, no cal "pulsar 1" amb el teclat). El botó
// BACK queda exclòs perquè es reserva per a EXIT — excepte a emscripten, on
// no es pot sortir del joc i BACK pot actuar com a botó genèric d'inici.
if (event.type == SDL_EVENT_GAMEPAD_BUTTON_DOWN &&
state_ == State::MAIN_MENU &&
!is_remapping_keyboard_ && !is_remapping_joystick_) {
!is_remapping_keyboard_ && !is_remapping_joystick_
#ifndef __EMSCRIPTEN__
&& event.gbutton.button != SDL_GAMEPAD_BUTTON_BACK
#endif
) {
handleMainMenuKeyPress(SDLK_1); // PLAY
return;
}