Quit without popup when it makes sense

This commit is contained in:
def 2020-09-10 19:58:27 +02:00
parent 419942ace4
commit a52c8a22a6

View file

@ -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);