always respect user's local player name

This commit is contained in:
Eric House 2019-03-21 09:13:38 -07:00
parent eb79393dc1
commit e799474e00
2 changed files with 7 additions and 3 deletions

View file

@ -27,11 +27,14 @@ import android.os.Build;
import android.preference.PreferenceManager;
import org.eehouse.android.xw4.DictUtils;
import org.eehouse.android.xw4.Log;
import org.eehouse.android.xw4.R;
import org.eehouse.android.xw4.XWPrefs;
import org.eehouse.android.xw4.loc.LocUtils;
public class CommonPrefs extends XWPrefs {
private static final String TAG = CommonPrefs.class.getSimpleName();
public static final int COLOR_TILE_BACK = 0;
public static final int COLOR_NOTILE = 1;
public static final int COLOR_FOCUS = 2;

View file

@ -22,15 +22,16 @@ package org.eehouse.android.xw4.jni;
import android.content.Context;
import android.text.TextUtils;
import java.io.Serializable;
import org.eehouse.android.xw4.Assert;
import org.eehouse.android.xw4.BuildConfig;
import org.eehouse.android.xw4.Log;
import org.eehouse.android.xw4.R;
import org.eehouse.android.xw4.Utils;
public class LocalPlayer implements Serializable {
private static final String TAG = LocalPlayer.class.getSimpleName();
public String name;
public String password;
public String dictName;
@ -42,8 +43,8 @@ public class LocalPlayer implements Serializable {
{
isLocal = true;
robotIQ = 0; // human
String fmt = context.getString( R.string.player_fmt);
name = String.format( fmt, num + 1 );
name = CommonPrefs.getDefaultPlayerName( context, num, true );
Log.d( TAG, "__init(%d) => %s", num, name );
password = "";
// Utils.testSerialization( this );