From 6a665f43fb53624fe7548afbd0bf3c4d9fb40061 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Sun, 13 May 2007 03:42:31 +0000 Subject: [PATCH] Generic tween on/off. --- stepmania/src/ScreenTextEntry.cpp | 25 ++++++------------------- stepmania/src/ScreenTextEntry.h | 4 ++-- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/stepmania/src/ScreenTextEntry.cpp b/stepmania/src/ScreenTextEntry.cpp index d10316c874..48912a6e91 100644 --- a/stepmania/src/ScreenTextEntry.cpp +++ b/stepmania/src/ScreenTextEntry.cpp @@ -116,10 +116,12 @@ void ScreenTextEntry::Init() m_textQuestion.LoadFromFont( THEME->GetPathF(m_sName,"question") ); m_textQuestion.SetName( "Question" ); + LOAD_ALL_COMMANDS( m_textQuestion ); this->AddChild( &m_textQuestion ); m_textAnswer.LoadFromFont( THEME->GetPathF(m_sName,"answer") ); m_textAnswer.SetName( "Answer" ); + LOAD_ALL_COMMANDS( m_textAnswer ); this->AddChild( &m_textAnswer ); m_bShowAnswerCaret = false; @@ -135,8 +137,8 @@ void ScreenTextEntry::BeginScreen() ScreenWithMenuElements::BeginScreen(); m_textQuestion.SetText( g_sQuestion ); - LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textQuestion ); - LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textAnswer ); + SET_XY( m_textQuestion ); + SET_XY( m_textAnswer ); UpdateAnswerText(); } @@ -245,14 +247,6 @@ void ScreenTextEntry::MenuStart( const InputEventPlus &input ) End( false ); } -void ScreenTextEntry::TweenOffScreen() -{ - ScreenWithMenuElements::TweenOffScreen(); - - OFF_COMMAND( m_textQuestion ); - OFF_COMMAND( m_textAnswer ); -} - void ScreenTextEntry::End( bool bCancelled ) { if( bCancelled ) @@ -261,7 +255,7 @@ void ScreenTextEntry::End( bool bCancelled ) g_pOnCancel(); Cancel( SM_GoToNextScreen ); - TweenOffScreen(); + //TweenOffScreen(); } else { @@ -309,6 +303,7 @@ void ScreenTextEntryVisual::Init() m_sprCursor.Load( THEME->GetPathG(m_sName,"cursor") ); m_sprCursor->SetName( "Cursor" ); + LOAD_ALL_COMMANDS( m_sprCursor ); this->AddChild( m_sprCursor ); // Init keyboard @@ -349,7 +344,6 @@ void ScreenTextEntryVisual::BeginScreen() { ScreenTextEntry::BeginScreen(); - ON_COMMAND( m_sprCursor ); m_iFocusX = 0; m_iFocusY = (KeyboardRow)0; @@ -461,13 +455,6 @@ void ScreenTextEntryVisual::MenuStart( const InputEventPlus &input ) } } -void ScreenTextEntryVisual::TweenOffScreen() -{ - ScreenTextEntry::TweenOffScreen(); - - OFF_COMMAND( m_sprCursor ); -} - /* * (c) 2001-2004 Chris Danford * All rights reserved. diff --git a/stepmania/src/ScreenTextEntry.h b/stepmania/src/ScreenTextEntry.h index a4cb90138d..920693255b 100644 --- a/stepmania/src/ScreenTextEntry.h +++ b/stepmania/src/ScreenTextEntry.h @@ -65,7 +65,6 @@ public: virtual void Update( float fDelta ); virtual void Input( const InputEventPlus &input ); - virtual void TweenOffScreen(); static RString s_sLastAnswer; static bool s_bCancelledLast; @@ -76,6 +75,8 @@ protected: virtual void TextEnteredDirectly() { } virtual void End( bool bCancelled ); + virtual bool GenericTweenOn() const { return true; } + virtual bool GenericTweenOff() const { return true; } private: virtual void MenuStart( const InputEventPlus &input ); @@ -101,7 +102,6 @@ public: ~ScreenTextEntryVisual(); void Init(); void BeginScreen(); - virtual void TweenOffScreen(); protected: void MoveX( int iDir );