fix misnamed method

don't mangle strings when looking up Title and Explanation metrics
This commit is contained in:
Chris Danford
2005-03-20 20:12:11 +00:00
parent 69ec4c06de
commit 82a67c31ec
2 changed files with 9 additions and 15 deletions
+7 -13
View File
@@ -73,17 +73,11 @@ static CString EXPLANATION_ON_COMMAND_NAME( size_t p ) { return ssprintf("Explan
static CString OPTION_TITLE( CString s ) static CString OPTION_TITLE( CString s )
{ {
s.Replace("\n-",""); return THEME->GetMetric("OptionTitles",s);
s.Replace("\n","");
s.Replace(" ","");
return THEME->GetMetric("OptionTitles",s+"Title");
} }
static CString OPTION_EXPLANATION( CString s ) static CString OPTION_EXPLANATION( CString s )
{ {
s.Replace("\n-",""); return THEME->GetMetric("OptionExplanations",s);
s.Replace("\n","");
s.Replace(" ","");
return THEME->GetMetric("OptionExplanations",s+"Help");
} }
//REGISTER_SCREEN_CLASS( ScreenOptions ); // can't be instantiated //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"), SEPARATE_EXIT_ROW_Y (m_sName,"SeparateExitRowY"),
OPTION_ROW_TYPE (m_sName,"OptionRowType"), OPTION_ROW_TYPE (m_sName,"OptionRowType"),
SHOW_EXPLANATIONS (m_sName,"ShowExplanations"), 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. 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<OptionRowDefinition> &v
const float fY = ROW_Y.GetValue( pos ); const float fY = ROW_Y.GetValue( pos );
row.AfterImportOptions( row.AfterImportOptions(
GetExplanationTitle( r ), GetRowTitle( r ),
fY fY
); );
} }
@@ -280,7 +274,7 @@ void ScreenOptions::InitMenu( InputMode im, const vector<OptionRowDefinition> &v
for( int r=0; r<(int)m_Rows.size(); r++ ) // foreach row for( int r=0; r<(int)m_Rows.size(); r++ ) // foreach row
{ {
GetExplanationText( r ); GetExplanationText( r );
GetExplanationTitle( r ); GetRowTitle( r );
} }
// put focus on the first enabled row // put focus on the first enabled row
@@ -341,12 +335,12 @@ CString ScreenOptions::GetExplanationText( int iRow ) const
return SHOW_EXPLANATIONS ? OPTION_EXPLANATION(sLineName) : ""; return SHOW_EXPLANATIONS ? OPTION_EXPLANATION(sLineName) : "";
} }
CString ScreenOptions::GetExplanationTitle( int iRow ) const CString ScreenOptions::GetRowTitle( int iRow ) const
{ {
OptionRow &row = *m_Rows[iRow]; OptionRow &row = *m_Rows[iRow];
CString sLineName = row.GetRowDef().name; 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 // HACK: tack the BPM onto the name of the speed line
if( sLineName.CompareNoCase("speed")==0 ) if( sLineName.CompareNoCase("speed")==0 )
+2 -2
View File
@@ -38,7 +38,7 @@ protected:
void InitOptionsText(); void InitOptionsText();
void GetWidthXY( PlayerNumber pn, int iRow, int iChoiceOnRow, int &iWidthOut, int &iXOut, int &iYOut ); void GetWidthXY( PlayerNumber pn, int iRow, int iChoiceOnRow, int &iWidthOut, int &iXOut, int &iYOut );
CString GetExplanationText( int row ) const; CString GetExplanationText( int row ) const;
CString GetExplanationTitle( int row ) const; CString GetRowTitle( int row ) const;
BitmapText &GetTextItemForRow( PlayerNumber pn, int iRow, int iChoiceOnRow ); BitmapText &GetTextItemForRow( PlayerNumber pn, int iRow, int iChoiceOnRow );
void PositionUnderlines( int row, PlayerNumber pn ); void PositionUnderlines( int row, PlayerNumber pn );
void PositionAllUnderlines(); void PositionAllUnderlines();
@@ -141,8 +141,8 @@ protected:
ThemeMetric<bool> SEPARATE_EXIT_ROW; ThemeMetric<bool> SEPARATE_EXIT_ROW;
ThemeMetric<float> SEPARATE_EXIT_ROW_Y; ThemeMetric<float> SEPARATE_EXIT_ROW_Y;
ThemeMetric<CString> OPTION_ROW_TYPE; ThemeMetric<CString> OPTION_ROW_TYPE;
ThemeMetric<bool> THEME_OPTION_TITLES;
ThemeMetric<bool> SHOW_EXPLANATIONS; ThemeMetric<bool> SHOW_EXPLANATIONS;
ThemeMetric<bool> THEME_TITLES;
float m_fLockInputSecs; float m_fLockInputSecs;
}; };