Split part of OptionRow::GetThemedItemText into OptionRowHandler::GetThemedItemText.

(OptionRowHandler handles low-level option sets, including row and option
titles; OptionRow handles ScreenOption-specific parts, like "NextRow".)
This commit is contained in:
Glenn Maynard
2006-09-01 04:54:15 +00:00
parent 8983d620c6
commit 685e2e7412
3 changed files with 29 additions and 18 deletions
+23
View File
@@ -58,6 +58,29 @@ RString OptionRowHandler::OptionTitle() const
return bTheme ? THEME->GetString("OptionTitles",s) : s;
}
RString OptionRowHandler::GetThemedItemText( int iChoice ) const
{
RString s = m_Def.m_vsChoices[iChoice];
if( s == "" )
return "";
bool bTheme = false;
if( m_Def.m_bAllowThemeItems ) bTheme = true;
// Items beginning with a pipe mean "don't theme".
// This allows us to disable theming on a per-choice basis for choice names that are just a number
// and don't need to be localized.
if( s[0] == '|' )
{
s.erase( s.begin() );
bTheme = false;
}
if( bTheme )
s = CommonMetrics::LocalizeOptionItem( s, false );
return s;
}
void OptionRowHandler::GetIconTextAndGameCommand( int iFirstSelection, RString &sIconTextOut, GameCommand &gcOut ) const
{
sIconTextOut = "";