PrepareItemText -> GetThemedItemText
This commit is contained in:
@@ -14,10 +14,11 @@
|
|||||||
const RString NEXT_ROW_NAME = "NextRow";
|
const RString NEXT_ROW_NAME = "NextRow";
|
||||||
const RString EXIT_NAME = "Exit";
|
const RString EXIT_NAME = "Exit";
|
||||||
|
|
||||||
void OptionRow::PrepareItemText( RString &s ) const
|
RString OptionRow::GetThemedItemText( int iChoice ) const
|
||||||
{
|
{
|
||||||
|
RString s = m_pHand->m_Def.m_vsChoices[iChoice];
|
||||||
if( s == "" )
|
if( s == "" )
|
||||||
return;
|
return "";
|
||||||
bool bTheme = false;
|
bool bTheme = false;
|
||||||
|
|
||||||
// HACK: Always theme the NEXT_ROW and EXIT items.
|
// HACK: Always theme the NEXT_ROW and EXIT items.
|
||||||
@@ -38,6 +39,7 @@ void OptionRow::PrepareItemText( RString &s ) const
|
|||||||
s = CommonMetrics::LocalizeOptionItem( s, false );
|
s = CommonMetrics::LocalizeOptionItem( s, false );
|
||||||
if( m_pParentType->CAPITALIZE_ALL_OPTION_NAMES )
|
if( m_pParentType->CAPITALIZE_ALL_OPTION_NAMES )
|
||||||
s.MakeUpper();
|
s.MakeUpper();
|
||||||
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
RString ITEMS_LONG_ROW_X_NAME( size_t p ) { return ssprintf("ItemsLongRowP%dX",int(p+1)); }
|
RString ITEMS_LONG_ROW_X_NAME( size_t p ) { return ssprintf("ItemsLongRowP%dX",int(p+1)); }
|
||||||
@@ -288,8 +290,7 @@ void OptionRow::InitText()
|
|||||||
float fWidth = 0;
|
float fWidth = 0;
|
||||||
for( unsigned c=0; c<m_pHand->m_Def.m_vsChoices.size(); c++ )
|
for( unsigned c=0; c<m_pHand->m_Def.m_vsChoices.size(); c++ )
|
||||||
{
|
{
|
||||||
RString sText = m_pHand->m_Def.m_vsChoices[c];
|
RString sText = GetThemedItemText( c );
|
||||||
PrepareItemText( sText );
|
|
||||||
bt.SetText( sText );
|
bt.SetText( sText );
|
||||||
|
|
||||||
fWidth += bt.GetZoomedWidth();
|
fWidth += bt.GetZoomedWidth();
|
||||||
@@ -361,8 +362,7 @@ void OptionRow::InitText()
|
|||||||
// init text
|
// init text
|
||||||
BitmapText *bt = new BitmapText( m_pParentType->m_textItemParent );
|
BitmapText *bt = new BitmapText( m_pParentType->m_textItemParent );
|
||||||
m_textItems.push_back( bt );
|
m_textItems.push_back( bt );
|
||||||
RString sText = m_pHand->m_Def.m_vsChoices[c];
|
RString sText = GetThemedItemText( c );
|
||||||
PrepareItemText( sText );
|
|
||||||
bt->SetText( sText );
|
bt->SetText( sText );
|
||||||
bt->SetBaseZoomX( fBaseZoom );
|
bt->SetBaseZoomX( fBaseZoom );
|
||||||
bt->RunCommands( m_pParentType->ITEMS_ON_COMMAND );
|
bt->RunCommands( m_pParentType->ITEMS_ON_COMMAND );
|
||||||
@@ -534,8 +534,7 @@ void OptionRow::UpdateText( PlayerNumber p )
|
|||||||
if( iChoiceWithFocus == -1 )
|
if( iChoiceWithFocus == -1 )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
RString sText = m_pHand->m_Def.m_vsChoices[iChoiceWithFocus];
|
RString sText = GetThemedItemText( iChoiceWithFocus );
|
||||||
PrepareItemText( sText );
|
|
||||||
|
|
||||||
// If player_no is 2 and there is no player 1:
|
// If player_no is 2 and there is no player 1:
|
||||||
int index = min( pn, m_textItems.size()-1 );
|
int index = min( pn, m_textItems.size()-1 );
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ public:
|
|||||||
unsigned GetTextItemsSize() const { return m_textItems.size(); }
|
unsigned GetTextItemsSize() const { return m_textItems.size(); }
|
||||||
bool GetFirstItemGoesDown() const { return m_bFirstItemGoesDown; }
|
bool GetFirstItemGoesDown() const { return m_bFirstItemGoesDown; }
|
||||||
|
|
||||||
void PrepareItemText( RString &s ) const;
|
RString GetThemedItemText( int iChoice ) const;
|
||||||
|
|
||||||
void SetExitText( RString sExitText );
|
void SetExitText( RString sExitText );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user