mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 06:28:19 +00:00
Merge #1841
1841: Restart required message when changing Show console r=heinrich5991 a=fokkonaut Co-authored-by: fokkonaut <35420825+fokkonaut@users.noreply.github.com>
This commit is contained in:
commit
ebeeace65e
|
@ -348,7 +348,9 @@ MACRO_CONFIG_STR(ClTimeoutCode, cl_timeout_code, 64, "", CFGFLAG_SAVE|CFGFLAG_CL
|
|||
MACRO_CONFIG_STR(ClDummyTimeoutCode, cl_dummy_timeout_code, 64, "", CFGFLAG_SAVE|CFGFLAG_CLIENT, "Dummy Timeout code to use")
|
||||
MACRO_CONFIG_STR(ClTimeoutSeed, cl_timeout_seed, 64, "", CFGFLAG_SAVE|CFGFLAG_CLIENT, "Timeout seed")
|
||||
MACRO_CONFIG_STR(ClInputFifo, cl_input_fifo, 128, "", CFGFLAG_SAVE|CFGFLAG_CLIENT, "Fifo file to use as input for client console")
|
||||
#if defined(CONF_FAMILY_WINDOWS)
|
||||
MACRO_CONFIG_INT(ClShowConsole, cl_show_console, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Show console window (Windows only)")
|
||||
#endif
|
||||
MACRO_CONFIG_INT(InpJoystick, inp_joystick, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Try to use a joystick as input")
|
||||
MACRO_CONFIG_INT(ClConfigVersion, cl_config_version, 0, 0, 0, CFGFLAG_CLIENT|CFGFLAG_SAVE, "The config version. Helps newer clients fix bugs with older configs.")
|
||||
|
||||
|
|
|
@ -127,6 +127,7 @@ class CMenus : public CComponent
|
|||
static float ms_FontmodHeight;
|
||||
|
||||
// for settings
|
||||
bool m_NeedRestartGeneral;
|
||||
bool m_NeedRestartSkins;
|
||||
bool m_NeedRestartGraphics;
|
||||
bool m_NeedRestartSound;
|
||||
|
|
|
@ -68,6 +68,11 @@ bool CMenusKeyBinder::OnInput(IInput::CEvent Event)
|
|||
|
||||
void CMenus::RenderSettingsGeneral(CUIRect MainView)
|
||||
{
|
||||
#if defined(CONF_FAMILY_WINDOWS)
|
||||
bool CheckSettings = false;
|
||||
static int s_ClShowConsole = g_Config.m_ClShowConsole;
|
||||
#endif
|
||||
|
||||
char aBuf[128];
|
||||
CUIRect Label, Button, Left, Right, Game, Client, AutoReconnect;
|
||||
MainView.HSplitTop(180.0f, &Game, &Client);
|
||||
|
@ -213,7 +218,13 @@ void CMenus::RenderSettingsGeneral(CUIRect MainView)
|
|||
Left.HSplitTop(20.0f, 0, &Left);
|
||||
Left.HSplitTop(20.0f, &Button, &Left);
|
||||
if(DoButton_CheckBox(&g_Config.m_ClShowConsole, Localize("Show console window"), g_Config.m_ClShowConsole, &Button))
|
||||
{
|
||||
g_Config.m_ClShowConsole ^= 1;
|
||||
CheckSettings = true;
|
||||
}
|
||||
|
||||
if(CheckSettings)
|
||||
m_NeedRestartGeneral = s_ClShowConsole != g_Config.m_ClShowConsole;
|
||||
#endif
|
||||
|
||||
// auto statboard screenshot
|
||||
|
@ -1417,7 +1428,7 @@ void CMenus::RenderSettings(CUIRect MainView)
|
|||
UI()->DoLabelScaled(&RestartWarning, Localize("DDNet Client needs to be restarted to complete update!"), 14.0f, -1);
|
||||
TextRender()->TextColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
}
|
||||
else if(m_NeedRestartSkins || m_NeedRestartGraphics || m_NeedRestartSound || m_NeedRestartDDNet)
|
||||
else if(m_NeedRestartGeneral || m_NeedRestartSkins || m_NeedRestartGraphics || m_NeedRestartSound || m_NeedRestartDDNet)
|
||||
UI()->DoLabelScaled(&RestartWarning, Localize("You must restart the game for all settings to take effect."), 14.0f, -1);
|
||||
}
|
||||
|
||||
|
@ -2157,12 +2168,7 @@ void CMenus::RenderSettingsDDNet(CUIRect MainView)
|
|||
}
|
||||
|
||||
if(CheckSettings)
|
||||
{
|
||||
if(s_InpMouseOld == g_Config.m_InpMouseOld)
|
||||
m_NeedRestartDDNet = false;
|
||||
else
|
||||
m_NeedRestartDDNet = true;
|
||||
}
|
||||
m_NeedRestartDDNet = s_InpMouseOld != g_Config.m_InpMouseOld;
|
||||
|
||||
CUIRect aRects[2];
|
||||
Left.HSplitTop(5.0f, &Button, &Left);
|
||||
|
|
Loading…
Reference in a new issue