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:
@@ -583,6 +583,19 @@ void ScreenOptions::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
{
|
{
|
||||||
if( IsTransitioning() )
|
if( IsTransitioning() )
|
||||||
return; /* already transitioning */
|
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 );
|
StartTransitioningScreen( SM_ExportOptions );
|
||||||
|
|
||||||
SCREENMAN->PlayStartSound();
|
SCREENMAN->PlayStartSound();
|
||||||
@@ -1000,14 +1013,7 @@ CString ScreenOptions::GetNextScreenForSelection( PlayerNumber pn ) const
|
|||||||
|
|
||||||
void ScreenOptions::BeginFadingOut()
|
void ScreenOptions::BeginFadingOut()
|
||||||
{
|
{
|
||||||
/* If the selected option sets a screen, honor it. */
|
this->PostScreenMessage( SM_BeginFadingOut, 0 );
|
||||||
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 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Left/right */
|
/* Left/right */
|
||||||
|
|||||||
Reference in New Issue
Block a user