SetMouseNavigation(game->GetMouse(Mouse::LEFT).bReleased||game->GetMouse(Mouse::RIGHT).bReleased||game->GetMouse(Mouse::MIDDLE).bReleased);//If a click occurs we use mouse controls.
if(iterationCount==MAX_ITERATIONS)ERR("WARNING! We've entered the max iteration count of automatic Menu navigation! THIS LIKELY MEANS WE'VE DONE SOMETHING TERRIBLY WRONG!");
SetMouseNavigation(game->GetMouse(Mouse::LEFT).bReleased||game->GetMouse(Mouse::RIGHT).bReleased||game->GetMouse(Mouse::MIDDLE).bReleased);//If a click occurs we use mouse controls.
voidSetSelection(std::string_viewbutton,constboolscroll=true,constboolreset=false);// Use the reset parameter when a window is opening up, as this will cause the window now to scroll to its previous target.
voidSetSelection(std::weak_ptr<MenuComponent>button,constboolscroll=true,constboolreset=false);// Use the reset parameter when a window is opening up, as this will cause the window now to scroll to its previous target.
voidSetSelection(std::variant<std::string,std::weak_ptr<MenuComponent>>button,constboolreset=false);// Use the reset parameter when a window is opening up, as this will cause the window now to scroll to its previous target.
voidSetSelection(Databutton,constboolreset=false);// Use the reset parameter when a window is opening up, as this will cause the window now to scroll to its previous target.
if(Menu::stack.back()->GetType()==OVERWORLD_MENU){//HACK ALERT! This is in case we hit the menu key from the resume button as it too closes the menu, so this is a double close attempt.
Menu::CloseMenu();
}
}}},
{game->KEY_MENU,{"Close Menu",[](MenuTypetype){
Menu::CloseMenu();
if(Menu::stack.back()->GetType()==OVERWORLD_MENU){//HACK ALERT! This is in case we hit the menu key from the resume button as it too closes the menu, so this is a double close attempt.
returngeom2d::overlaps(geom2d::rect<float>{Menu::menus[parentMenu]->pos+rect.pos,rect.size},game->GetMousePos())&&//Make sure the mouse is inside the parent window component first....