Skip to content

Commit

Permalink
Merge PR 435
Browse files Browse the repository at this point in the history
sm64pc#435 Add cbutton/arrow support to options menu
  • Loading branch information
quentin452 committed May 2, 2024
1 parent e76e6e5 commit e52bd4a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/game/options_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -529,13 +529,15 @@ void optmenu_check_buttons(void) {
allowInput = 1;
}

if (ABS(gPlayer1Controller->stickY) > 60) {
if ((ABS(gPlayer1Controller->stickY) > 60)
|| (gPlayer1Controller->buttonPressed & (D_CBUTTONS | U_CBUTTONS))) {
if (allowInput) {
#ifndef nosound
play_sound(SOUND_MENU_CHANGE_SELECT, gDefaultSoundArgs);
#endif

if (gPlayer1Controller->stickY >= 60) {
if ((gPlayer1Controller->stickY >= 60)
|| (gPlayer1Controller->buttonPressed & U_CBUTTONS)) {
currentMenu->select--;
if (currentMenu->select < 0)
currentMenu->select = currentMenu->numOpts - 1;
Expand All @@ -550,12 +552,13 @@ void optmenu_check_buttons(void) {
else if (currentMenu->select > currentMenu->scroll + 3)
currentMenu->scroll = currentMenu->select - 3;
}
} else if (ABS(gPlayer1Controller->stickX) > 60) {
} else if ((ABS(gPlayer1Controller->stickX) > 60)
|| (gPlayer1Controller->buttonPressed & (L_CBUTTONS | R_CBUTTONS))) {
if (allowInput) {
#ifndef nosound
play_sound(SOUND_MENU_CHANGE_SELECT, gDefaultSoundArgs);
#endif
if (gPlayer1Controller->stickX >= 60)
if ((gPlayer1Controller->stickX >= 60) || (gPlayer1Controller->buttonPressed & R_CBUTTONS))
optmenu_opt_change(&currentMenu->opts[currentMenu->select], 1);
else
optmenu_opt_change(&currentMenu->opts[currentMenu->select], -1);
Expand Down

0 comments on commit e52bd4a

Please sign in to comment.