Skip to content

Commit

Permalink
Fix main menu doesn't hide in-game (#943)
Browse files Browse the repository at this point in the history
Fix after changes in eabe172
  • Loading branch information
Xottab-DUTY committed Jan 16, 2025
1 parent 57252ec commit b575068
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/xrGame/ui/UIMMShniaga.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,14 +390,14 @@ void CUIMMShniaga::OnBtnClick()

bool CUIMMShniaga::OnKeyboardAction(int dik, EUIMessages keyboard_action)
{
if (IsBinded(kQUIT, dik))
{
if (m_page != epi_main)
ShowMain();
if (CUIWindow::OnKeyboardAction(dik, keyboard_action))
return true;
}

const auto action = GetBindedAction(dik, EKeyContext::UI);
EGameActions action;
if (IsBinded(kQUIT, dik))
action = kUI_BACK;
else
action = GetBindedAction(dik, EKeyContext::UI);

// Check here only for key press to fix too fast clicks
if (WINDOW_KEY_PRESSED == keyboard_action)
Expand All @@ -410,9 +410,11 @@ bool CUIMMShniaga::OnKeyboardAction(int dik, EUIMessages keyboard_action)

case kUI_BACK:
if (m_page != epi_main)
{
ShowMain();
return true;

return true;
}
break;
case kUI_MOVE_UP:
case kUI_MOVE_DOWN:
// CInput sends both 'key hold' and 'key press' during one frame for keyboard (not gamepad)
Expand Down Expand Up @@ -447,7 +449,7 @@ bool CUIMMShniaga::OnKeyboardAction(int dik, EUIMessages keyboard_action)
} // switch (GetBindedAction(dik))
}

return CUIWindow::OnKeyboardAction(dik, keyboard_action);
return false;
}

bool CUIMMShniaga::OnControllerAction(int axis, float x, float y, EUIMessages controller_action)
Expand Down

0 comments on commit b575068

Please sign in to comment.