Put everything in OptionRow inside a frame, and use the frame to tween

Y, to fix smooth scrolling.
This commit is contained in:
Glenn Maynard
2005-04-16 23:19:06 +00:00
parent e225a77763
commit f0b50dd5b9
3 changed files with 33 additions and 52 deletions
+8 -8
View File
@@ -161,11 +161,7 @@ void ScreenOptions::InitMenu( InputMode im, const vector<OptionRowDefinition> &v
CHECKPOINT_M( ssprintf("row %i: %s", r, row.GetRowDef().name.c_str()) );
unsigned pos = r;
CLAMP( pos, 0, NUM_ROWS_SHOWN-1 );
const float fY = ROW_Y.GetValue( pos );
row.AfterImportOptions( fY );
row.AfterImportOptions();
}
m_sprPage.Load( THEME->GetPathG(m_sName,"page") );
@@ -415,10 +411,14 @@ void ScreenOptions::TweenCursor( PlayerNumber pn )
GetWidthXY( pn, iRow, iChoiceWithFocus, iWidth, iX, iY );
OptionsCursor &cursor = m_Cursor[pn];
cursor.StopTweening();
cursor.BeginTweening( TWEEN_SECONDS );
if( cursor.GetDestX() != (float) iX || cursor.GetDestY() != (float) iY )
{
cursor.StopTweening();
cursor.BeginTweening( TWEEN_SECONDS );
cursor.SetXY( (float)iX, (float)iY );
}
cursor.TweenBarWidth( iWidth );
cursor.SetXY( (float)iX, (float)iY );
if( GAMESTATE->IsHumanPlayer(pn) )
{