From c9265fa15a184f1926a10d3ec5a042ba5d68a1a4 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 25 Mar 2004 10:07:11 +0000 Subject: [PATCH] change and reset sound volume in SM_GainFocus and SM_LoseFocus; they're always called, even when exiting to the sys menu --- stepmania/src/ScreenDemonstration.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/stepmania/src/ScreenDemonstration.cpp b/stepmania/src/ScreenDemonstration.cpp index fce9501e14..0904facaa8 100644 --- a/stepmania/src/ScreenDemonstration.cpp +++ b/stepmania/src/ScreenDemonstration.cpp @@ -125,11 +125,16 @@ void ScreenDemonstration::HandleScreenMessage( const ScreenMessage SM ) if(!m_Out.IsTransitioning()) m_Out.StartTransitioning( SM_GoToNextScreen ); return; + + case SM_GainFocus: + if( !GAMESTATE->IsTimeToPlayAttractSounds() ) + SOUNDMAN->SetPrefs( 0 ); // silent + + case SM_LoseFocus: + SOUNDMAN->SetPrefs( PREFSMAN->m_fSoundVolume ); // turn volume back on + case SM_GoToNextScreen: SOUND->StopMusic(); - if( !GAMESTATE->IsTimeToPlayAttractSounds() ) - SOUNDMAN->SetPrefs( PREFSMAN->m_fSoundVolume ); // turn volume back on - GAMESTATE->Reset(); SCREENMAN->SetNewScreen( NEXT_SCREEN ); return;