Skip to content

Commit 414b4c3

Browse files
committed
xrGame/ui/UIActorMenu_action.cpp: optimized the code
1 parent 71c2457 commit 414b4c3

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

src/xrGame/ui/UIActorMenu_action.cpp

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -419,22 +419,12 @@ bool CUIActorMenu::OnKeyboardAction(int dik, EUIMessages keyboard_action)
419419
return true;
420420
}
421421

422-
if (IsBinded(kINVENTORY, dik))
422+
if (IsBinded(kQUIT, dik) || IsBinded(kINVENTORY, dik) ||
423+
IsBinded(kUI_BACK, dik, EKeyContext::UI))
423424
{
424425
if (WINDOW_KEY_PRESSED == keyboard_action)
425426
{
426-
g_btnHint->Discard();
427-
HideDialog();
428-
}
429-
return true;
430-
}
431-
432-
if (IsBinded(kQUIT, dik) || IsBinded(kUI_BACK, dik, EKeyContext::UI))
433-
{
434-
if (WINDOW_KEY_PRESSED == keyboard_action)
435-
{
436-
g_btnHint->Discard();
437-
HideDialog();
427+
OnBtnExitClicked(this, nullptr);
438428
}
439429
return true;
440430
}

0 commit comments

Comments
 (0)