simplify. Don't separate "next" and "cancel" as much: to cancel, set the next screen to PREV_SCREEN, and use SM_GoToNextScreen.

This commit is contained in:
Glenn Maynard
2006-06-25 18:11:09 +00:00
parent cee1f2205c
commit b0055b0853
5 changed files with 8 additions and 13 deletions
+1 -11
View File
@@ -72,7 +72,6 @@ void Screen::BeginScreen()
/* Screens set these when they determine their next screen dynamically. Reset them
* here, so a reused screen doesn't inherit these from the last time it was used. */
m_sNextScreen = RString();
m_sPrevScreen = RString();
this->RunCommands( THEME->GetMetricA(m_sName, "ScreenOnCommand") );
}
@@ -213,20 +212,13 @@ void Screen::HandleScreenMessage( const ScreenMessage SM )
FOREACH_HumanPlayer(p)
MenuStart( p );
}
else if( SM == SM_GoToNextScreen )
else if( SM == SM_GoToNextScreen || SM == SM_GoToPrevScreen )
{
if( SCREENMAN->IsStackedScreen(this) )
SCREENMAN->PopTopScreen( m_smSendOnPop );
else
SCREENMAN->SetNewScreen( GetNextScreen() );
}
else if( SM == SM_GoToPrevScreen )
{
if( SCREENMAN->IsStackedScreen(this) )
SCREENMAN->PopTopScreen( m_smSendOnPop );
else
SCREENMAN->SetNewScreen( GetPrevScreen() );
}
}
RString Screen::GetNextScreen() const
@@ -238,8 +230,6 @@ RString Screen::GetNextScreen() const
RString Screen::GetPrevScreen() const
{
if( !m_sPrevScreen.empty() )
return m_sPrevScreen;
return PREV_SCREEN;
}