From 142a3863d60164097fc03e4ae21762099016030f Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 28 Jan 2006 23:51:07 +0000 Subject: [PATCH] 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 ... --- stepmania/src/ScreenTextEntry.cpp | 20 +++++++++++++------- stepmania/src/ScreenTextEntry.h | 1 + 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/stepmania/src/ScreenTextEntry.cpp b/stepmania/src/ScreenTextEntry.cpp index 8518b60c7f..be421802de 100644 --- a/stepmania/src/ScreenTextEntry.cpp +++ b/stepmania/src/ScreenTextEntry.cpp @@ -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); } diff --git a/stepmania/src/ScreenTextEntry.h b/stepmania/src/ScreenTextEntry.h index af8c3d2b92..5e97cb498a 100644 --- a/stepmania/src/ScreenTextEntry.h +++ b/stepmania/src/ScreenTextEntry.h @@ -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;