Credits navigation key actually pops up the credits for controllers.

This commit is contained in:
sigonasr2 2024-03-03 01:58:40 -06:00
parent af0a628866
commit ddddd966aa
5 changed files with 12 additions and 4 deletions

View File

@ -3558,9 +3558,6 @@ void AiL::GetAnyKeyRelease(Key key){
if(InputGroup::menuNamesToInputGroups.count(Menu::menus[NEW_INPUT]->S(A::KEYBIND))){
InputGroup::menuNamesToInputGroups[Menu::menus[NEW_INPUT]->S(A::KEYBIND)]->SetNewPrimaryKeybind(Input{KEY,key});
Menu::alreadyClicked=true;
for(auto[menuType,menu]:Menu::menus){
menu->helpDisplay.Initialize(menu->inputGroups);
}
Menu::CloseMenu();
}
}else{

View File

@ -792,6 +792,9 @@ void InputGroup::AddPrimaryKeybind(Input key){
void InputGroup::SetNewPrimaryKeybind(Input key){
RemovePrimaryKeybind(key.GetType());
AddPrimaryKeybind(key);
for(auto[menuType,menu]:Menu::menus){
menu->ReInitializeInputGroup();
}
}
void InputListener::Update(){

View File

@ -83,7 +83,9 @@ void Menu::InitializeMainMenuWindow(){
},
{ //Button Key
{game->KEY_CONFIRM,{"Select",[](MenuType type){}}},
{game->KEY_SELECT,{"Credits",[](MenuType type){}}},
{game->KEY_MENU,{"Credits",[](MenuType type){
Component<FloatingMenuComponent>(type,"Credits Button")->Click();
}}},
}
,{ //Button Navigation Rules
{"New Game Button",{

View File

@ -785,4 +785,8 @@ void Menu::IgnoreNextMouseNavigationAttempt(){
bool Menu::IsCurrentlyActive(MenuType type){
if(Menu::stack.size()==0)return false;
return Menu::stack.back()->GetType()==type;
}
void Menu::ReInitializeInputGroup(){
helpDisplay.Initialize(inputGroups);
}

View File

@ -189,6 +189,8 @@ public:
static std::pair<MenuType,std::string>GetMemoryLeakReportInfo();
virtual void Cleanup();
void ReInitializeInputGroup();
static void DrawThemedWindow(vf2d menuPos,vf2d size,Pixel renderColor=WHITE);
//X (0-2), Y (0-2) for specific 9-patch tile (tiled version).