Add setting for disconnect confirmation

This commit is contained in:
def 2014-07-10 16:50:59 +02:00
parent ebc9e55acd
commit 2bf417b41f
3 changed files with 11 additions and 2 deletions

View file

@ -306,5 +306,6 @@ MACRO_CONFIG_INT(ClChatTeamColors, cl_chat_teamcolors, 0, 0, 1, CFGFLAG_CLIENT|C
MACRO_CONFIG_INT(ClShowDirection, cl_show_direction, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Show tee direction")
MACRO_CONFIG_INT(ClAutoUpdate, cl_auto_update, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Auto-Update")
MACRO_CONFIG_INT(ClOldGunPosition, cl_old_gun_position, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Tees hold gun a bit higher like in TW 0.6.1 and older")
MACRO_CONFIG_INT(ClConfirmDisconnect, cl_confirm_disconnect, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Confirmation popup before disconnecting")
#endif

View file

@ -53,8 +53,10 @@ void CMenus::RenderGame(CUIRect MainView)
static int s_DisconnectButton = 0;
if(DoButton_Menu(&s_DisconnectButton, Localize("Disconnect"), 0, &Button))
{
m_Popup = POPUP_DISCONNECT;
//Client()->Disconnect();
if(g_Config.m_ClConfirmDisconnect)
m_Popup = POPUP_DISCONNECT;
else
Client()->Disconnect();
}
if(m_pClient->m_Snap.m_pLocalInfo && m_pClient->m_Snap.m_pGameInfoObj)

View file

@ -187,6 +187,12 @@ void CMenus::RenderSettingsGeneral(CUIRect MainView)
g_Config.m_ClAutoScreenshotMax = static_cast<int>(DoScrollbarH(&g_Config.m_ClAutoScreenshotMax, &Button, g_Config.m_ClAutoScreenshotMax/1000.0f)*1000.0f+0.1f);
}
Right.HSplitTop(20.0f, &Button, &Right);
Right.HSplitTop(20.0f, &Button, &Right);
if(DoButton_CheckBox(&g_Config.m_ClConfirmDisconnect, Localize("Confirm disconnect from server"), g_Config.m_ClConfirmDisconnect, &Button))
g_Config.m_ClConfirmDisconnect ^= 1;
Left.HSplitTop(20.0f, 0, &Left);
Left.HSplitTop(20.0f, &Label, &Left);
Button.VSplitRight(20.0f, &Button, 0);