move OptionTitle into OptionRowHandler

This commit is contained in:
Glenn Maynard
2006-09-01 04:29:24 +00:00
parent 0630367edc
commit 3f468cb30a
4 changed files with 20 additions and 19 deletions
+2 -17
View File
@@ -55,20 +55,6 @@ void OptionRow::PrepareItemText( RString &s ) const
s.MakeUpper();
}
RString OptionRow::OptionTitle( RString s ) const
{
bool bTheme = false;
// HACK: Always theme the NEXT_ROW and EXIT items, even if metrics says not to theme.
if( m_pHand->m_Def.m_bAllowThemeTitle )
bTheme = true;
if( s.empty() )
return s;
return bTheme ? THEME->GetString("OptionTitles",s) : s;
}
RString ITEMS_LONG_ROW_X_NAME( size_t p ) { return ssprintf("ItemsLongRowP%dX",int(p+1)); }
RString ICONS_X_NAME( size_t p ) { return ssprintf("IconsP%dX",int(p+1)); }
@@ -222,11 +208,10 @@ void OptionRow::ChoicesChanged()
RString OptionRow::GetRowTitle() const
{
RString sLineName = m_pHand->m_Def.m_sName;
RString sTitle = OptionTitle(sLineName);
RString sTitle = m_pHand->OptionTitle();
// HACK: tack the BPM onto the name of the speed line
if( sLineName.CompareNoCase("speed")==0 )
if( m_pHand->m_Def.m_sName.CompareNoCase("speed")==0 )
{
bool bShowBpmInSpeedTitle = m_pParentType->SHOW_BPM_IN_SPEED_TITLE;
-1
View File
@@ -186,7 +186,6 @@ public:
bool GetFirstItemGoesDown() const { return m_bFirstItemGoesDown; }
void PrepareItemText( RString &s ) const;
RString OptionTitle( RString s ) const;
void SetExitText( RString sExitText );
+16 -1
View File
@@ -28,6 +28,21 @@
#define ENTRY_MODE(s,i) THEME->GetMetric ("ScreenOptionsMaster",ssprintf("%s,%i",(s).c_str(),(i+1)))
#define ENTRY_DEFAULT(s) THEME->GetMetric ("ScreenOptionsMaster",(s) + "Default")
RString OptionRowHandler::OptionTitle() const
{
bool bTheme = false;
// HACK: Always theme the NEXT_ROW and EXIT items, even if metrics says not to theme.
if( m_Def.m_bAllowThemeTitle )
bTheme = true;
RString s = m_Def.m_sName;
if( s.empty() )
return s;
return bTheme ? THEME->GetString("OptionTitles",s) : s;
}
void OptionRowHandler::GetIconTextAndGameCommand( int iFirstSelection, RString &sIconTextOut, GameCommand &gcOut ) const
{
sIconTextOut = "";
@@ -1268,7 +1283,7 @@ OptionRowHandler* OptionRowHandlerUtil::MakeSimple( const MenuRowDef &mr )
pHand->m_Def.m_bOneChoiceForAllPlayers = true;
pHand->m_Def.m_selectType = SELECT_ONE;
pHand->m_Def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
pHand->m_Def.m_bExportOnChange = false;
pHand->m_Def.m_bExportOnChange = false;//true;
pHand->m_Def.m_vsChoices = mr.choices;
+2
View File
@@ -32,6 +32,8 @@ public:
m_cmds = cmds;
this->LoadInternal( cmds );
}
RString OptionTitle() const;
virtual void LoadInternal( const Commands &cmds ) { }
/*