mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
fixed need restart warning in settings
This commit is contained in:
parent
876eac1048
commit
2179ae0113
|
@ -755,7 +755,7 @@ void CMenus::RenderSettingsSound(CUIRect MainView)
|
|||
if(DoButton_CheckBox(&g_Config.m_SndEnable, Localize("Use sounds"), g_Config.m_SndEnable, &Button))
|
||||
{
|
||||
g_Config.m_SndEnable ^= 1;
|
||||
m_NeedRestartSound = s_SndEnable == g_Config.m_SndEnable && (!s_SndEnable || s_SndRate == g_Config.m_SndRate) ? false : true;
|
||||
m_NeedRestartSound = g_Config.m_SndEnable && (!s_SndEnable || s_SndRate != g_Config.m_SndRate);
|
||||
}
|
||||
|
||||
if(!g_Config.m_SndEnable)
|
||||
|
@ -774,11 +774,8 @@ void CMenus::RenderSettingsSound(CUIRect MainView)
|
|||
Button.VSplitLeft(190.0f, 0, &Button);
|
||||
static float Offset = 0.0f;
|
||||
DoEditBox(&g_Config.m_SndRate, &Button, aBuf, sizeof(aBuf), 14.0f, &Offset);
|
||||
int Before = g_Config.m_SndRate;
|
||||
g_Config.m_SndRate = max(1, str_toint(aBuf));
|
||||
|
||||
if(g_Config.m_SndRate != Before)
|
||||
m_NeedRestartSound = s_SndEnable == g_Config.m_SndEnable && s_SndRate == g_Config.m_SndRate ? false : true;
|
||||
m_NeedRestartSound = !s_SndEnable || s_SndRate != g_Config.m_SndRate;
|
||||
}
|
||||
|
||||
// volume slider
|
||||
|
|
Loading…
Reference in a new issue