Make ScreenTextEntry's transitioning more standard: call

StartTransitioningScreen, which runs TweenOffScreen and
then sends the message.

This is still a little unique, because it calls TweenOffScreen
on cancel.  The general cancel paths are still rough, and need
refactoring.  Piecemeal ...
This commit is contained in:
Glenn Maynard
2006-01-28 23:51:07 +00:00
parent 8d6dda13b6
commit 142a3863d6
2 changed files with 14 additions and 7 deletions
+13 -7
View File
@@ -377,6 +377,16 @@ void ScreenTextEntry::MenuStart( PlayerNumber pn )
}
}
void ScreenTextEntry::TweenOffScreen()
{
ScreenWithMenuElements::TweenOffScreen();
OFF_COMMAND( m_textQuestion );
OFF_COMMAND( m_sprAnswerBox );
OFF_COMMAND( m_textAnswer );
OFF_COMMAND( m_sprCursor );
}
void ScreenTextEntry::End( bool bCancelled )
{
if( bCancelled )
@@ -384,7 +394,8 @@ void ScreenTextEntry::End( bool bCancelled )
if( g_pOnCancel )
g_pOnCancel();
m_Cancel.StartTransitioning( SM_GoToNextScreen );
Cancel( SM_GoToNextScreen );
TweenOffScreen();
}
else
{
@@ -407,15 +418,10 @@ void ScreenTextEntry::End( bool bCancelled )
g_pOnOK( ret );
}
m_Out.StartTransitioning( SM_GoToNextScreen );
StartTransitioningScreen( SM_GoToNextScreen );
SCREENMAN->PlayStartSound();
}
OFF_COMMAND( m_textQuestion );
OFF_COMMAND( m_sprAnswerBox );
OFF_COMMAND( m_textAnswer );
OFF_COMMAND( m_sprCursor );
s_bCancelledLast = bCancelled;
s_sLastAnswer = bCancelled ? RString("") : WStringToRString(m_sAnswer);
}
+1
View File
@@ -48,6 +48,7 @@ public:
virtual void Update( float fDelta );
virtual void Input( const InputEventPlus &input );
virtual void TweenOffScreen();
static RString s_sLastAnswer;
static bool s_bCancelledLast;