Allow dpad to navigate DJUI menus

This commit is contained in:
MysterD 2022-03-29 18:27:42 -07:00
parent a34293a58a
commit be30578bf3
1 changed files with 12 additions and 0 deletions

View File

@ -301,6 +301,18 @@ void djui_interactable_update_pad(void) {
static f32 padHoldTimer = 0; static f32 padHoldTimer = 0;
enum PadHoldDirection padHoldDirection = sKeyboardHoldDirection; enum PadHoldDirection padHoldDirection = sKeyboardHoldDirection;
// allow dpad to navigate
if (padHoldDirection == PAD_HOLD_DIR_NONE) {
if (pad->button & U_JPAD) {
padHoldDirection = PAD_HOLD_DIR_UP;
} else if (pad->button & D_JPAD) {
padHoldDirection = PAD_HOLD_DIR_DOWN;
} else if (pad->button & L_JPAD) {
padHoldDirection = PAD_HOLD_DIR_LEFT;
} else if (pad->button & R_JPAD) {
padHoldDirection = PAD_HOLD_DIR_RIGHT;
}
}
if (padHoldDirection != PAD_HOLD_DIR_NONE) { if (padHoldDirection != PAD_HOLD_DIR_NONE) {
switch (padHoldDirection) { switch (padHoldDirection) {
case PAD_HOLD_DIR_UP: pad->stick_x = 0; pad->stick_y = -64; break; case PAD_HOLD_DIR_UP: pad->stick_x = 0; pad->stick_y = -64; break;