reenable sound in Cancel(), rather than as a special case in the input, so it works if someone else calls Cancel

This commit is contained in:
Glenn Maynard
2008-06-11 22:01:33 +00:00
parent 1f820776d1
commit 2c93c2d79c
2 changed files with 9 additions and 3 deletions
+8 -3
View File
@@ -60,6 +60,14 @@ void ScreenAttract::SetAttractVolume( bool bInAttract )
}
}
void ScreenAttract::Cancel( ScreenMessage smSendWhenDone )
{
LOG->Trace("ScreenAttract::AttractInput: begin fading to START_SCREEN" );
SetAttractVolume( false ); // unmute attract sounds
ScreenWithMenuElements::Cancel( smSendWhenDone );
}
void ScreenAttract::AttractInput( const InputEventPlus &input, ScreenWithMenuElements *pScreen )
{
if( input.type != IET_FIRST_PRESS )
@@ -85,13 +93,10 @@ void ScreenAttract::AttractInput( const InputEventPlus &input, ScreenWithMenuEle
if( pScreen->IsTransitioning() )
return;
LOG->Trace("ScreenAttract::AttractInput: begin fading to START_SCREEN" );
/* HandleGlobalInputs() already played the coin sound. Don't play it again. */
if( input.MenuI != GAME_BUTTON_COIN )
SCREENMAN->PlayStartSound();
SetAttractVolume( false ); // unmute attract sounds
pScreen->Cancel( SM_GoToStartScreen );
break;
default:
+1
View File
@@ -19,6 +19,7 @@ public:
virtual void Input( const InputEventPlus &input );
virtual void HandleScreenMessage( const ScreenMessage SM );
virtual void Cancel( ScreenMessage smSendWhenDone );
virtual ScreenType GetScreenType() const { return attract; }