This commit is contained in:
TuxSH 2017-08-16 23:46:36 +02:00
parent aa8e0bda8c
commit ca2622af7c

View File

@ -272,6 +272,7 @@ void menuShow(Menu *root)
Menu *currentMenu = root; Menu *currentMenu = root;
u32 nbPreviousMenus = 0; u32 nbPreviousMenus = 0;
Menu *previousMenus[0x80]; Menu *previousMenus[0x80];
u32 previousSelectedItems[0x80];
Draw_Lock(); Draw_Lock();
Draw_ClearFramebuffer(); Draw_ClearFramebuffer();
@ -297,6 +298,7 @@ void menuShow(Menu *root)
currentMenu->items[selectedItem].method(); currentMenu->items[selectedItem].method();
break; break;
case MENU: case MENU:
previousSelectedItems[nbPreviousMenus] = selectedItem;
previousMenus[nbPreviousMenus++] = currentMenu; previousMenus[nbPreviousMenus++] = currentMenu;
currentMenu = currentMenu->items[selectedItem].menu; currentMenu = currentMenu->items[selectedItem].menu;
selectedItem = 0; selectedItem = 0;
@ -316,7 +318,10 @@ void menuShow(Menu *root)
Draw_Unlock(); Draw_Unlock();
if(nbPreviousMenus > 0) if(nbPreviousMenus > 0)
{
currentMenu = previousMenus[--nbPreviousMenus]; currentMenu = previousMenus[--nbPreviousMenus];
selectedItem = previousSelectedItems[nbPreviousMenus];
}
else else
break; break;
} }