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:
@@ -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 )
|
void ScreenAttract::AttractInput( const InputEventPlus &input, ScreenWithMenuElements *pScreen )
|
||||||
{
|
{
|
||||||
if( input.type != IET_FIRST_PRESS )
|
if( input.type != IET_FIRST_PRESS )
|
||||||
@@ -85,13 +93,10 @@ void ScreenAttract::AttractInput( const InputEventPlus &input, ScreenWithMenuEle
|
|||||||
if( pScreen->IsTransitioning() )
|
if( pScreen->IsTransitioning() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
LOG->Trace("ScreenAttract::AttractInput: begin fading to START_SCREEN" );
|
|
||||||
|
|
||||||
/* HandleGlobalInputs() already played the coin sound. Don't play it again. */
|
/* HandleGlobalInputs() already played the coin sound. Don't play it again. */
|
||||||
if( input.MenuI != GAME_BUTTON_COIN )
|
if( input.MenuI != GAME_BUTTON_COIN )
|
||||||
SCREENMAN->PlayStartSound();
|
SCREENMAN->PlayStartSound();
|
||||||
|
|
||||||
SetAttractVolume( false ); // unmute attract sounds
|
|
||||||
pScreen->Cancel( SM_GoToStartScreen );
|
pScreen->Cancel( SM_GoToStartScreen );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ public:
|
|||||||
|
|
||||||
virtual void Input( const InputEventPlus &input );
|
virtual void Input( const InputEventPlus &input );
|
||||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||||
|
virtual void Cancel( ScreenMessage smSendWhenDone );
|
||||||
|
|
||||||
virtual ScreenType GetScreenType() const { return attract; }
|
virtual ScreenType GetScreenType() const { return attract; }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user