From 3f60d2e26a5138816b28f5aa1a011eeb96eb7e7a Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 16 Jan 2006 22:42:11 +0000 Subject: [PATCH] I'm not sure what case BeginFadingOut wouldn't run SM_BeginFadingOut. The NextScreen metric would have to be blank, and there aren't any blank NextScreen metrics. Move this handling into SM_BeginFadingOut itself. Handle the case of a blank NextScreen with a warning. --- stepmania/src/ScreenOptions.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/stepmania/src/ScreenOptions.cpp b/stepmania/src/ScreenOptions.cpp index 224f6fc7b7..61acadd8f1 100644 --- a/stepmania/src/ScreenOptions.cpp +++ b/stepmania/src/ScreenOptions.cpp @@ -583,6 +583,19 @@ void ScreenOptions::HandleScreenMessage( const ScreenMessage SM ) { if( IsTransitioning() ) return; /* already transitioning */ + + /* If the selected option sets a screen, honor it. */ + CString sThisScreen = GetNextScreenForSelection( GAMESTATE->m_MasterPlayerNumber ); + if( sThisScreen != "" ) + m_sNextScreen = sThisScreen; + + // If options set a NextScreen or one is specified in metrics, then fade out + if( GetNextScreen() == "" ) + { + LOG->Warn( "%s::HandleScreenMessage: Tried to fade out, but we have no next screen", m_sName.c_str() ); + return; + } + StartTransitioningScreen( SM_ExportOptions ); SCREENMAN->PlayStartSound(); @@ -1000,14 +1013,7 @@ CString ScreenOptions::GetNextScreenForSelection( PlayerNumber pn ) const void ScreenOptions::BeginFadingOut() { - /* If the selected option sets a screen, honor it. */ - CString sThisScreen = GetNextScreenForSelection( GAMESTATE->m_MasterPlayerNumber ); - if( sThisScreen != "" ) - m_sNextScreen = sThisScreen; - - // If options set a NextScreen or one is specified in metrics, then fade out - if( GetNextScreen() != "" ) - this->PostScreenMessage( SM_BeginFadingOut, 0 ); + this->PostScreenMessage( SM_BeginFadingOut, 0 ); } /* Left/right */