From 95c88765a0b59d3b381077f8cd1e75cad65bf413 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Fri, 10 Feb 2006 04:33:54 +0000 Subject: [PATCH] fix options rows tween from top of screen instead of initially being in the row's position --- stepmania/src/OptionRow.cpp | 4 ++-- stepmania/src/OptionRow.h | 2 +- stepmania/src/ScreenOptions.cpp | 10 +++++----- stepmania/src/ScreenOptions.h | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/stepmania/src/OptionRow.cpp b/stepmania/src/OptionRow.cpp index 8c4b8c7063..eda5ed2416 100644 --- a/stepmania/src/OptionRow.cpp +++ b/stepmania/src/OptionRow.cpp @@ -553,12 +553,12 @@ void OptionRow::SetRowHasFocus( PlayerNumber pn, bool bRowHasFocus ) m_bRowHasFocus[pn] = bRowHasFocus; } -void OptionRow::SetDestination( Actor::TweenState &ts ) +void OptionRow::SetDestination( Actor::TweenState &ts, bool bTween ) { if( m_Frame.DestTweenState() != ts ) { m_Frame.StopTweening(); - if( m_pParentType->TWEEN_SECONDS != 0 ) + if( bTween && m_pParentType->TWEEN_SECONDS != 0 ) m_Frame.BeginTweening( m_pParentType->TWEEN_SECONDS ); m_Frame.DestTweenState() = ts; } diff --git a/stepmania/src/OptionRow.h b/stepmania/src/OptionRow.h index 1884143d6a..61a9c85ff1 100644 --- a/stepmania/src/OptionRow.h +++ b/stepmania/src/OptionRow.h @@ -223,7 +223,7 @@ protected: Actor::TweenState m_tsDestination; // this should approach m_tsDestination. public: - void SetDestination( Actor::TweenState &ts ); + void SetDestination( Actor::TweenState &ts, bool bTween ); protected: bool m_bHidden; // currently off screen }; diff --git a/stepmania/src/ScreenOptions.cpp b/stepmania/src/ScreenOptions.cpp index a747477eee..aa2c7a5286 100644 --- a/stepmania/src/ScreenOptions.cpp +++ b/stepmania/src/ScreenOptions.cpp @@ -287,7 +287,7 @@ void ScreenOptions::RestartOptions() CHECKPOINT; - PositionRows(); + PositionRows( false ); FOREACH_HumanPlayer( pn ) { // Hide the highlight if no rows are enabled. @@ -564,7 +564,7 @@ void ScreenOptions::HandleScreenMessage( const ScreenMessage SM ) } -void ScreenOptions::PositionRows() +void ScreenOptions::PositionRows( bool bTween ) { const int total = NUM_ROWS_SHOWN; const int halfsize = total / 2; @@ -656,7 +656,7 @@ void ScreenOptions::PositionRows() else if( i >= second_end ) fPos = ((int)NUM_ROWS_SHOWN)-0.5f; Actor::TweenState tsDestination = m_exprRowPositionTransformFunction.GetPosition( (float) fPos, i, min( (int)Rows.size(), (int)NUM_ROWS_SHOWN ) ); - row.SetDestination( tsDestination ); + row.SetDestination( tsDestination, bTween ); bool bHidden = i < first_start || @@ -672,7 +672,7 @@ void ScreenOptions::PositionRows() Actor::TweenState tsDestination; tsDestination.Init(); tsDestination.pos.y = SEPARATE_EXIT_ROW_Y; - pSeparateExitRow->SetDestination( tsDestination ); + pSeparateExitRow->SetDestination( tsDestination, bTween ); pSeparateExitRow->SetRowHidden( second_end != (int) Rows.size() ); } @@ -690,7 +690,7 @@ void ScreenOptions::AfterChangeValueOrRow( PlayerNumber pn ) return; /* Update m_fY and m_bHidden[]. */ - PositionRows(); + PositionRows( true ); /* Do positioning. */ for( unsigned r=0; r ROW_INIT_COMMAND; ThemeMetric ROW_ON_COMMAND; ThemeMetric ROW_OFF_COMMAND; - LuaExpressionTransform m_exprRowPositionTransformFunction; // params: self,positionIndex,itemIndex,numItems + LuaExpressionTransform m_exprRowPositionTransformFunction; // params: self,positionIndex,itemIndex,numItems ThemeMetric1D EXPLANATION_X; ThemeMetric1D EXPLANATION_Y; ThemeMetric1D EXPLANATION_ON_COMMAND;