From 66d46adfe66b0cd7b3e40263df96ad886ca33a67 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 16 Jun 2003 03:29:59 +0000 Subject: [PATCH] Implement options splitting There are several cosmetic problems with this; working on fixes ... --- stepmania/src/ScreenOptions.cpp | 158 +++++++++++++++++++++++++++----- stepmania/src/ScreenOptions.h | 5 + 2 files changed, 140 insertions(+), 23 deletions(-) diff --git a/stepmania/src/ScreenOptions.cpp b/stepmania/src/ScreenOptions.cpp index 762c1c1b4b..9972476763 100644 --- a/stepmania/src/ScreenOptions.cpp +++ b/stepmania/src/ScreenOptions.cpp @@ -40,6 +40,8 @@ const float ITEM_X[NUM_PLAYERS] = { 260, 420 }; #define COLOR_SELECTED THEME->GetMetricC("ScreenOptions","ColorSelected") #define COLOR_NOT_SELECTED THEME->GetMetricC("ScreenOptions","ColorNotSelected") +const int total = 10; +const int halfsize = total / 2; ScreenOptions::ScreenOptions( CString sClassName, bool bEnableTimer ) : Screen("ScreenOptions") { @@ -139,6 +141,7 @@ void ScreenOptions::Init( InputMode im, OptionRow OptionRow[], int iNumOptionLin InitOptionsText(); + PositionItems(); PositionUnderlines(); PositionIcons(); RefreshIcons(); @@ -162,21 +165,23 @@ void ScreenOptions::GetWidthXY( PlayerNumber pn, int iRow, int &iWidthOut, int & BitmapText &text = m_textItems[iRow][iOptionInRow]; iWidthOut = int(roundf( text.GetWidestLineWidthInSourcePixels() * text.GetZoomX() )); - iXOut = int(roundf( text.GetX() )); - iYOut = int(roundf( text.GetY() )); + iXOut = int(roundf( text.GetDestX() )); + /* We update m_fRowY, change colors and tween items, and then tween rows to + * their final positions. (This is so we don't tween colors, too.) m_fRowY + * is the actual destination position, even though we may not have set up the + * tween yet. */ + iYOut = int(roundf( m_fRowY[iRow] )); } void ScreenOptions::InitOptionsText() { - const float fLineGap = ITEMS_SPACING_Y - max(0, (m_iNumOptionRows-10)*2); - // init m_textItems from optionLines int i; for( i=0; i