assign dicts as soon as language is changed.

This commit is contained in:
Andy2 2011-04-27 06:39:52 -07:00
parent 399fc081d7
commit 9013897a5a
3 changed files with 12 additions and 13 deletions

View file

@ -693,9 +693,9 @@ public class GameConfig extends XWActivity
if ( chosen.equals( m_browseText ) ) {
startActivity( Utils.mkDownloadActivity(GameConfig.this) );
} else {
m_gi.dictLang =
DictLangCache.getLangLangCode( GameConfig.this,
chosen );
m_gi.setLang( DictLangCache.
getLangLangCode( GameConfig.this,
chosen ) );
}
}

View file

@ -352,7 +352,7 @@ public class GameUtils {
byte[] stream = savedGame( context, path );
CurGameInfo gi = new CurGameInfo( context );
XwJNI.gi_from_stream( gi, stream );
final String[] dictNames = gi.dictNames( false );
final String[] dictNames = gi.dictNames();
HashSet<String> missingSet;
String[] installed = dictList( context );

View file

@ -137,6 +137,14 @@ public class CurGameInfo {
m_inProgress = inProgress;
}
public void setLang( int lang )
{
if ( dictLang != lang ) {
dictLang = lang;
assignDicts();
}
}
public int getRobotSmartness()
{
if ( m_smartness == 0 ) {
@ -239,15 +247,6 @@ public class CurGameInfo {
public String[] dictNames()
{
return dictNames( true );
}
public String[] dictNames( boolean assign )
{
if ( assign ) {
assignDicts();
}
String[] result = new String[nPlayers+1];
result[0] = dictName;
for ( int ii = 0; ii < nPlayers; ++ii ) {