Confirm and Back Buttons added.

This commit is contained in:
2023-10-24 03:22:25 -05:00
parent 02c7165b37
commit 598ce523e9
5 changed files with 20 additions and 3 deletions
+9 -1
View File
@@ -156,7 +156,7 @@ void Menu::HoverMenuSelect(Crawler*game){
void Menu::MenuSelect(Crawler*game){
if(selection==vi2d{-1,-1}||buttons[selection.y][selection.x]->disabled)return;
buttons[selection.y][selection.x]->onClick(MenuFuncData{*this,game,buttons[selection.y][selection.x]});
buttons[selection.y][selection.x]->onClick(MenuFuncData{*this,game,buttons[selection.y][selection.x]});
if(buttons[selection.y][selection.x]->menuDest!=MenuType::ENUM_END){
if(stack.size()<32){
stack.push_back(menus[buttons[selection.y][selection.x]->menuDest]);//Navigate to the next menu.
@@ -639,4 +639,12 @@ void Menu::CloseMenu(){
std::pair<MenuType,std::string>Menu::GetMemoryLeakReportInfo(){
return {lastMenuTypeCreated,lastRegisteredComponent};
}
void Menu::CloseAllMenus(){
if(stack.size()<=0){
std::cout<<"WARNING! Trying to close out no menu?? Why are we doing this?"<<std::endl;
throw;
}
stack.clear();
}