From 2c93c2d79ccee4abc9be9d61d553309e9d19ebf0 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 11 Jun 2008 22:01:33 +0000 Subject: [PATCH] reenable sound in Cancel(), rather than as a special case in the input, so it works if someone else calls Cancel --- stepmania/src/ScreenAttract.cpp | 11 ++++++++--- stepmania/src/ScreenAttract.h | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/stepmania/src/ScreenAttract.cpp b/stepmania/src/ScreenAttract.cpp index 49d2cd739e..7c09680a27 100644 --- a/stepmania/src/ScreenAttract.cpp +++ b/stepmania/src/ScreenAttract.cpp @@ -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: diff --git a/stepmania/src/ScreenAttract.h b/stepmania/src/ScreenAttract.h index c4912f0734..df473f3310 100644 --- a/stepmania/src/ScreenAttract.h +++ b/stepmania/src/ScreenAttract.h @@ -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; }