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:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user