mirror of
https://github.com/wiiu-env/WiiUPluginLoaderBackend.git
synced 2024-11-22 04:39:17 +01:00
Config: Fix possible crash when navigating the config menu
This commit is contained in:
parent
12c565681f
commit
21fec8e451
@ -306,11 +306,15 @@ void ConfigUtils::displayMenu() {
|
|||||||
auto cats = currentConfig->config->getCategories();
|
auto cats = currentConfig->config->getCategories();
|
||||||
if (buttonsTriggered & VPAD_BUTTON_DOWN) {
|
if (buttonsTriggered & VPAD_BUTTON_DOWN) {
|
||||||
if (selectedCat < cats.size() - 1) {
|
if (selectedCat < cats.size() - 1) {
|
||||||
|
selectedItem = 0;
|
||||||
|
prevSelectedItem = 0;
|
||||||
selectedCat++;
|
selectedCat++;
|
||||||
redraw = true;
|
redraw = true;
|
||||||
}
|
}
|
||||||
} else if (buttonsTriggered & VPAD_BUTTON_UP) {
|
} else if (buttonsTriggered & VPAD_BUTTON_UP) {
|
||||||
if (selectedCat > 0) {
|
if (selectedCat > 0) {
|
||||||
|
selectedItem = 0;
|
||||||
|
prevSelectedItem = 0;
|
||||||
selectedCat--;
|
selectedCat--;
|
||||||
redraw = true;
|
redraw = true;
|
||||||
}
|
}
|
||||||
@ -336,10 +340,12 @@ void ConfigUtils::displayMenu() {
|
|||||||
redraw = true;
|
redraw = true;
|
||||||
continue;
|
continue;
|
||||||
} else if (buttonsTriggered & VPAD_BUTTON_B) {
|
} else if (buttonsTriggered & VPAD_BUTTON_B) {
|
||||||
currentConfig = nullptr;
|
currentConfig = nullptr;
|
||||||
currentCategory = nullptr;
|
currentCategory = nullptr;
|
||||||
start = 0;
|
start = 0;
|
||||||
end = MAX_BUTTONS_ON_SCREEN;
|
selectedItem = 0;
|
||||||
|
prevSelectedItem = 0;
|
||||||
|
end = MAX_BUTTONS_ON_SCREEN;
|
||||||
if (configs.size() < MAX_BUTTONS_ON_SCREEN) {
|
if (configs.size() < MAX_BUTTONS_ON_SCREEN) {
|
||||||
end = configs.size();
|
end = configs.size();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user