From d481b5462b8cf8a9dc903a75f50c09c2193da7f9 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 3 May 2007 05:48:01 +0000 Subject: [PATCH] fix sound not played in service menu if operator button is pressed when attract sound is off --- stepmania/src/ScreenAttract.cpp | 5 +---- stepmania/src/ScreenDemonstration.cpp | 6 +++++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/stepmania/src/ScreenAttract.cpp b/stepmania/src/ScreenAttract.cpp index ffbea4dbd6..9e74837806 100644 --- a/stepmania/src/ScreenAttract.cpp +++ b/stepmania/src/ScreenAttract.cpp @@ -27,6 +27,7 @@ ScreenAttract::ScreenAttract( bool bResetGameState ) void ScreenAttract::BeginScreen() { GAMESTATE->VisitAttractScreen( m_sName ); + ScreenAttract::SetAttractVolume( !GAMESTATE->IsTimeToPlayAttractSounds() ); ScreenWithMenuElements::BeginScreen(); } @@ -129,10 +130,6 @@ 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 ); diff --git a/stepmania/src/ScreenDemonstration.cpp b/stepmania/src/ScreenDemonstration.cpp index b5b1633462..4a5c330149 100644 --- a/stepmania/src/ScreenDemonstration.cpp +++ b/stepmania/src/ScreenDemonstration.cpp @@ -19,13 +19,13 @@ REGISTER_SCREEN_CLASS( ScreenDemonstration ); ScreenDemonstration::ScreenDemonstration() { m_bDemonstration = true; - ScreenAttract::SetAttractVolume( !GAMESTATE->IsTimeToPlayAttractSounds() ); } void ScreenDemonstration::Init() { GAMESTATE->Reset(); GAMESTATE->VisitAttractScreen( m_sName ); + ScreenAttract::SetAttractVolume( !GAMESTATE->IsTimeToPlayAttractSounds() ); // Choose a Style { @@ -80,6 +80,10 @@ void ScreenDemonstration::HandleScreenMessage( const ScreenMessage SM ) m_Out.StartTransitioning( SM_GoToNextScreen ); return; } + else if( SM == SM_LoseFocus ) + { + ScreenAttract::SetAttractVolume( false ); + } ScreenJukebox::HandleScreenMessage( SM ); }