Fixed issues with one input bleeding into multiple inputs. Removed old redundant system where we can specify a menu to navigate to. Implemented controller compatibility for UserID menu. Release Build 7326.

This commit is contained in:
2024-02-18 18:46:45 -06:00
parent 7434079e0d
commit a39a841166
25 changed files with 91 additions and 77 deletions
+3 -19
View File
@@ -47,17 +47,11 @@ INCLUDE_game
using A=Attribute;
MenuComponent::MenuComponent(geom2d::rect<float>rect,std::string label,MenuFunc onClick,ButtonAttr attributes)
:rect(rect),originalPos(rect.pos),label(label),menuDest(MenuType::ENUM_END),onClick(onClick),hoverEffect(0),selectable(!(attributes&ButtonAttr::UNSELECTABLE)),selectableViaKeyboard(!(attributes&ButtonAttr::UNSELECTABLE_VIA_KEYBOARD)),memoryLeakInfo(Menu::GetMemoryLeakReportInfo()),fitToLabel(attributes&ButtonAttr::FIT_TO_LABEL){}
:rect(rect),originalPos(rect.pos),label(label),onClick(onClick),hoverEffect(0),selectable(!(attributes&ButtonAttr::UNSELECTABLE)),selectableViaKeyboard(!(attributes&ButtonAttr::UNSELECTABLE_VIA_KEYBOARD)),memoryLeakInfo(Menu::GetMemoryLeakReportInfo()),fitToLabel(attributes&ButtonAttr::FIT_TO_LABEL){}
MenuComponent::MenuComponent(geom2d::rect<float>rect,std::string label,MenuType menuDest,MenuFunc onClick,ButtonAttr attributes)
MenuComponent::MenuComponent(geom2d::rect<float>rect,std::string label,MenuFunc onClick,vf2d labelScaling,ButtonAttr attributes)
:MenuComponent(rect,label,onClick,attributes){
//NOTE: This constructor also calls the other constructor above!
this->menuDest=menuDest;
}
MenuComponent::MenuComponent(geom2d::rect<float>rect,std::string label,MenuType menuDest,MenuFunc onClick,vf2d labelScaling,ButtonAttr attributes)
:MenuComponent(rect,label,menuDest,onClick,attributes){
//NOTE: This constructor also calls the other constructor above!
this->labelScaling=labelScaling;
}
@@ -265,17 +259,7 @@ void MenuComponent::OnChapterUpdate(uint8_t newChapter){}
void MenuComponent::Click(){
if(grayedOut||disable||disableOutsideWindow)return;
bool buttonStillValid=onClick(MenuFuncData{*Menu::menus[parentMenu],game,Menu::menus[parentMenu]->components[name]});
if(buttonStillValid){
if(menuDest!=MenuType::ENUM_END){
if(Menu::stack.size()<MAX_MENUS){
Menu::OpenMenu(menuDest); //Navigate to the next menu.
}else{
ERR("WARNING! Exceeded menu stack size limit!")
}
}
}
onClick(MenuFuncData{*Menu::menus[parentMenu],game,Menu::menus[parentMenu]->components[name]});
}
void MenuComponent::SetLabel(std::string newLabel){
label=newLabel;