From 1a5d70450f1de87224334e550706c67ad0cde6b8 Mon Sep 17 00:00:00 2001 From: oy Date: Wed, 13 Apr 2011 20:00:54 +0200 Subject: added "reimplemented menu music by teetow-the-great-teetow" by Choupom --- src/game/client/components/menus_settings.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/game/client/components/menus_settings.cpp') diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index 688f7695..959af2f3 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -3,7 +3,7 @@ #include - +#include #include #include #include @@ -13,6 +13,7 @@ #include #include +#include #include #include #include @@ -755,12 +756,26 @@ 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; + if(g_Config.m_SndEnable) + m_pClient->m_pSounds->Play(CSounds::CHN_MUSIC, SOUND_MENU, 1.0f, vec2(0, 0)); + else + m_pClient->m_pSounds->Stop(SOUND_MENU); m_NeedRestartSound = g_Config.m_SndEnable && (!s_SndEnable || s_SndRate != g_Config.m_SndRate); } if(!g_Config.m_SndEnable) return; + MainView.HSplitTop(20.0f, &Button, &MainView); + if(DoButton_CheckBox(&g_Config.m_SndMusic, Localize("Play background music"), g_Config.m_SndMusic, &Button)) + { + g_Config.m_SndMusic ^= 1; + if(g_Config.m_SndMusic) + m_pClient->m_pSounds->Play(CSounds::CHN_MUSIC, SOUND_MENU, 1.0f, vec2(0, 0)); + else + m_pClient->m_pSounds->Stop(SOUND_MENU); + } + MainView.HSplitTop(20.0f, &Button, &MainView); if(DoButton_CheckBox(&g_Config.m_SndNonactiveMute, Localize("Mute when not active"), g_Config.m_SndNonactiveMute, &Button)) g_Config.m_SndNonactiveMute ^= 1; -- cgit 1.4.1