Skip to content

Commit

Permalink
Fixed bug where system menu would hijack control when submenu opened …
Browse files Browse the repository at this point in the history
…directly
  • Loading branch information
PringlesGang committed Sep 15, 2024
1 parent e40f8d6 commit ecb077d
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/games/cclcc/systemmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,18 @@ void SystemMenu::Show() {
State = Showing;
MenuTransition.StartIn();
MainItems->Show();
if (UI::FocusedMenu != 0) {
LastFocusedMenu = UI::FocusedMenu;
LastFocusedMenu->IsFocused = false;

// If the function was called due to a submenu opening directly,
// then don't take over focus
if (!(ScrWork[SW_SYSMENUCT] == 32 && ScrWork[SW_SYSSUBMENUCT] ||
ScrWork[2151])) {
if (UI::FocusedMenu != 0) {
LastFocusedMenu = UI::FocusedMenu;
LastFocusedMenu->IsFocused = false;
}
IsFocused = true;
UI::FocusedMenu = this;
}
IsFocused = true;
UI::FocusedMenu = this;
}
}

Expand Down

0 comments on commit ecb077d

Please sign in to comment.