|
|
|
@ -203,6 +203,7 @@ void Menu::Update(AiL*game){ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
selection={}; |
|
|
|
|
for(auto&[key,component]:components){ |
|
|
|
|
if(component->selectable){ |
|
|
|
|
if(!component->disabled&&!component->grayedOut){ |
|
|
|
@ -321,6 +322,7 @@ void Menu::SetDefaultButton(std::weak_ptr<MenuComponent>button){ |
|
|
|
|
void Menu::KeyboardButtonNavigation(AiL*game,vf2d menuPos){ |
|
|
|
|
std::weak_ptr<MenuComponent>prevSelection=selection; |
|
|
|
|
|
|
|
|
|
if(!selection.expired()){ |
|
|
|
|
std::string selectionButtonName=selection.lock()->GetName(); |
|
|
|
|
if(navigationGroups.count(selectionButtonName)){ |
|
|
|
|
Navigation nav=navigationGroups[selectionButtonName]; |
|
|
|
@ -350,6 +352,7 @@ void Menu::KeyboardButtonNavigation(AiL*game,vf2d menuPos){ |
|
|
|
|
if(std::holds_alternative<MenuDataFunc>(nav.right))std::get<MenuDataFunc>(nav.right)(type); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(game->KEY_CONFIRM.Pressed()){ |
|
|
|
|
SetMouseNavigation(game->GetMouse(0).bPressed); //If a click occurs we use mouse controls.
|
|
|
|
|