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.
This commit is contained in:
Glenn Maynard
2006-01-16 22:42:11 +00:00
parent b1c4fc168a
commit 3f60d2e26a
+14 -8
View File
@@ -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 */