- [NEW] Sempre es pot navegar pels menus amb cursors, RETURN i ESCAPE
- [NEW] El gamepad es configura amb la info del gamescontrollerdb.txt per defecte - [NEW] El botó de START en el gamepad funciona com el ESCAPE del teclat - [FIX] La música ingame continuava estant mal - [FIX] Si la música està desactivada que no sone la del logo
This commit is contained in:
@@ -32,22 +32,22 @@ namespace modules
|
||||
{
|
||||
if (state == STATE_SELECTING)
|
||||
{
|
||||
if (input::keyPressed(SDL_SCANCODE_ESCAPE)) {
|
||||
if (controller::pressed(KEY_MENU)) {
|
||||
return MENU_GAMEPAD_TORNAR;
|
||||
}
|
||||
if (controller::pressed(KEY_DOWN))
|
||||
if (controller::pressed(KEY_DOWN) || input::keyPressed(SDL_SCANCODE_DOWN))
|
||||
{
|
||||
audio::playSound("snd_push.wav", SOUND_BASIC);
|
||||
selected_option++; if (selected_option>6) selected_option=0;
|
||||
}
|
||||
|
||||
if (controller::pressed(KEY_UP))
|
||||
if (controller::pressed(KEY_UP) || input::keyPressed(SDL_SCANCODE_UP))
|
||||
{
|
||||
audio::playSound("snd_push.wav", SOUND_BASIC);
|
||||
selected_option--; if (selected_option<0) selected_option=6;
|
||||
}
|
||||
|
||||
if (controller::pressed(KEY_JUMP) || controller::pressed(KEY_PICK))
|
||||
if (controller::pressed(KEY_JUMP) || controller::pressed(KEY_PICK) || input::keyPressed(SDL_SCANCODE_RETURN))
|
||||
{
|
||||
audio::playSound("snd_push.wav", SOUND_BASIC);
|
||||
if (selected_option==MENU_GAMEPAD_TORNAR)
|
||||
@@ -59,7 +59,8 @@ namespace modules
|
||||
const int8_t btn = input::getPadBtnPressed();
|
||||
if (btn != SDL_CONTROLLER_BUTTON_INVALID) {
|
||||
config::definePadBtn(selected_option, btn);
|
||||
state = STATE_SELECTING;
|
||||
selected_option++;
|
||||
if (selected_option==6) state = STATE_SELECTING;
|
||||
}
|
||||
if (input::keyPressed(SDL_SCANCODE_ESCAPE)) state = STATE_SELECTING;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user