mGUI: Fix cycling through config setting states with accept button

This commit is contained in:
Vicki Pfau 2020-10-14 23:40:32 -07:00
parent 2aa39cacbb
commit 2702dcfb6f
2 changed files with 9 additions and 2 deletions

View File

@ -78,6 +78,7 @@ Other fixes:
- Qt: Fix stride changing when toggling SGB borders (fixes mgba.io/i/1898)
- Qt: Fix aliasing on background logo (fixes mgba.io/i/1886)
- mGUI: Fix closing down a game if an exit is signalled
- mGUI: Fix cycling through config setting states with accept button
- mVL: Fix injecting accidentally draining non-injection buffer
- SM83: Simplify register pair access on big endian
- SM83: Disassemble STOP as one byte

View File

@ -368,8 +368,14 @@ void mGUIShowConfig(struct mGUIRunner* runner, struct GUIMenuItem* extra, size_t
}
#endif
if (item->validStates) {
if (item->state < item->nStates - 1) {
do {
++item->state;
if (item->state >= item->nStates) {
} while (!item->validStates[item->state] && item->state < item->nStates - 1);
if (!item->validStates[item->state]) {
item->state = 0;
}
} else {
item->state = 0;
}
}