forked from ericfrederich/smlinux
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmenu-arrows.patch
44 lines (40 loc) · 2.01 KB
/
menu-arrows.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From 9c293f486beef2ee173664b8d8f0a1770b2d7472 Mon Sep 17 00:00:00 2001
From: enigma9o7 <[email protected]>
Date: Sun, 4 Oct 2020 08:40:11 -0700
Subject: [PATCH] Add cbutton/arrow support to options menu
---
src/game/options_menu.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/game/options_menu.c b/src/game/options_menu.c
index 0bcb32b4..acb6b74e 100644
--- a/src/game/options_menu.c
+++ b/src/game/options_menu.c
@@ -572,13 +572,13 @@ 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;
@@ -593,12 +593,12 @@ 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(¤tMenu->opts[currentMenu->select], 1);
else
optmenu_opt_change(¤tMenu->opts[currentMenu->select], -1);