From ca8f869fd132e21bbead38b57a3aba1a0ca93ec2 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 9 Jan 2004 06:38:19 +0000 Subject: [PATCH] allow translating menu entries --- stepmania/src/ScreenOptions.cpp | 7 +++++-- stepmania/src/ScreenOptionsMaster.cpp | 19 +++++++++++-------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/stepmania/src/ScreenOptions.cpp b/stepmania/src/ScreenOptions.cpp index bf3cbaa965..f67d85b140 100644 --- a/stepmania/src/ScreenOptions.cpp +++ b/stepmania/src/ScreenOptions.cpp @@ -388,7 +388,7 @@ CString ScreenOptions::GetExplanationTitle( int iRow ) const sLineName.Replace("\n-",""); sLineName.Replace("\n",""); sLineName.Replace(" ",""); - CString sTitle = THEME->GetMetric( "OptionExplanations", sLineName+"Title" ); + CString sTitle = THEME->GetMetric( "OptionTitles", sLineName+"Title" ); // HACK: tack the BPM onto the name of the speed line if( sLineName.CompareNoCase("speed")==0 ) @@ -965,7 +965,10 @@ void ScreenOptions::ChangeValue( PlayerNumber pn, int iDelta, bool Repeat ) 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. - * This allows navigating the options menu with left/right/start. */ + * This allows navigating the options menu with left/right/start. + * + * XXX: Only allow repeats if the opposite key isn't pressed; otherwise, holding both + * directions will repeat in place continuously, which is weird. */ Move( pn, iDelta, Repeat ); return; } diff --git a/stepmania/src/ScreenOptionsMaster.cpp b/stepmania/src/ScreenOptionsMaster.cpp index c9aef60e0f..ed08b55231 100644 --- a/stepmania/src/ScreenOptionsMaster.cpp +++ b/stepmania/src/ScreenOptionsMaster.cpp @@ -25,8 +25,8 @@ #define ROW_LINE(i) THEME->GetMetric (m_sName,ssprintf("Line%i",(i+1))) #define ENTRY(s) THEME->GetMetric ("ScreenOptionsMaster",s) +#define ENTRY_NAME(s) THEME->GetMetric ("OptionNames", s) #define ENTRY_MODE(s,i) THEME->GetMetric ("ScreenOptionsMaster",ssprintf("%s,%i",(s).c_str(),(i+1))) -#define ENTRY_NAME(s,i) THEME->GetMetric ("ScreenOptionsMaster",ssprintf("%sName,%i",(s).c_str(),(i+1))) #define ENTRY_DEFAULT(s) THEME->GetMetric ("ScreenOptionsMaster",(s) + "Default") #define NEXT_SCREEN THEME->GetMetric (m_sName,"NextScreen") @@ -76,12 +76,15 @@ void ScreenOptionsMaster::SetList( OptionRow &row, OptionRowHandler &hand, CStri { ModeChoice mc; mc.Load( 0, ENTRY_MODE(ListName, col) ); + if( mc.m_sName == "" ) + RageException::Throw( "List \"%s\", col %i has no name", ListName.c_str(), col ); if( !mc.IsPlayable() ) continue; hand.ListEntries.push_back( mc ); - row.choices.push_back( ENTRY_NAME(ListName, col) ); + + row.choices.push_back( ENTRY_NAME(mc.m_sName) ); } } @@ -99,9 +102,9 @@ void ScreenOptionsMaster::SetStep( OptionRow &row, OptionRowHandler &hand ) else if( GAMESTATE->m_pCurCourse ) // playing a course { row.bOneChoiceForAllPlayers = true; - row.choices.push_back( "REGULAR" ); + row.choices.push_back( ENTRY_NAME("RegularCourses") ); if( GAMESTATE->m_pCurCourse->HasDifficult( GAMESTATE->GetCurrentStyleDef()->m_StepsType ) ) - row.choices.push_back( "DIFFICULT" ); + row.choices.push_back( ENTRY_NAME("DifficultCourses") ); } else if( GAMESTATE->m_pCurSong ) // playing a song { @@ -122,7 +125,7 @@ void ScreenOptionsMaster::SetStep( OptionRow &row, OptionRowHandler &hand ) } else { - row.choices.push_back( "N/A" ); + row.choices.push_back( ENTRY_NAME("N/A") ); } } @@ -148,7 +151,7 @@ void ScreenOptionsMaster::SetCharacter( OptionRow &row, OptionRowHandler &hand ) { hand.type = ROW_CHARACTER; row.bOneChoiceForAllPlayers = false; - row.choices.push_back( "OFF" ); + row.choices.push_back( ENTRY_NAME("Off") ); vector apCharacters; GAMESTATE->GetCharacters( apCharacters ); for( unsigned i=0; i