mirror of https://github.com/mgba-emu/mgba.git
mGUI: Wrap around menu cursor when navigating past end (closes #3356)
This commit is contained in:
parent
838439dcef
commit
7643a044f4
1
CHANGES
1
CHANGES
|
@ -41,6 +41,7 @@ Misc:
|
|||
- Libretro: Add Super Game Boy Color support (closes mgba.io/i/3188)
|
||||
- mGUI: Enable auto-softpatching (closes mgba.io/i/2899)
|
||||
- mGUI: Persist fast forwarding after closing menu (fixes mgba.io/i/2414)
|
||||
- mGUI: Wrap around menu cursor when navigating past end (closes mgba.io/i/3356)
|
||||
- Qt: Handle multiple save game files for disparate games separately (fixes mgba.io/i/2887)
|
||||
- Qt: Remove maligned double-click-to-fullscreen shortcut (closes mgba.io/i/2632)
|
||||
- Qt: Pass logging context through to video proxy thread (fixes mgba.io/i/3095)
|
||||
|
|
|
@ -119,12 +119,6 @@ static enum GUIMenuExitReason GUIMenuPollInput(struct GUIParams* params, struct
|
|||
state->cursor = GUIPollCursor(params, &state->cx, &state->cy);
|
||||
|
||||
// Check for new direction presses
|
||||
if (newInput & (1 << GUI_INPUT_UP) && menu->index > 0) {
|
||||
--menu->index;
|
||||
}
|
||||
if (newInput & (1 << GUI_INPUT_DOWN) && menu->index < GUIMenuItemListSize(&menu->items) - 1) {
|
||||
++menu->index;
|
||||
}
|
||||
if (newInput & (1 << GUI_INPUT_LEFT)) {
|
||||
struct GUIMenuItem* item = GUIMenuItemListGetPointer(&menu->items, menu->index);
|
||||
if (item->validStates && !item->readonly) {
|
||||
|
@ -145,6 +139,20 @@ static enum GUIMenuExitReason GUIMenuPollInput(struct GUIParams* params, struct
|
|||
menu->index = GUIMenuItemListSize(&menu->items) - 1;
|
||||
}
|
||||
}
|
||||
if (newInput & (1 << GUI_INPUT_UP)) {
|
||||
if (menu->index > 0) {
|
||||
--menu->index;
|
||||
} else {
|
||||
menu->index = GUIMenuItemListSize(&menu->items) - 1;
|
||||
}
|
||||
}
|
||||
if (newInput & (1 << GUI_INPUT_DOWN)) {
|
||||
if (menu->index < GUIMenuItemListSize(&menu->items) - 1) {
|
||||
++menu->index;
|
||||
} else {
|
||||
menu->index = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Handle cursor movement
|
||||
if (state->cursor != GUI_CURSOR_NOT_PRESENT) {
|
||||
|
|
Loading…
Reference in New Issue