diff --git a/stepmania/src/Makefile.am b/stepmania/src/Makefile.am index 4212e21bcf..1fc1bffbd1 100644 --- a/stepmania/src/Makefile.am +++ b/stepmania/src/Makefile.am @@ -199,7 +199,8 @@ ActorsInMenus = \ ActiveAttackList.cpp ActiveAttackList.h BPMDisplay.cpp BPMDisplay.h ComboGraph.cpp ComboGraph.h \ CourseContentsList.cpp CourseContentsList.h CourseEntryDisplay.cpp CourseEntryDisplay.h \ DifficultyDisplay.cpp DifficultyDisplay.h DifficultyList.cpp DifficultyList.h \ -DifficultyMeter.cpp DifficultyMeter.h DifficultyRating.cpp DifficultyRating.h DualScrollBar.cpp DualScrollBar.h \ +DifficultyMeter.cpp DifficultyMeter.h DifficultyRating.cpp DifficultyRating.h \ +DualScrollBar.cpp DualScrollBar.h \ EditCoursesMenu.cpp EditCoursesMenu.h EditMenu.cpp EditMenu.h FadingBanner.cpp FadingBanner.h \ GradeDisplay.cpp GradeDisplay.h GraphDisplay.cpp GraphDisplay.h GrooveGraph.cpp GrooveGraph.h \ GrooveRadar.cpp GrooveRadar.h GroupList.cpp GroupList.h HelpDisplay.cpp HelpDisplay.h \ @@ -207,7 +208,8 @@ ListDisplay.cpp ListDisplay.h MemoryCardDisplay.cpp MemoryCardDisplay.h \ MenuTimer.cpp MenuTimer.h ModeSwitcher.cpp ModeSwitcher.h MusicBannerWheel.cpp MusicBannerWheel.h \ MusicList.cpp MusicList.h MusicSortDisplay.cpp MusicSortDisplay.h MusicWheel.cpp MusicWheel.h \ MusicWheelItem.cpp MusicWheelItem.h OptionIcon.cpp OptionIcon.h OptionIconRow.cpp OptionIconRow.h \ -OptionsCursor.cpp OptionsCursor.h PaneDisplay.cpp PaneDisplay.h ScrollBar.cpp ScrollBar.h \ +OptionRow.cpp OptionRow.h OptionsCursor.cpp OptionsCursor.h \ +PaneDisplay.cpp PaneDisplay.h ScrollBar.cpp ScrollBar.h \ ScrollingList.cpp ScrollingList.h SnapDisplay.cpp SnapDisplay.h \ TextBanner.cpp TextBanner.h WheelNotifyIcon.cpp WheelNotifyIcon.h diff --git a/stepmania/src/OptionRow.cpp b/stepmania/src/OptionRow.cpp new file mode 100644 index 0000000000..3d7090a40d --- /dev/null +++ b/stepmania/src/OptionRow.cpp @@ -0,0 +1,41 @@ +#include "global.h" +#include "OptionRow.h" +#include "RageUtil.h" + +OptionRow::OptionRow() +{ +} + +OptionRow::~OptionRow() +{ + for( unsigned i = 0; i < m_textItems.size(); ++i ) + SAFE_DELETE( m_textItems[i] ); + FOREACH_PlayerNumber( p ) + for( unsigned i = 0; i < m_Underline[p].size(); ++i ) + SAFE_DELETE( m_Underline[p][i] ); +} + +/* + * (c) 2001-2004 Chris Danford + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, and/or sell copies of the Software, and to permit persons to + * whom the Software is furnished to do so, provided that the above + * copyright notice(s) and this permission notice appear in all copies of + * the Software and that both the above copyright notice(s) and this + * permission notice appear in supporting documentation. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF + * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS + * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT + * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ diff --git a/stepmania/src/OptionRow.h b/stepmania/src/OptionRow.h new file mode 100644 index 0000000000..55d4c32c33 --- /dev/null +++ b/stepmania/src/OptionRow.h @@ -0,0 +1,100 @@ +/* OptionRow - One line in ScreenOptions. */ + +#ifndef OptionRow_H +#define OptionRow_H + +#include "ActorFrame.h" +#include "BitmapText.h" +#include "OptionsCursor.h" +#include "OptionIcon.h" + +struct OptionRowDefinition +{ + CString name; + bool bOneChoiceForAllPlayers; + enum SelectType { SELECT_ONE, SELECT_MULTIPLE, SELECT_NONE } selectType; + enum LayoutType { SHOW_ALL_IN_LINE, SHOW_ONE_IN_LINE } layoutType; + vector choices; + + OptionRowDefinition(): name(""), bOneChoiceForAllPlayers(false), selectType(SELECT_ONE), layoutType(SHOW_ALL_IN_LINE) { } + + OptionRowDefinition( const char *n, bool b, const char *c0=NULL, const char *c1=NULL, const char *c2=NULL, const char *c3=NULL, const char *c4=NULL, const char *c5=NULL, const char *c6=NULL, const char *c7=NULL, const char *c8=NULL, const char *c9=NULL, const char *c10=NULL, const char *c11=NULL, const char *c12=NULL, const char *c13=NULL, const char *c14=NULL, const char *c15=NULL, const char *c16=NULL, const char *c17=NULL, const char *c18=NULL, const char *c19=NULL ) : + name(n), bOneChoiceForAllPlayers(b), selectType(SELECT_ONE), layoutType(SHOW_ALL_IN_LINE) + { +#define PUSH( c ) if(c) choices.push_back(c); + PUSH(c0);PUSH(c1);PUSH(c2);PUSH(c3);PUSH(c4);PUSH(c5);PUSH(c6);PUSH(c7);PUSH(c8);PUSH(c9);PUSH(c10);PUSH(c11);PUSH(c12);PUSH(c13);PUSH(c14);PUSH(c15);PUSH(c16);PUSH(c17);PUSH(c18);PUSH(c19); +#undef PUSH + } +}; + +class OptionRow : public ActorFrame +{ +public: + OptionRow(); + ~OptionRow(); + OptionRowDefinition m_RowDef; + enum { ROW_NORMAL, ROW_EXIT } Type; + vector m_textItems; // size depends on m_bRowIsLong and which players are joined + vector m_Underline[NUM_PLAYERS]; // size depends on m_bRowIsLong and which players are joined + Sprite m_sprBullet; + BitmapText m_textTitle; + OptionIcon m_OptionIcons[NUM_PLAYERS]; + + float m_fY; + bool m_bHidden; // currently off screen + + int m_iChoiceInRowWithFocus[NUM_PLAYERS]; // this choice has input focus + + // Only one will true at a time if m_RowDef.bMultiSelect + vector m_vbSelected[NUM_PLAYERS]; // size = m_RowDef.choices.size(). + int GetOneSelection( PlayerNumber pn ) const + { + for( unsigned i=0; i<(unsigned)m_vbSelected[pn].size(); i++ ) + if( m_vbSelected[pn][i] ) + return i; + ASSERT(0); // shouldn't call this if not expecting one to be selected + return -1; + } + int GetOneSharedSelection() const + { + return GetOneSelection( (PlayerNumber)0 ); + } + void SetOneSelection( PlayerNumber pn, int iChoice ) + { + for( unsigned i=0; i<(unsigned)m_vbSelected[pn].size(); i++ ) + m_vbSelected[pn][i] = false; + m_vbSelected[pn][iChoice] = true; + } + void SetOneSharedSelection( int iChoice ) + { + FOREACH_HumanPlayer( pn ) + SetOneSelection( pn, iChoice ); + } +}; + +#endif + +/* + * (c) 2001-2004 Chris Danford + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, and/or sell copies of the Software, and to permit persons to + * whom the Software is furnished to do so, provided that the above + * copyright notice(s) and this permission notice appear in all copies of + * the Software and that both the above copyright notice(s) and this + * permission notice appear in supporting documentation. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF + * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS + * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT + * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ diff --git a/stepmania/src/ScreenNetworkOptions.cpp b/stepmania/src/ScreenNetworkOptions.cpp index 802e1f05a7..f7adc21fb3 100644 --- a/stepmania/src/ScreenNetworkOptions.cpp +++ b/stepmania/src/ScreenNetworkOptions.cpp @@ -24,9 +24,9 @@ enum { NO_START_SERVER }; -OptionRowData g_NetworkOptionsLines[NUM_NETWORK_OPTIONS_LINES] = { - OptionRowData( "Connection", true, "PRESS START" ), - OptionRowData( "Server", true, "PRESS START" ) +OptionRowDefinition g_NetworkOptionsLines[NUM_NETWORK_OPTIONS_LINES] = { + OptionRowDefinition( "Connection", true, "PRESS START" ), + OptionRowDefinition( "Server", true, "PRESS START" ) }; const ScreenMessage SM_DoneConnecting = ScreenMessage(SM_User+1); diff --git a/stepmania/src/ScreenOptions.cpp b/stepmania/src/ScreenOptions.cpp index 967987b73e..ebf48d5919 100644 --- a/stepmania/src/ScreenOptions.cpp +++ b/stepmania/src/ScreenOptions.cpp @@ -15,6 +15,8 @@ #include "Style.h" #include "ScreenDimensions.h" #include "Command.h" +#include "FontManager.h" +#include "Font.h" /* @@ -138,7 +140,7 @@ void ScreenOptions::LoadOptionIcon( PlayerNumber pn, int iRow, CString sText ) m_Rows[iRow]->m_OptionIcons[pn].Load( pn, sText, false ); } -void ScreenOptions::InitMenu( InputMode im, OptionRowData OptionRows[], int iNumOptionLines, bool bShowUnderlines ) +void ScreenOptions::InitMenu( InputMode im, OptionRowDefinition defs[], int iNumOptionLines, bool bShowUnderlines ) { LOG->Trace( "ScreenOptions::Set()" ); @@ -148,14 +150,14 @@ void ScreenOptions::InitMenu( InputMode im, OptionRowData OptionRows[], int iNum for( int r=0; rLoadFont( THEME->GetPathF(m_sName,"item") ); + + // init m_textItems from optionLines for( unsigned r=0; r & textItems = row.m_textItems; - const OptionRowData &optline = m_Rows[r]->m_RowDef; + const OptionRowDefinition &optline = m_Rows[r]->m_RowDef; m_framePage.AddChild( &row.m_sprBullet ); m_framePage.AddChild( &row.m_textTitle ); - float fX = ITEMS_START_X; // indent 70 pixels - for( unsigned c=0; cLoadFromFont( THEME->GetPathF(m_sName,"item") ); - CString sText = optline.choices[c]; - if( CAPITALIZE_ALL_OPTION_NAMES ) - sText.MakeUpper(); - bt->SetText( sText ); - bt->SetZoom( ITEMS_ZOOM ); - bt->SetShadowLength( 0 ); - - // set the X position of each item in the line - float fItemWidth = bt->GetZoomedWidth(); - fX += fItemWidth/2; - bt->SetX( fX ); - - // init underlines - FOREACH_HumanPlayer( p ) + float fX = ITEMS_START_X; + + for( unsigned c=0; cLoad( p, true ); - ul->SetX( fX ); - ul->SetWidth( truncf(fItemWidth) ); - } + CString sText = optline.choices[c]; + if( CAPITALIZE_ALL_OPTION_NAMES ) + sText.MakeUpper(); + fX += ITEMS_ZOOM * pFont->GetLineWidthInSourcePixels( CStringToWstring(sText) ); - fX += fItemWidth/2 + ITEMS_GAP_X; - - // It goes off the edge of the screen. Re-init with the "long row" style. - if( fX > ITEMS_END_X ) - { - row.m_bRowIsLong = true; - for( unsigned j=0; j ITEMS_END_X ) { - for( unsigned j=0; jSetX( float(iX) ); ul->SetWidth( float(iWidth) ); } + break; + + case OptionRowDefinition::SHOW_ALL_IN_LINE: + { + float fX = ITEMS_START_X; + for( unsigned c=0; cLoadFromFont( THEME->GetPathF(m_sName,"item") ); + CString sText = optline.choices[c]; + if( CAPITALIZE_ALL_OPTION_NAMES ) + sText.MakeUpper(); + bt->SetText( sText ); + bt->SetZoom( ITEMS_ZOOM ); + bt->SetShadowLength( 0 ); + + // set the X position of each item in the line + float fItemWidth = bt->GetZoomedWidth(); + fX += fItemWidth/2; + bt->SetX( fX ); + + // init underlines + FOREACH_HumanPlayer( p ) + { + OptionsCursor *ul = new OptionsCursor; + row.m_Underline[p].push_back( ul ); + ul->Load( p, true ); + ul->SetX( fX ); + ul->SetWidth( truncf(fItemWidth) ); + } + + fX += fItemWidth/2 + ITEMS_GAP_X; + } + } + break; + + default: + ASSERT(0); } // Add children here and not above because of the logic that starts @@ -362,10 +381,14 @@ void ScreenOptions::InitMenu( InputMode im, OptionRowData OptionRows[], int iNum } } + FONT->UnloadFont( pFont ); + pFont = NULL; + + // TRICKY: Add one more item. This will be "EXIT" - m_Rows.push_back( new Row() ); - Row &row = *m_Rows.back(); - row.Type = Row::ROW_EXIT; + m_Rows.push_back( new OptionRow() ); + OptionRow &row = *m_Rows.back(); + row.Type = OptionRow::ROW_EXIT; BitmapText *bt = new BitmapText; row.m_textItems.push_back( bt ); @@ -472,7 +495,7 @@ void ScreenOptions::InitMenu( InputMode im, OptionRowData OptionRows[], int iNum * easiest to queue the tweens and then force them to finish. */ for( int r=0; r<(int) m_Rows.size(); r++ ) // foreach options line { - Row &row = *m_Rows[r]; + OptionRow &row = *m_Rows[r]; row.m_sprBullet.FinishTweening(); row.m_textTitle.FinishTweening(); @@ -500,7 +523,7 @@ ScreenOptions::~ScreenOptions() CString ScreenOptions::GetExplanationText( int iRow ) const { - if( m_Rows[iRow]->Type == Row::ROW_EXIT ) + if( m_Rows[iRow]->Type == OptionRow::ROW_EXIT ) return ""; CString sLineName = m_Rows[iRow]->m_RowDef.name; @@ -512,7 +535,7 @@ CString ScreenOptions::GetExplanationText( int iRow ) const CString ScreenOptions::GetExplanationTitle( int iRow ) const { - if( m_Rows[iRow]->Type == Row::ROW_EXIT ) + if( m_Rows[iRow]->Type == OptionRow::ROW_EXIT ) return ""; CString sLineName = m_Rows[iRow]->m_RowDef.name; @@ -556,22 +579,25 @@ CString ScreenOptions::GetExplanationTitle( int iRow ) const BitmapText &ScreenOptions::GetTextItemForRow( PlayerNumber pn, int iRow, int iChoiceOnRow ) { ASSERT_M( iRow < (int)m_Rows.size(), ssprintf("%i < %i", iRow, (int)m_Rows.size() ) ); - Row &row = *m_Rows[iRow]; - if( row.Type == Row::ROW_EXIT ) + OptionRow &row = *m_Rows[iRow]; + if( row.Type == OptionRow::ROW_EXIT ) return *row.m_textItems[0]; bool bOneChoice = row.m_RowDef.bOneChoiceForAllPlayers; int index = -1; - if( row.m_bRowIsLong ) + switch( row.m_RowDef.layoutType ) { + case OptionRowDefinition::SHOW_ONE_IN_LINE: index = bOneChoice ? 0 : pn; /* If only P2 is enabled, his selections will be in index 0. */ if( row.m_textItems.size() == 1 ) index = 0; - } - else - { + break; + case OptionRowDefinition::SHOW_ALL_IN_LINE: index = iChoiceOnRow; + break; + default: + ASSERT(0); } ASSERT_M( index < (int)row.m_textItems.size(), ssprintf("%i < %i", index, (int)row.m_textItems.size() ) ); @@ -595,8 +621,8 @@ void ScreenOptions::InitOptionsText() { for( unsigned i=0; i &vpUnderlines = row.m_Underline[p]; - const int iNumUnderlines = row.m_bRowIsLong ? 1 : vpUnderlines.size(); + const int iNumUnderlines = (row.m_RowDef.layoutType == OptionRowDefinition::SHOW_ONE_IN_LINE) ? 1 : vpUnderlines.size(); for( int i=0; iIsHumanPlayer(pn) ) { COMMAND( m_sprLineHighlight[pn], "Change" ); - if( m_Rows[iRow]->Type == Row::ROW_EXIT ) + if( m_Rows[iRow]->Type == OptionRow::ROW_EXIT ) COMMAND( m_sprLineHighlight[pn], "ChangeToExit" ); m_sprLineHighlight[pn].SetY( (float)iY ); } @@ -772,10 +798,10 @@ void ScreenOptions::TweenCursor( PlayerNumber pn ) * Update the whole row. */ void ScreenOptions::UpdateText( int iRow ) { - Row &row = *m_Rows[iRow]; - const OptionRowData &data = row.m_RowDef; + OptionRow &row = *m_Rows[iRow]; + const OptionRowDefinition &data = row.m_RowDef; - if( !row.m_bRowIsLong ) + if( !row.m_RowDef.layoutType == OptionRowDefinition::SHOW_ONE_IN_LINE ) return; FOREACH_HumanPlayer( pn ) @@ -797,7 +823,7 @@ void ScreenOptions::UpdateEnabledDisabled() // init text for( unsigned i=0; iIsHumanPlayer(PLAYER_1)? m_iCurrentRow[PLAYER_1]: m_iCurrentRow[PLAYER_2]; int P2Choice = GAMESTATE->IsHumanPlayer(PLAYER_2)? m_iCurrentRow[PLAYER_2]: m_iCurrentRow[PLAYER_1]; - vector Rows( m_Rows ); - Row *ExitRow = NULL; + vector Rows( m_Rows ); + OptionRow *ExitRow = NULL; - if( (bool)SEPARATE_EXIT_ROW && Rows.back()->Type == Row::ROW_EXIT ) + if( (bool)SEPARATE_EXIT_ROW && Rows.back()->Type == OptionRow::ROW_EXIT ) { ExitRow = &*Rows.back(); @@ -1018,7 +1044,7 @@ void ScreenOptions::PositionItems() else ItemPosition = (float) total - 0.5f; - Row &row = *Rows[i]; + OptionRow &row = *Rows[i]; float fY = ITEMS_START_Y + ITEMS_SPACING_Y*ItemPosition; row.m_fY = fY; @@ -1059,7 +1085,7 @@ void ScreenOptions::OnChange( PlayerNumber pn ) /* If the last row is EXIT, and is hidden, then show MORE. */ - const bool ShowMore = m_Rows.back()->Type == Row::ROW_EXIT && m_Rows.back()->m_bHidden; + const bool ShowMore = m_Rows.back()->Type == OptionRow::ROW_EXIT && m_Rows.back()->m_bHidden; if( m_bMoreShown != ShowMore ) { m_bMoreShown = ShowMore; @@ -1072,7 +1098,7 @@ void ScreenOptions::OnChange( PlayerNumber pn ) if( GAMESTATE->IsHumanPlayer(p) ) TweenCursor( p ); - const bool ExitSelected = m_Rows[m_iCurrentRow[pn]]->Type == Row::ROW_EXIT; + const bool ExitSelected = m_Rows[m_iCurrentRow[pn]]->Type == OptionRow::ROW_EXIT; if( p == pn || GAMESTATE->GetNumHumanPlayers() == 1 ) { if( m_bWasOnExit[p] != ExitSelected ) @@ -1126,28 +1152,28 @@ void ScreenOptions::StartGoToNextScreen() bool ScreenOptions::AllAreOnExit() const { FOREACH_PlayerNumber( p ) - if( GAMESTATE->IsHumanPlayer(p) && m_Rows[m_iCurrentRow[p]]->Type != Row::ROW_EXIT ) + if( GAMESTATE->IsHumanPlayer(p) && m_Rows[m_iCurrentRow[p]]->Type != OptionRow::ROW_EXIT ) return false; return true; } -void ScreenOptions::MenuStart( PlayerNumber pn, const InputEventType type ) +void ScreenOptions::MenuStart( PlayerNumber pn, const InputEventType selectType ) { - switch( type ) + switch( selectType ) { case IET_FIRST_PRESS: m_bGotAtLeastOneStartPressed[pn] = true; break; case IET_RELEASE: return; // ignore - default: // repeat type + default: // repeat selectType if( !m_bGotAtLeastOneStartPressed[pn] ) return; // don't allow repeat break; } - Row &row = *m_Rows[m_iCurrentRow[pn]]; - OptionRowData &data = row.m_RowDef; + OptionRow &row = *m_Rows[m_iCurrentRow[pn]]; + OptionRowDefinition &data = row.m_RowDef; /* If we are in a three-button mode, check to see if MENU_BUTTON_LEFT and @@ -1162,7 +1188,7 @@ void ScreenOptions::MenuStart( PlayerNumber pn, const InputEventType type ) INPUTMAPPER->IsButtonDown( MenuInput(pn, MENU_BUTTON_LEFT) ); if( bHoldingLeftAndRight ) { - MoveRow( pn, -1, type != IET_FIRST_PRESS ); + MoveRow( pn, -1, selectType != IET_FIRST_PRESS ); return; } } @@ -1170,10 +1196,10 @@ void ScreenOptions::MenuStart( PlayerNumber pn, const InputEventType type ) // If on exit, check it all players are on "Exit" - if( row.Type == Row::ROW_EXIT ) + if( row.Type == OptionRow::ROW_EXIT ) { /* Don't accept START to go to the next screen if we're still transitioning in. */ - if( AllAreOnExit() && type == IET_FIRST_PRESS && !IsTransitioning() ) + if( AllAreOnExit() && selectType == IET_FIRST_PRESS && !IsTransitioning() ) StartGoToNextScreen(); return; } @@ -1184,13 +1210,13 @@ void ScreenOptions::MenuStart( PlayerNumber pn, const InputEventType type ) int iChoiceInRow = row.m_iChoiceInRowWithFocus[pn]; if( iChoiceInRow == 0 ) { - MenuDown( pn, type ); + MenuDown( pn, selectType ); return; } } // If this is a bFirstChoiceGoesDown, then if this is a multiselect row. - if( data.type == OptionRowData::SELECT_MULTIPLE ) + if( data.selectType == OptionRowDefinition::SELECT_MULTIPLE ) { int iChoiceInRow = row.m_iChoiceInRowWithFocus[pn]; row.m_vbSelected[pn][iChoiceInRow] = !row.m_vbSelected[pn][iChoiceInRow]; @@ -1204,19 +1230,19 @@ void ScreenOptions::MenuStart( PlayerNumber pn, const InputEventType type ) if( m_OptionsNavigation == NAV_TOGGLE_THREE_KEY ) { // move to the first choice in the row - ChangeValueInRow( pn, -row.m_iChoiceInRowWithFocus[pn], type != IET_FIRST_PRESS ); + ChangeValueInRow( pn, -row.m_iChoiceInRowWithFocus[pn], selectType != IET_FIRST_PRESS ); } } - else // data.type != SELECT_MULTIPLE + else // data.selectType != SELECT_MULTIPLE { switch( m_OptionsNavigation ) { case NAV_THREE_KEY: - MenuDown( pn, type ); + MenuDown( pn, selectType ); break; case NAV_TOGGLE_THREE_KEY: case NAV_TOGGLE_FIVE_KEY: - if( data.type != OptionRowData::SELECT_MULTIPLE ) + if( data.selectType != OptionRowDefinition::SELECT_MULTIPLE ) { int iChoiceInRow = row.m_iChoiceInRowWithFocus[pn]; if( row.m_RowDef.bOneChoiceForAllPlayers ) @@ -1225,19 +1251,19 @@ void ScreenOptions::MenuStart( PlayerNumber pn, const InputEventType type ) row.SetOneSelection( pn, iChoiceInRow ); } if( m_OptionsNavigation == NAV_TOGGLE_THREE_KEY ) - ChangeValueInRow( pn, -row.m_iChoiceInRowWithFocus[pn], type != IET_FIRST_PRESS ); // move to the first choice + ChangeValueInRow( pn, -row.m_iChoiceInRowWithFocus[pn], selectType != IET_FIRST_PRESS ); // move to the first choice else - ChangeValueInRow( pn, 0, type != IET_FIRST_PRESS ); + ChangeValueInRow( pn, 0, selectType != IET_FIRST_PRESS ); break; case NAV_THREE_KEY_MENU: /* Don't accept START to go to the next screen if we're still transitioning in. */ - if( type == IET_FIRST_PRESS && !IsTransitioning() ) + if( selectType == IET_FIRST_PRESS && !IsTransitioning() ) StartGoToNextScreen(); break; case NAV_FIVE_KEY: /* Jump to the exit row. (If everyone's already on the exit row, then * we'll have already gone to the next screen above.) */ - MoveRow( pn, m_Rows.size()-m_iCurrentRow[pn]-1, type != IET_FIRST_PRESS ); + MoveRow( pn, m_Rows.size()-m_iCurrentRow[pn]-1, selectType != IET_FIRST_PRESS ); break; } } @@ -1246,8 +1272,8 @@ void ScreenOptions::MenuStart( PlayerNumber pn, const InputEventType type ) void ScreenOptions::StoreFocus( PlayerNumber pn ) { /* Long rows always put us in the center, so don't update the focus. */ - const Row &Row = *m_Rows[m_iCurrentRow[pn]]; - if( Row.m_bRowIsLong ) + const OptionRow &OptionRow = *m_Rows[m_iCurrentRow[pn]]; + if( OptionRow.m_RowDef.layoutType == OptionRowDefinition::SHOW_ONE_IN_LINE ) return; int iWidth, iY; @@ -1260,10 +1286,10 @@ void ScreenOptions::StoreFocus( PlayerNumber pn ) void ScreenOptions::ChangeValueInRow( PlayerNumber pn, int iDelta, bool Repeat ) { const int iCurRow = m_iCurrentRow[pn]; - Row &row = *m_Rows[iCurRow]; - OptionRowData &optrow = m_Rows[iCurRow]->m_RowDef; + OptionRow &row = *m_Rows[iCurRow]; + OptionRowDefinition &optrow = m_Rows[iCurRow]->m_RowDef; - const int iNumOptions = (row.Type == Row::ROW_EXIT)? 1: optrow.choices.size(); + const int iNumOptions = (row.Type == OptionRow::ROW_EXIT)? 1: optrow.choices.size(); if( m_OptionsNavigation == NAV_THREE_KEY_MENU && iNumOptions <= 1 ) // 1 or 0 { /* There are no other options on the row; move up or down instead of left and right. @@ -1278,7 +1304,7 @@ void ScreenOptions::ChangeValueInRow( PlayerNumber pn, int iDelta, bool Repeat ) if( Repeat ) return; - if( row.Type == Row::ROW_EXIT ) // EXIT is selected + if( row.Type == OptionRow::ROW_EXIT ) // EXIT is selected return; // don't allow a move bool bOneChanged = false; @@ -1327,7 +1353,7 @@ void ScreenOptions::ChangeValueInRow( PlayerNumber pn, int iDelta, bool Repeat ) } else { - if( optrow.type == OptionRowData::SELECT_MULTIPLE ) + if( optrow.selectType == OptionRowDefinition::SELECT_MULTIPLE ) ; // do nothing. User must press Start to toggle the selection. else row.SetOneSelection( p, iNewChoiceWithFocus ); @@ -1342,7 +1368,7 @@ void ScreenOptions::ChangeValueInRow( PlayerNumber pn, int iDelta, bool Repeat ) } else { - if( optrow.type == OptionRowData::SELECT_MULTIPLE ) + if( optrow.selectType == OptionRowDefinition::SELECT_MULTIPLE ) ; // do nothing. User must press Start to toggle the selection. else row.SetOneSelection( pn, iNewChoiceWithFocus ); @@ -1366,7 +1392,7 @@ void ScreenOptions::MoveRow( PlayerNumber pn, int dir, bool Repeat ) // If moving from a bFirstChoiceGoesDown row, put focus back on // the first choice before moving. const int iCurrentRow = m_iCurrentRow[pn]; - Row &row = *m_Rows[iCurrentRow]; + OptionRow &row = *m_Rows[iCurrentRow]; row.m_iChoiceInRowWithFocus[pn] = 0; } @@ -1391,7 +1417,7 @@ void ScreenOptions::MoveRow( PlayerNumber pn, int dir, bool Repeat ) { case NAV_TOGGLE_THREE_KEY: case NAV_TOGGLE_FIVE_KEY: - if( !m_Rows[row]->m_bRowIsLong ) + if( m_Rows[row]->m_RowDef.layoutType != OptionRowDefinition::SHOW_ONE_IN_LINE ) { int iSelectionDist = -1; for( unsigned i = 0; i < m_Rows[row]->m_textItems.size(); ++i ) @@ -1424,25 +1450,11 @@ void ScreenOptions::MoveRow( PlayerNumber pn, int dir, bool Repeat ) int ScreenOptions::GetCurrentRow( PlayerNumber pn ) const { const int l = m_iCurrentRow[pn]; - if( m_Rows[l]->Type != Row::ROW_NORMAL ) + if( m_Rows[l]->Type != OptionRow::ROW_NORMAL ) return -1; return l; } -ScreenOptions::Row::Row() -{ - m_bRowIsLong = false; -} - -ScreenOptions::Row::~Row() -{ - for( unsigned i = 0; i < m_textItems.size(); ++i ) - SAFE_DELETE( m_textItems[i] ); - FOREACH_PlayerNumber( p ) - for( unsigned i = 0; i < m_Underline[p].size(); ++i ) - SAFE_DELETE( m_Underline[p][i] ); -} - /* * (c) 2001-2004 Chris Danford, Glenn Maynard * All rights reserved. diff --git a/stepmania/src/ScreenOptions.h b/stepmania/src/ScreenOptions.h index a0693cc141..a4ce000b73 100644 --- a/stepmania/src/ScreenOptions.h +++ b/stepmania/src/ScreenOptions.h @@ -5,33 +5,12 @@ #include "ScreenWithMenuElements.h" #include "Sprite.h" -#include "BitmapText.h" #include "RandomSample.h" -#include "Quad.h" -#include "OptionsCursor.h" -#include "OptionIcon.h" #include "DualScrollBar.h" #include "ThemeMetric.h" +#include "OptionRow.h" -struct OptionRowData -{ - CString name; - bool bOneChoiceForAllPlayers; - enum Type { SELECT_ONE, SELECT_MULTIPLE, SELECT_NONE } type; - vector choices; - - OptionRowData(): name(""), bOneChoiceForAllPlayers(false), type(SELECT_ONE) { } - - OptionRowData( const char *n, bool b, const char *c0=NULL, const char *c1=NULL, const char *c2=NULL, const char *c3=NULL, const char *c4=NULL, const char *c5=NULL, const char *c6=NULL, const char *c7=NULL, const char *c8=NULL, const char *c9=NULL, const char *c10=NULL, const char *c11=NULL, const char *c12=NULL, const char *c13=NULL, const char *c14=NULL, const char *c15=NULL, const char *c16=NULL, const char *c17=NULL, const char *c18=NULL, const char *c19=NULL ) : - name(n), bOneChoiceForAllPlayers(b), type(SELECT_ONE) - { -#define PUSH( c ) if(c) choices.push_back(c); - PUSH(c0);PUSH(c1);PUSH(c2);PUSH(c3);PUSH(c4);PUSH(c5);PUSH(c6);PUSH(c7);PUSH(c8);PUSH(c9);PUSH(c10);PUSH(c11);PUSH(c12);PUSH(c13);PUSH(c14);PUSH(c15);PUSH(c16);PUSH(c17);PUSH(c18);PUSH(c19); -#undef PUSH - } -}; - enum InputMode { INPUTMODE_INDIVIDUAL, // each player controls their own cursor @@ -43,7 +22,7 @@ class ScreenOptions : public ScreenWithMenuElements { public: ScreenOptions( CString sClassName ); - void InitMenu( InputMode im, OptionRowData OptionRowData[], int iNumOptionLines, bool bShowUnderlines = true ); + void InitMenu( InputMode im, OptionRowDefinition defs[], int iNumOptionLines, bool bShowUnderlines = true ); virtual ~ScreenOptions(); virtual void Update( float fDeltaTime ); virtual void DrawPrimitives(); @@ -83,7 +62,7 @@ protected: void MenuDown( PlayerNumber pn, const InputEventType type ) { MoveRow( pn, +1, type != IET_FIRST_PRESS ); } void MoveRow( PlayerNumber pn, int dir, bool Repeat ); - /* Returns -1 if on a row with no OptionRowData (eg. EXIT). */ + /* Returns -1 if on a row with no OptionRowDefinition (eg. EXIT). */ int GetCurrentRow(PlayerNumber pn = PLAYER_1) const; bool AllAreOnExit() const; @@ -94,51 +73,7 @@ protected: // derived classes need access to these protected: /* Map menu lines to m_OptionRow entries. */ - struct Row - { - Row(); - ~Row(); - OptionRowData m_RowDef; - enum { ROW_NORMAL, ROW_EXIT } Type; - vector m_textItems; // size depends on m_bRowIsLong and which players are joined - vector m_Underline[NUM_PLAYERS]; // size depends on m_bRowIsLong and which players are joined - Sprite m_sprBullet; - BitmapText m_textTitle; - OptionIcon m_OptionIcons[NUM_PLAYERS]; - - float m_fY; - bool m_bRowIsLong; // goes off edge of screen - bool m_bHidden; // currently off screen - - int m_iChoiceInRowWithFocus[NUM_PLAYERS]; // this choice has input focus - - // Only one will true at a time if m_RowDef.bMultiSelect - vector m_vbSelected[NUM_PLAYERS]; // size = m_RowDef.choices.size(). - int GetOneSelection( PlayerNumber pn ) const - { - for( unsigned i=0; i<(unsigned)m_vbSelected[pn].size(); i++ ) - if( m_vbSelected[pn][i] ) - return i; - ASSERT(0); // shouldn't call this if not expecting one to be selected - return -1; - } - int GetOneSharedSelection() const - { - return GetOneSelection( (PlayerNumber)0 ); - } - void SetOneSelection( PlayerNumber pn, int iChoice ) - { - for( unsigned i=0; i<(unsigned)m_vbSelected[pn].size(); i++ ) - m_vbSelected[pn][i] = false; - m_vbSelected[pn][iChoice] = true; - } - void SetOneSharedSelection( int iChoice ) - { - FOREACH_HumanPlayer( pn ) - SetOneSelection( pn, iChoice ); - } - }; - vector m_Rows; + vector m_Rows; Navigation m_OptionsNavigation; diff --git a/stepmania/src/ScreenOptionsMaster.cpp b/stepmania/src/ScreenOptionsMaster.cpp index a53ed17d33..a4c346643b 100644 --- a/stepmania/src/ScreenOptionsMaster.cpp +++ b/stepmania/src/ScreenOptionsMaster.cpp @@ -37,7 +37,7 @@ #define PREV_SCREEN THEME->GetMetric (m_sName,"PrevScreen") /* Add the list named "ListName" to the given row/handler. */ -void ScreenOptionsMaster::SetList( OptionRowData &row, OptionRowHandler &hand, CString ListName ) +void ScreenOptionsMaster::SetList( OptionRowDefinition &row, OptionRowHandler &hand, CString ListName ) { hand.type = ROW_LIST; hand.m_bUseModNameForIcon = true; @@ -77,9 +77,9 @@ void ScreenOptionsMaster::SetList( OptionRowData &row, OptionRowHandler &hand, C if( asParts[i].CompareNoCase("together") == 0 ) row.bOneChoiceForAllPlayers = true; else if( asParts[i].CompareNoCase("SelectMultiple") == 0 ) - row.type = OptionRowData::SELECT_MULTIPLE; + row.selectType = OptionRowDefinition::SELECT_MULTIPLE; else if( asParts[i].CompareNoCase("SelectNone") == 0 ) - row.type = OptionRowData::SELECT_NONE; + row.selectType = OptionRowDefinition::SELECT_NONE; } for( int col = 0; col < NumCols; ++col ) @@ -101,7 +101,7 @@ void ScreenOptionsMaster::SetList( OptionRowData &row, OptionRowHandler &hand, C } /* Add a list of difficulties/edits to the given row/handler. */ -void ScreenOptionsMaster::SetSteps( OptionRowData &row, OptionRowHandler &hand ) +void ScreenOptionsMaster::SetSteps( OptionRowDefinition &row, OptionRowHandler &hand ) { hand.type = ROW_LIST; row.name = "Steps"; @@ -157,7 +157,7 @@ void ScreenOptionsMaster::SetSteps( OptionRowData &row, OptionRowHandler &hand ) /* Add the given configuration value to the given row/handler. */ -void ScreenOptionsMaster::SetConf( OptionRowData &row, OptionRowHandler &hand, CString param ) +void ScreenOptionsMaster::SetConf( OptionRowDefinition &row, OptionRowHandler &hand, CString param ) { /* Configuration values are never per-player. */ row.bOneChoiceForAllPlayers = true; @@ -176,7 +176,7 @@ void ScreenOptionsMaster::SetConf( OptionRowData &row, OptionRowHandler &hand, C } /* Add a list of available characters to the given row/handler. */ -void ScreenOptionsMaster::SetCharacters( OptionRowData &row, OptionRowHandler &hand ) +void ScreenOptionsMaster::SetCharacters( OptionRowDefinition &row, OptionRowHandler &hand ) { hand.type = ROW_LIST; row.bOneChoiceForAllPlayers = false; @@ -206,7 +206,7 @@ void ScreenOptionsMaster::SetCharacters( OptionRowData &row, OptionRowHandler &h } /* Add a list of available styles to the given row/handler. */ -void ScreenOptionsMaster::SetStyles( OptionRowData &row, OptionRowHandler &hand ) +void ScreenOptionsMaster::SetStyles( OptionRowDefinition &row, OptionRowHandler &hand ) { hand.type = ROW_LIST; row.bOneChoiceForAllPlayers = true; @@ -227,7 +227,7 @@ void ScreenOptionsMaster::SetStyles( OptionRowData &row, OptionRowHandler &hand } /* Add a list of available song groups to the given row/handler. */ -void ScreenOptionsMaster::SetGroups( OptionRowData &row, OptionRowHandler &hand ) +void ScreenOptionsMaster::SetGroups( OptionRowDefinition &row, OptionRowHandler &hand ) { hand.type = ROW_LIST; row.bOneChoiceForAllPlayers = true; @@ -255,7 +255,7 @@ void ScreenOptionsMaster::SetGroups( OptionRowData &row, OptionRowHandler &hand } /* Add a list of available difficulties to the given row/handler. */ -void ScreenOptionsMaster::SetDifficulties( OptionRowData &row, OptionRowHandler &hand ) +void ScreenOptionsMaster::SetDifficulties( OptionRowDefinition &row, OptionRowHandler &hand ) { set vDifficulties; GAMESTATE->GetDifficultiesToShow( vDifficulties ); @@ -330,12 +330,12 @@ ScreenOptionsMaster::ScreenOptionsMaster( CString sClassName ): bShowUnderlines = false; } - m_OptionRowAlloc = new OptionRowData[asLineNames.size()]; + m_OptionRowAlloc = new OptionRowDefinition[asLineNames.size()]; for( unsigned i = 0; i < asLineNames.size(); ++i ) { CString sLineName = asLineNames[i]; - OptionRowData &row = m_OptionRowAlloc[i]; + OptionRowDefinition &row = m_OptionRowAlloc[i]; CString sRowCommands = LINE(sLineName); @@ -393,7 +393,7 @@ void SelectExactlyOne( int iSelection, vector &vbSelectedOut ) vbSelectedOut[i] = i==iSelection; } -void ScreenOptionsMaster::ImportOption( const OptionRowData &row, const OptionRowHandler &hand, PlayerNumber pn, int rowno, vector &vbSelectedOut ) +void ScreenOptionsMaster::ImportOption( const OptionRowDefinition &row, const OptionRowHandler &hand, PlayerNumber pn, int rowno, vector &vbSelectedOut ) { /* Figure out which selection is the default. */ switch( hand.type ) @@ -414,7 +414,7 @@ void ScreenOptionsMaster::ImportOption( const OptionRowData &row, const OptionRo /* The entry has no effect. This is usually a default "none of the * above" entry. It will always return true for DescribesCurrentMode(). * It's only the selected choice if nothing else matches. */ - if( row.type != OptionRowData::SELECT_MULTIPLE ) + if( row.selectType != OptionRowDefinition::SELECT_MULTIPLE ) FallbackOption = e; continue; } @@ -424,7 +424,7 @@ void ScreenOptionsMaster::ImportOption( const OptionRowData &row, const OptionRo if( mc.DescribesCurrentModeForAllPlayers() ) { UseFallbackOption = false; - if( row.type != OptionRowData::SELECT_MULTIPLE ) + if( row.selectType != OptionRowDefinition::SELECT_MULTIPLE ) SelectExactlyOne( e, vbSelectedOut ); else vbSelectedOut[e] = true; @@ -435,7 +435,7 @@ void ScreenOptionsMaster::ImportOption( const OptionRowData &row, const OptionRo if( mc.DescribesCurrentMode( pn) ) { UseFallbackOption = false; - if( row.type != OptionRowData::SELECT_MULTIPLE ) + if( row.selectType != OptionRowDefinition::SELECT_MULTIPLE ) SelectExactlyOne( e, vbSelectedOut ); else vbSelectedOut[e] = true; @@ -443,7 +443,7 @@ void ScreenOptionsMaster::ImportOption( const OptionRowData &row, const OptionRo } } - if( row.type == OptionRowData::SELECT_ONE && + if( row.selectType == OptionRowDefinition::SELECT_ONE && UseFallbackOption && FallbackOption != -1 ) { @@ -464,7 +464,7 @@ void ScreenOptionsMaster::ImportOption( const OptionRowData &row, const OptionRo ASSERT(0); } - if( row.type != OptionRowData::SELECT_MULTIPLE ) + if( row.selectType != OptionRowDefinition::SELECT_MULTIPLE ) { // The first row ("go down") should not be selected. ASSERT( !vbSelectedOut[0] ); @@ -483,8 +483,8 @@ void ScreenOptionsMaster::ImportOptions() for( unsigned i = 0; i < OptionRowHandlers.size(); ++i ) { const OptionRowHandler &hand = OptionRowHandlers[i]; - const OptionRowData &data = m_OptionRowAlloc[i]; - Row &row = *m_Rows[i]; + const OptionRowDefinition &data = m_OptionRowAlloc[i]; + OptionRow &row = *m_Rows[i]; if( data.bOneChoiceForAllPlayers ) { @@ -509,8 +509,8 @@ void ScreenOptionsMaster::ImportOptionsForPlayer( PlayerNumber pn ) for( unsigned i = 0; i < OptionRowHandlers.size(); ++i ) { const OptionRowHandler &hand = OptionRowHandlers[i]; - const OptionRowData &data = m_OptionRowAlloc[i]; - Row &row = *m_Rows[i]; + const OptionRowDefinition &data = m_OptionRowAlloc[i]; + OptionRow &row = *m_Rows[i]; if( data.bOneChoiceForAllPlayers ) continue; @@ -528,7 +528,7 @@ int GetOneSelection( const vector &vbSelected ) } /* Returns an OPT mask. */ -int ScreenOptionsMaster::ExportOption( const OptionRowData &row, const OptionRowHandler &hand, PlayerNumber pn, const vector &vbSelected ) +int ScreenOptionsMaster::ExportOption( const OptionRowDefinition &row, const OptionRowHandler &hand, PlayerNumber pn, const vector &vbSelected ) { /* Figure out which selection is the default. */ switch( hand.type ) @@ -580,8 +580,8 @@ void ScreenOptionsMaster::ExportOptions() CHECKPOINT_M( ssprintf("%i/%i", i, int(OptionRowHandlers.size())) ); const OptionRowHandler &hand = OptionRowHandlers[i]; - const OptionRowData &data = m_OptionRowAlloc[i]; - Row &row = *m_Rows[i]; + const OptionRowDefinition &data = m_OptionRowAlloc[i]; + OptionRow &row = *m_Rows[i]; FOREACH_HumanPlayer( p ) { @@ -686,11 +686,11 @@ void ScreenOptionsMaster::RefreshIcons() { for( unsigned i=0; iType == Row::ROW_EXIT ) + if( m_Rows[i]->Type == OptionRow::ROW_EXIT ) continue; // skip - Row &row = *m_Rows[i]; - const OptionRowData &data = row.m_RowDef; + OptionRow &row = *m_Rows[i]; + const OptionRowDefinition &data = row.m_RowDef; // find first selection and whether multiple are selected int iFirstSelection = -1; diff --git a/stepmania/src/ScreenOptionsMaster.h b/stepmania/src/ScreenOptionsMaster.h index 17f23a94ce..d41757bb0b 100644 --- a/stepmania/src/ScreenOptionsMaster.h +++ b/stepmania/src/ScreenOptionsMaster.h @@ -39,18 +39,18 @@ private: CString m_sNextScreen; vector OptionRowHandlers; - OptionRowData *m_OptionRowAlloc; + OptionRowDefinition *m_OptionRowAlloc; - int ExportOption( const OptionRowData &row, const OptionRowHandler &hand, PlayerNumber pn, const vector &vbSelected ); - void ImportOption( const OptionRowData &row, const OptionRowHandler &hand, PlayerNumber pn, int rowno, vector &vbSelectedOut ); + int ExportOption( const OptionRowDefinition &row, const OptionRowHandler &hand, PlayerNumber pn, const vector &vbSelected ); + void ImportOption( const OptionRowDefinition &row, const OptionRowHandler &hand, PlayerNumber pn, int rowno, vector &vbSelectedOut ); - static void SetList( OptionRowData &row, OptionRowHandler &hand, CString param ); - static void SetSteps( OptionRowData &row, OptionRowHandler &hand ); - static void SetConf( OptionRowData &row, OptionRowHandler &hand, CString param ); - static void SetCharacters( OptionRowData &row, OptionRowHandler &hand ); - static void SetStyles( OptionRowData &row, OptionRowHandler &hand ); - static void SetGroups( OptionRowData &row, OptionRowHandler &hand ); - static void SetDifficulties( OptionRowData &row, OptionRowHandler &hand ); + static void SetList( OptionRowDefinition &row, OptionRowHandler &hand, CString param ); + static void SetSteps( OptionRowDefinition &row, OptionRowHandler &hand ); + static void SetConf( OptionRowDefinition &row, OptionRowHandler &hand, CString param ); + static void SetCharacters( OptionRowDefinition &row, OptionRowHandler &hand ); + static void SetStyles( OptionRowDefinition &row, OptionRowHandler &hand ); + static void SetGroups( OptionRowDefinition &row, OptionRowHandler &hand ); + static void SetDifficulties( OptionRowDefinition &row, OptionRowHandler &hand ); protected: virtual void ImportOptions(); diff --git a/stepmania/src/ScreenProfileOptions.cpp b/stepmania/src/ScreenProfileOptions.cpp index 1c11e2eddd..2236d7075e 100644 --- a/stepmania/src/ScreenProfileOptions.cpp +++ b/stepmania/src/ScreenProfileOptions.cpp @@ -22,14 +22,14 @@ enum { NUM_PROFILE_OPTIONS_LINES }; -OptionRowData g_ProfileOptionsLines[NUM_PROFILE_OPTIONS_LINES] = { - OptionRowData( "Player1\nProfile", true ), - OptionRowData( "Player2\nProfile", true ), - OptionRowData( "Create\nNew", true, "PRESS START" ), - OptionRowData( "Delete", true ), - OptionRowData( "Rename", true ), - OptionRowData( "OS Mount\nPlayer1", true, "" ), - OptionRowData( "OS Mount\nPlayer2", true, "" ), +OptionRowDefinition g_ProfileOptionsLines[NUM_PROFILE_OPTIONS_LINES] = { + OptionRowDefinition( "Player1\nProfile", true ), + OptionRowDefinition( "Player2\nProfile", true ), + OptionRowDefinition( "Create\nNew", true, "PRESS START" ), + OptionRowDefinition( "Delete", true ), + OptionRowDefinition( "Rename", true ), + OptionRowDefinition( "OS Mount\nPlayer1", true, "" ), + OptionRowDefinition( "OS Mount\nPlayer2", true, "" ), }; const ScreenMessage SM_DoneCreating = ScreenMessage(SM_User+1); @@ -212,7 +212,7 @@ CString ScreenProfileOptions::GetSelectedProfileID() vector vsProfiles; PROFILEMAN->GetLocalProfileIDs( vsProfiles ); - const Row &row = *m_Rows[GetCurrentRow()]; + const OptionRow &row = *m_Rows[GetCurrentRow()]; const int Selection = row.GetOneSharedSelection(); if( !Selection ) return ""; @@ -221,7 +221,7 @@ CString ScreenProfileOptions::GetSelectedProfileID() CString ScreenProfileOptions::GetSelectedProfileName() { - const Row &row = *m_Rows[GetCurrentRow()]; + const OptionRow &row = *m_Rows[GetCurrentRow()]; const int Selection = row.GetOneSharedSelection(); if( !Selection ) return ""; diff --git a/stepmania/src/ScreenSMOnlineLogin.cpp b/stepmania/src/ScreenSMOnlineLogin.cpp index e2e8796d81..346452e611 100644 --- a/stepmania/src/ScreenSMOnlineLogin.cpp +++ b/stepmania/src/ScreenSMOnlineLogin.cpp @@ -21,8 +21,8 @@ REGISTER_SCREEN_CLASS(ScreenSMOnlineLogin); #define NEXT_SCREEN THEME->GetMetric (m_sName,"NextScreen") const ScreenMessage SM_SMOnlinePack = ScreenMessage(SM_User+8); const ScreenMessage SM_PasswordDone = ScreenMessage(SM_User+9); -OptionRowData g_ProfileLine[1] = { - OptionRowData("Profile",false) +OptionRowDefinition g_ProfileLine[1] = { + OptionRowDefinition("Profile",false) }; ScreenSMOnlineLogin::ScreenSMOnlineLogin(CString sClassName) : ScreenOptions(sClassName) @@ -41,7 +41,7 @@ ScreenSMOnlineLogin::ScreenSMOnlineLogin(CString sClassName) : ScreenOptions(sCl { InitMenu(INPUTMODE_SHARE_CURSOR, g_ProfileLine, 1); SOUND->PlayMusic( THEME->GetPathS("ScreenMachineOptions", "music")); - Row &row = *m_Rows.back(); + OptionRow &row = *m_Rows.back(); BitmapText *bt = row.m_textItems.back(); bt->SetText("Login"); //Change "Exit" Text } @@ -148,7 +148,7 @@ CString ScreenSMOnlineLogin::GetSelectedProfileID() vector vsProfiles; PROFILEMAN->GetLocalProfileIDs( vsProfiles ); - const Row &row = *m_Rows[GetCurrentRow()]; + const OptionRow &row = *m_Rows[GetCurrentRow()]; const int Selection = row.GetOneSharedSelection(); if( !Selection ) return ""; diff --git a/stepmania/src/StepMania.dsp b/stepmania/src/StepMania.dsp index f6e07a82f2..a0f3ec05ef 100644 --- a/stepmania/src/StepMania.dsp +++ b/stepmania/src/StepMania.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="StepMania" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 60000 +# Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 @@ -62,7 +62,7 @@ IntDir=.\../Debug6 TargetDir=\stepmania\stepmania\Program TargetName=StepMania-debug SOURCE="$(InputPath)" -PreLink_Cmds=archutils\Win32\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ +PreLink_Cmds=archutils\Win32\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ PostBuild_Cmds=archutils\Win32\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi # End Special Build Tool @@ -99,7 +99,7 @@ IntDir=.\../Release6 TargetDir=\stepmania\stepmania\Program TargetName=StepMania SOURCE="$(InputPath)" -PreLink_Cmds=archutils\Win32\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ +PreLink_Cmds=archutils\Win32\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ PostBuild_Cmds=archutils\Win32\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi # End Special Build Tool @@ -2310,6 +2310,14 @@ SOURCE=.\OptionIconRow.h # End Source File # Begin Source File +SOURCE=.\OptionRow.cpp +# End Source File +# Begin Source File + +SOURCE=.\OptionRow.h +# End Source File +# Begin Source File + SOURCE=.\OptionsCursor.cpp # End Source File # Begin Source File diff --git a/stepmania/src/StepMania.vcproj b/stepmania/src/StepMania.vcproj index 1b7a5d5dfc..547329362c 100644 --- a/stepmania/src/StepMania.vcproj +++ b/stepmania/src/StepMania.vcproj @@ -1551,6 +1551,12 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\ + + + +