From 9f0c59f6da2564d0d24a9b5e90672a6c65300d14 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 14 Oct 2005 02:04:13 +0000 Subject: [PATCH] The distinction between "screen elements" and "MenuElements" is meaningless now; screen elements are often put in overlay/underlay layers, and those are SWME parts. This used to be used to separate header/footer transitions, but there are better ways to do that. Remove OverrideSleepAfterTweenOffSeconds and SleepAfterTweenOffSeconds, and run all tweens at once, instead of one arbitrary set after another. (opens the path to other simplifications). --- stepmania/src/ScreenSelectMaster.cpp | 32 +++++----------------------- stepmania/src/ScreenSelectMaster.h | 4 +--- 2 files changed, 6 insertions(+), 30 deletions(-) diff --git a/stepmania/src/ScreenSelectMaster.cpp b/stepmania/src/ScreenSelectMaster.cpp index d82de44aff..db6af1fe92 100644 --- a/stepmania/src/ScreenSelectMaster.cpp +++ b/stepmania/src/ScreenSelectMaster.cpp @@ -35,8 +35,6 @@ ScreenSelectMaster::ScreenSelectMaster( CString sClassName ) : ScreenSelect( sCl LOCK_INPUT_SECONDS(m_sName,"LockInputSeconds"), PRE_SWITCH_PAGE_SECONDS(m_sName,"PreSwitchPageSeconds"), POST_SWITCH_PAGE_SECONDS(m_sName,"PostSwitchPageSeconds"), - OVERRIDE_SLEEP_AFTER_TWEEN_OFF_SECONDS(m_sName,"OverrideSleepAfterTweenOffSeconds"), - SLEEP_AFTER_TWEEN_OFF_SECONDS(m_sName,"SleepAfterTweenOffSeconds"), OPTION_ORDER(m_sName,OPTION_ORDER_NAME,NUM_MENU_DIRS), WRAP_CURSOR(m_sName,"WrapCursor"), WRAP_SCROLLER(m_sName,"WrapScroller"), @@ -312,32 +310,10 @@ void ScreenSelectMaster::HandleScreenMessage( const ScreenMessage SM ) } else if( SM == SM_BeginFadingOut ) { - TweenOursOffScreen(); - /* - * We start our own tween-out (TweenOursOffScreen), wait some amount of time, then - * start the base tween (ScreenWithMenuElements, called from SM_AllDoneChoosing); - * we move on when that finishes. This is a pain to tweak, especially now - * that elements essentially owned by the derived class are starting to tween - * in the ScreenWithMenuElements tween (underlay, overlay); we have to tweak the - * duration of the "out" transition to determine how long to wait after fSecs - * before moving on. - * - * Send a command to all children, so we can run overlay and underlay tweens at the - * same time as the elements controlled by TweenOursOffScreen. Run this here, so - * it affects the result of GetTweenTimeLeft(). - */ + /* Backwards compatibility (deprecated). */ this->PlayCommand( "TweenOff" ); - float fSecs = 0; - /* This can be used to allow overlap between the main tween-off and the MenuElements - * tweenoff. */ - if( OVERRIDE_SLEEP_AFTER_TWEEN_OFF_SECONDS ) - fSecs = SLEEP_AFTER_TWEEN_OFF_SECONDS; - else - fSecs = GetTweenTimeLeft(); - fSecs = max( fSecs, 0 ); - - SCREENMAN->PostMessageToTopScreen( SM_AllDoneChoosing, fSecs ); // notify parent that we're finished + SCREENMAN->PostMessageToTopScreen( SM_AllDoneChoosing, 0 ); // notify parent that we're finished } } @@ -861,8 +837,10 @@ void ScreenSelectMaster::TweenOursOnScreen() this->SortByDrawOrder(); } -void ScreenSelectMaster::TweenOursOffScreen() +void ScreenSelectMaster::TweenOffScreen() { + ScreenSelect::TweenOffScreen(); + vector vpns; if( SHARED_SELECTION ) { diff --git a/stepmania/src/ScreenSelectMaster.h b/stepmania/src/ScreenSelectMaster.h index 3281207540..1b63553e1f 100644 --- a/stepmania/src/ScreenSelectMaster.h +++ b/stepmania/src/ScreenSelectMaster.h @@ -23,7 +23,7 @@ public: virtual void MenuDown( const InputEventPlus &input ); virtual void MenuStart( PlayerNumber pn ); void TweenOursOnScreen(); - void TweenOursOffScreen(); + virtual void TweenOffScreen(); virtual void HandleScreenMessage( const ScreenMessage SM ); @@ -44,8 +44,6 @@ protected: ThemeMetric LOCK_INPUT_SECONDS; ThemeMetric PRE_SWITCH_PAGE_SECONDS; ThemeMetric POST_SWITCH_PAGE_SECONDS; - ThemeMetric OVERRIDE_SLEEP_AFTER_TWEEN_OFF_SECONDS; - ThemeMetric SLEEP_AFTER_TWEEN_OFF_SECONDS; ThemeMetric1D OPTION_ORDER; ThemeMetric WRAP_CURSOR; ThemeMetric WRAP_SCROLLER;