mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Quit without popup when it makes sense
This commit is contained in:
parent
419942ace4
commit
a52c8a22a6
|
@ -83,7 +83,16 @@ void CMenus::RenderStartMenu(CUIRect MainView)
|
|||
Menu.HSplitBottom(40.0f, &Menu, &Button);
|
||||
static int s_QuitButton;
|
||||
if(DoButton_Menu(&s_QuitButton, Localize("Quit"), 0, &Button, 0, CUI::CORNER_ALL, Rounding, 0.5f, vec4(0.0f, 0.0f, 0.0f, 0.5f), vec4(0.0f, 0.0f, 0.0f, 0.25f)) || m_EscapePressed || CheckHotKey(KEY_Q))
|
||||
m_Popup = POPUP_QUIT;
|
||||
{
|
||||
if(m_EscapePressed || m_pClient->Editor()->HasUnsavedData() || (Client()->GetCurrentRaceTime() / 60 >= g_Config.m_ClConfirmQuitTime && g_Config.m_ClConfirmQuitTime >= 0))
|
||||
{
|
||||
m_Popup = POPUP_QUIT;
|
||||
}
|
||||
else
|
||||
{
|
||||
Client()->Quit();
|
||||
}
|
||||
}
|
||||
|
||||
Menu.HSplitBottom(100.0f, &Menu, 0);
|
||||
Menu.HSplitBottom(40.0f, &Menu, &Button);
|
||||
|
|
Loading…
Reference in a new issue