Move explanation texts to the same section, so items can be moved
around without having to edit all translations. Don't display text in the song options menu. Allow translating row titles.
This commit is contained in:
@@ -232,7 +232,11 @@ void ScreenOptions::Init( InputMode im, OptionRow OptionRows[], int iNumOptionLi
|
|||||||
|
|
||||||
// poke once at all the explanation metrics so that we catch missing ones early
|
// poke once at all the explanation metrics so that we catch missing ones early
|
||||||
for( r=0; r<m_iNumOptionRows; r++ ) // foreach line
|
for( r=0; r<m_iNumOptionRows; r++ ) // foreach line
|
||||||
|
{
|
||||||
GetExplanationText( r );
|
GetExplanationText( r );
|
||||||
|
GetExplanationTitle( r );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
CHECKPOINT;
|
CHECKPOINT;
|
||||||
|
|
||||||
@@ -281,12 +285,19 @@ ScreenOptions::~ScreenOptions()
|
|||||||
CString ScreenOptions::GetExplanationText( int row ) const
|
CString ScreenOptions::GetExplanationText( int row ) const
|
||||||
{
|
{
|
||||||
CString sLineName = m_OptionRow[row].name;
|
CString sLineName = m_OptionRow[row].name;
|
||||||
if( sLineName=="" )
|
|
||||||
sLineName = m_OptionRow[row].choices[0];
|
|
||||||
sLineName.Replace("\n-","");
|
sLineName.Replace("\n-","");
|
||||||
sLineName.Replace("\n","");
|
sLineName.Replace("\n","");
|
||||||
sLineName.Replace(" ","");
|
sLineName.Replace(" ","");
|
||||||
return THEME->GetMetric( m_sName,sLineName );
|
return THEME->GetMetric( "OptionExplanations", sLineName+"Help" );
|
||||||
|
}
|
||||||
|
|
||||||
|
CString ScreenOptions::GetExplanationTitle( int row ) const
|
||||||
|
{
|
||||||
|
CString sLineName = m_OptionRow[row].name;
|
||||||
|
sLineName.Replace("\n-","");
|
||||||
|
sLineName.Replace("\n","");
|
||||||
|
sLineName.Replace(" ","");
|
||||||
|
return THEME->GetMetric( "OptionExplanations", sLineName+"Title" );
|
||||||
}
|
}
|
||||||
|
|
||||||
BitmapText &ScreenOptions::GetTextItemForRow( PlayerNumber pn, int iRow )
|
BitmapText &ScreenOptions::GetTextItemForRow( PlayerNumber pn, int iRow )
|
||||||
@@ -330,14 +341,12 @@ void ScreenOptions::InitOptionsText()
|
|||||||
{
|
{
|
||||||
for( int i=0; i<m_iNumOptionRows; i++ ) // foreach options line
|
for( int i=0; i<m_iNumOptionRows; i++ ) // foreach options line
|
||||||
{
|
{
|
||||||
const OptionRow &optline = m_OptionRow[i];
|
|
||||||
|
|
||||||
const float fY = ITEMS_START_Y + ITEMS_SPACING_Y*i;
|
const float fY = ITEMS_START_Y + ITEMS_SPACING_Y*i;
|
||||||
|
|
||||||
BitmapText &title = m_textTitles[i];
|
BitmapText &title = m_textTitles[i];
|
||||||
|
|
||||||
title.LoadFromFont( THEME->GetPathToF("ScreenOptions title") );
|
title.LoadFromFont( THEME->GetPathToF("ScreenOptions title") );
|
||||||
CString sText = optline.title;
|
CString sText = GetExplanationTitle( i );
|
||||||
|
|
||||||
title.SetText( sText );
|
title.SetText( sText );
|
||||||
title.SetXY( LABELS_X, fY );
|
title.SetXY( LABELS_X, fY );
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ const unsigned MAX_OPTION_LINES = 40;
|
|||||||
struct OptionRow
|
struct OptionRow
|
||||||
{
|
{
|
||||||
CString name;
|
CString name;
|
||||||
CString title;
|
|
||||||
bool bOneChoiceForAllPlayers;
|
bool bOneChoiceForAllPlayers;
|
||||||
vector<CString> choices;
|
vector<CString> choices;
|
||||||
|
|
||||||
@@ -36,7 +35,6 @@ struct OptionRow
|
|||||||
OptionRow( const char *n, int b, const char *c0=NULL, const char *c1=NULL, const char *c2=NULL, const char *c3=NULL, const char *c4=NULL, const char *c5=NULL, const char *c6=NULL, const char *c7=NULL, const char *c8=NULL, const char *c9=NULL, const char *c10=NULL, const char *c11=NULL, const char *c12=NULL, const char *c13=NULL, const char *c14=NULL, const char *c15=NULL, const char *c16=NULL, const char *c17=NULL, const char *c18=NULL, const char *c19=NULL )
|
OptionRow( const char *n, int b, const char *c0=NULL, const char *c1=NULL, const char *c2=NULL, const char *c3=NULL, const char *c4=NULL, const char *c5=NULL, const char *c6=NULL, const char *c7=NULL, const char *c8=NULL, const char *c9=NULL, const char *c10=NULL, const char *c11=NULL, const char *c12=NULL, const char *c13=NULL, const char *c14=NULL, const char *c15=NULL, const char *c16=NULL, const char *c17=NULL, const char *c18=NULL, const char *c19=NULL )
|
||||||
{
|
{
|
||||||
name = n;
|
name = n;
|
||||||
title = n;
|
|
||||||
bOneChoiceForAllPlayers = !!b;
|
bOneChoiceForAllPlayers = !!b;
|
||||||
#define PUSH( c ) if(c) choices.push_back(c);
|
#define PUSH( c ) if(c) choices.push_back(c);
|
||||||
PUSH(c0);PUSH(c1);PUSH(c2);PUSH(c3);PUSH(c4);PUSH(c5);PUSH(c6);PUSH(c7);PUSH(c8);PUSH(c9);PUSH(c10);PUSH(c11);PUSH(c12);PUSH(c13);PUSH(c14);PUSH(c15);PUSH(c16);PUSH(c17);PUSH(c18);PUSH(c19);
|
PUSH(c0);PUSH(c1);PUSH(c2);PUSH(c3);PUSH(c4);PUSH(c5);PUSH(c6);PUSH(c7);PUSH(c8);PUSH(c9);PUSH(c10);PUSH(c11);PUSH(c12);PUSH(c13);PUSH(c14);PUSH(c15);PUSH(c16);PUSH(c17);PUSH(c18);PUSH(c19);
|
||||||
@@ -68,6 +66,7 @@ protected:
|
|||||||
void InitOptionsText();
|
void InitOptionsText();
|
||||||
void GetWidthXY( PlayerNumber pn, int iRow, int &iWidthOut, int &iXOut, int &iYOut );
|
void GetWidthXY( PlayerNumber pn, int iRow, int &iWidthOut, int &iXOut, int &iYOut );
|
||||||
CString GetExplanationText( int row ) const;
|
CString GetExplanationText( int row ) const;
|
||||||
|
CString GetExplanationTitle( int row ) const;
|
||||||
BitmapText &GetTextItemForRow( PlayerNumber pn, int iRow );
|
BitmapText &GetTextItemForRow( PlayerNumber pn, int iRow );
|
||||||
void PositionUnderlines();
|
void PositionUnderlines();
|
||||||
void PositionIcons();
|
void PositionIcons();
|
||||||
|
|||||||
@@ -231,7 +231,6 @@ ScreenOptionsMaster::ScreenOptionsMaster( CString sClassName ):
|
|||||||
RageException::Throw( "Parse error in %s::Line%i", m_sName.c_str(), i+1 );
|
RageException::Throw( "Parse error in %s::Line%i", m_sName.c_str(), i+1 );
|
||||||
|
|
||||||
OptionRowHandler hand;
|
OptionRowHandler hand;
|
||||||
bool TitleSetExplicitly = false;
|
|
||||||
for( unsigned part = 0; part < asParts.size(); ++part)
|
for( unsigned part = 0; part < asParts.size(); ++part)
|
||||||
{
|
{
|
||||||
CStringArray asBits;
|
CStringArray asBits;
|
||||||
@@ -240,12 +239,7 @@ ScreenOptionsMaster::ScreenOptionsMaster( CString sClassName ):
|
|||||||
const CString name = asBits[0];
|
const CString name = asBits[0];
|
||||||
const CString param = asBits.size() > 1? asBits[1]: "";
|
const CString param = asBits.size() > 1? asBits[1]: "";
|
||||||
|
|
||||||
if( !name.CompareNoCase("title") )
|
if( !name.CompareNoCase("list") )
|
||||||
{
|
|
||||||
TitleSetExplicitly = true;
|
|
||||||
row.title = param;
|
|
||||||
}
|
|
||||||
else if( !name.CompareNoCase("list") )
|
|
||||||
{
|
{
|
||||||
SetList( row, hand, param, row.name );
|
SetList( row, hand, param, row.name );
|
||||||
}
|
}
|
||||||
@@ -265,9 +259,6 @@ ScreenOptionsMaster::ScreenOptionsMaster( CString sClassName ):
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
RageException::Throw( "Unexpected type '%s' in %s::Line%i", name.c_str(), m_sName.c_str(), i );
|
RageException::Throw( "Unexpected type '%s' in %s::Line%i", name.c_str(), m_sName.c_str(), i );
|
||||||
|
|
||||||
if( !TitleSetExplicitly )
|
|
||||||
row.title = row.name;
|
|
||||||
}
|
}
|
||||||
OptionRowHandlers.push_back( hand );
|
OptionRowHandlers.push_back( hand );
|
||||||
}
|
}
|
||||||
@@ -611,6 +602,10 @@ void ScreenOptionsMaster::RefreshIcons()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* XXX: hack to not display text in the song options menu */
|
||||||
|
if( row.bOneChoiceForAllPlayers )
|
||||||
|
sIcon = "";
|
||||||
|
|
||||||
icon.Load( (PlayerNumber)p, sIcon, false );
|
icon.Load( (PlayerNumber)p, sIcon, false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user