fixed need restart warning in settings

This commit is contained in:
Choupom 2011-03-27 12:12:50 +02:00 committed by oy
parent 876eac1048
commit 2179ae0113

View file

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