Loop plus post increment trickery.
This commit is contained in:
@@ -13,18 +13,19 @@ void ScreenSelectLanguage::Init()
|
|||||||
THEME->GetLanguages( vs );
|
THEME->GetLanguages( vs );
|
||||||
SortRStringArray( vs, true );
|
SortRStringArray( vs, true );
|
||||||
|
|
||||||
FOREACH_CONST( RString, vs, s )
|
int index = 0;
|
||||||
|
for (RString const &s : vs)
|
||||||
{
|
{
|
||||||
const LanguageInfo *pLI = GetLanguageInfo( *s );
|
const LanguageInfo *pLI = GetLanguageInfo( s );
|
||||||
|
|
||||||
GameCommand gc;
|
GameCommand gc;
|
||||||
gc.m_iIndex = s - vs.begin();
|
gc.m_iIndex = index++;
|
||||||
gc.m_sName = *s;
|
gc.m_sName = s;
|
||||||
gc.m_bInvalid = false;
|
gc.m_bInvalid = false;
|
||||||
if( pLI )
|
if( pLI )
|
||||||
gc.m_sText = THEME->GetString("NativeLanguageNames", pLI->szEnglishName);
|
gc.m_sText = THEME->GetString("NativeLanguageNames", pLI->szEnglishName);
|
||||||
else
|
else
|
||||||
gc.m_sText = *s;
|
gc.m_sText = s;
|
||||||
|
|
||||||
m_aGameCommands.push_back( gc );
|
m_aGameCommands.push_back( gc );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user