From 82a67c31ec822966b44875120f0a021e89b1ea7c Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 20 Mar 2005 20:12:11 +0000 Subject: [PATCH] fix misnamed method don't mangle strings when looking up Title and Explanation metrics --- stepmania/src/ScreenOptions.cpp | 20 +++++++------------- stepmania/src/ScreenOptions.h | 4 ++-- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/stepmania/src/ScreenOptions.cpp b/stepmania/src/ScreenOptions.cpp index 6657c7a9a1..8897baa55e 100644 --- a/stepmania/src/ScreenOptions.cpp +++ b/stepmania/src/ScreenOptions.cpp @@ -73,17 +73,11 @@ static CString EXPLANATION_ON_COMMAND_NAME( size_t p ) { return ssprintf("Explan static CString OPTION_TITLE( CString s ) { - s.Replace("\n-",""); - s.Replace("\n",""); - s.Replace(" ",""); - return THEME->GetMetric("OptionTitles",s+"Title"); + return THEME->GetMetric("OptionTitles",s); } static CString OPTION_EXPLANATION( CString s ) { - s.Replace("\n-",""); - s.Replace("\n",""); - s.Replace(" ",""); - return THEME->GetMetric("OptionExplanations",s+"Help"); + return THEME->GetMetric("OptionExplanations",s); } //REGISTER_SCREEN_CLASS( ScreenOptions ); // can't be instantiated @@ -111,7 +105,7 @@ ScreenOptions::ScreenOptions( CString sClassName ) : ScreenWithMenuElements(sCla SEPARATE_EXIT_ROW_Y (m_sName,"SeparateExitRowY"), OPTION_ROW_TYPE (m_sName,"OptionRowType"), SHOW_EXPLANATIONS (m_sName,"ShowExplanations"), - THEME_OPTION_TITLES (m_sName,"ThemeOptionTitles") + THEME_TITLES (m_sName,"ThemeTitles") { m_fLockInputSecs = 0.0001f; // always lock for a tiny amount of time so that we throw away any queued inputs during the load. @@ -181,7 +175,7 @@ void ScreenOptions::InitMenu( InputMode im, const vector &v const float fY = ROW_Y.GetValue( pos ); row.AfterImportOptions( - GetExplanationTitle( r ), + GetRowTitle( r ), fY ); } @@ -280,7 +274,7 @@ void ScreenOptions::InitMenu( InputMode im, const vector &v for( int r=0; r<(int)m_Rows.size(); r++ ) // foreach row { GetExplanationText( r ); - GetExplanationTitle( r ); + GetRowTitle( r ); } // put focus on the first enabled row @@ -341,12 +335,12 @@ CString ScreenOptions::GetExplanationText( int iRow ) const return SHOW_EXPLANATIONS ? OPTION_EXPLANATION(sLineName) : ""; } -CString ScreenOptions::GetExplanationTitle( int iRow ) const +CString ScreenOptions::GetRowTitle( int iRow ) const { OptionRow &row = *m_Rows[iRow]; CString sLineName = row.GetRowDef().name; - CString sTitle = THEME_OPTION_TITLES ? OPTION_TITLE(sLineName) : sLineName; + CString sTitle = THEME_TITLES ? OPTION_TITLE(sLineName) : sLineName; // HACK: tack the BPM onto the name of the speed line if( sLineName.CompareNoCase("speed")==0 ) diff --git a/stepmania/src/ScreenOptions.h b/stepmania/src/ScreenOptions.h index d1b6d611bd..08d079268b 100644 --- a/stepmania/src/ScreenOptions.h +++ b/stepmania/src/ScreenOptions.h @@ -38,7 +38,7 @@ protected: void InitOptionsText(); void GetWidthXY( PlayerNumber pn, int iRow, int iChoiceOnRow, int &iWidthOut, int &iXOut, int &iYOut ); CString GetExplanationText( int row ) const; - CString GetExplanationTitle( int row ) const; + CString GetRowTitle( int row ) const; BitmapText &GetTextItemForRow( PlayerNumber pn, int iRow, int iChoiceOnRow ); void PositionUnderlines( int row, PlayerNumber pn ); void PositionAllUnderlines(); @@ -141,8 +141,8 @@ protected: ThemeMetric SEPARATE_EXIT_ROW; ThemeMetric SEPARATE_EXIT_ROW_Y; ThemeMetric OPTION_ROW_TYPE; - ThemeMetric THEME_OPTION_TITLES; ThemeMetric SHOW_EXPLANATIONS; + ThemeMetric THEME_TITLES; float m_fLockInputSecs; };