From 688863f1aa67e9eead9b90e2caea3225ff5cb5bb Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 3 May 2007 05:42:36 +0000 Subject: [PATCH] fix sound not played in service menu if operator button is pressed when attract sound is off --- stepmania/src/ScreenAttract.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/stepmania/src/ScreenAttract.cpp b/stepmania/src/ScreenAttract.cpp index af231372b2..ffbea4dbd6 100644 --- a/stepmania/src/ScreenAttract.cpp +++ b/stepmania/src/ScreenAttract.cpp @@ -26,8 +26,6 @@ ScreenAttract::ScreenAttract( bool bResetGameState ) void ScreenAttract::BeginScreen() { - ScreenAttract::SetAttractVolume( !GAMESTATE->IsTimeToPlayAttractSounds() ); - GAMESTATE->VisitAttractScreen( m_sName ); ScreenWithMenuElements::BeginScreen(); @@ -131,6 +129,14 @@ void ScreenAttract::HandleScreenMessage( const ScreenMessage SM ) if( bMusicChanging ) SOUND->StopMusic(); } + else if( SM == SM_GainFocus ) + { + ScreenAttract::SetAttractVolume( !GAMESTATE->IsTimeToPlayAttractSounds() ); + } + else if( SM == SM_LoseFocus ) + { + ScreenAttract::SetAttractVolume( false ); + } ScreenWithMenuElements::HandleScreenMessage( SM ); }