diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/jni/DUtilCtxt.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/jni/DUtilCtxt.java index 4f2eb923e..a3ea4b68d 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/jni/DUtilCtxt.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/jni/DUtilCtxt.java @@ -121,6 +121,7 @@ public class DUtilCtxt { private static final int STR_DUP_MOVED = 27; private static final int STRD_DUP_TRADED = 28; private static final int STRSD_DUP_ONESCORE = 29; + private static final int STR_PENDING_PLAYER = 30; public String getUserString( int stringCode ) { @@ -207,6 +208,10 @@ public class DUtilCtxt { id = R.string.dup_onescore_fmt; break; + case STR_PENDING_PLAYER: + id = R.string.missing_player; + break; + default: Log.w( TAG, "no such stringCode: %d", stringCode ); } diff --git a/xwords4/android/jni/LocalizedStrIncludes.h b/xwords4/android/jni/LocalizedStrIncludes.h index d9dc9e96e..1eaf98af4 100644 --- a/xwords4/android/jni/LocalizedStrIncludes.h +++ b/xwords4/android/jni/LocalizedStrIncludes.h @@ -33,6 +33,6 @@ # define STR_DUP_MOVED 27 # define STRD_DUP_TRADED 28 # define STRSD_DUP_ONESCORE 29 - -# define N_AND_USER_STRINGS 29 +# define STR_PENDING_PLAYER 30 +# define N_AND_USER_STRINGS 30 #endif diff --git a/xwords4/common/scorebdp.c b/xwords4/common/scorebdp.c index 63b920bc1..42d57ea9d 100644 --- a/xwords4/common/scorebdp.c +++ b/xwords4/common/scorebdp.c @@ -23,6 +23,7 @@ #include "game.h" #include "strutils.h" #include "dbgutil.h" +#include "LocalizedStrIncludes.h" #ifdef CPLUS extern "C" { @@ -244,8 +245,10 @@ drawScoreBoard( BoardCtxt* board ) /* figure spacing for each scoreboard entry */ XP_MEMSET( &datum, 0, sizeof(datum) ); totalDim = 0; + XP_U16 missingPlayers = server_getMissingPlayers( board->server ); for ( dp = datum, ii = 0; ii < nPlayers; ++ii, ++dp ) { LocalPlayer* lp = &board->gi->players[ii]; + XP_Bool isMissing = 0 != ((1 << ii) & missingPlayers); /* This is a hack! */ dp->dsi.lsc = board_ScoreCallback; @@ -258,11 +261,16 @@ drawScoreBoard( BoardCtxt* board ) dp->dsi.playerNum = ii; dp->dsi.totalScore = scores.arr[ii]; dp->dsi.isTurn = server_isPlayersTurn( board->server, ii ); - dp->dsi.name = emptyStringIfNull(lp->name); dp->dsi.selected = board->trayVisState != TRAY_HIDDEN && ii==selPlayer; dp->dsi.isRobot = LP_IS_ROBOT(lp); dp->dsi.isRemote = !lp->isLocal; + XP_ASSERT( !isMissing || dp->dsi.isRemote ); + if ( dp->dsi.isRemote && isMissing ) { + dp->dsi.name = dutil_getUserString( board->dutil, STR_PENDING_PLAYER ); + } else { + dp->dsi.name = emptyStringIfNull( lp->name ); + } dp->dsi.nTilesLeft = (nTilesInPool > 0)? -1: model_getNumTilesTotal( model, ii ); diff --git a/xwords4/linux/LocalizedStrIncludes.h b/xwords4/linux/LocalizedStrIncludes.h index a508b4215..30bcb2a2e 100644 --- a/xwords4/linux/LocalizedStrIncludes.h +++ b/xwords4/linux/LocalizedStrIncludes.h @@ -30,8 +30,7 @@ enum { STR_SUBMIT_CONFIRM, STRD_TURN_SCORE, STR_BONUS_ALL, - STR_NONLOCAL_NAME, - STR_LOCAL_NAME, + STR_PENDING_PLAYER, STRD_TIME_PENALTY_SUB, STRD_CUMULATIVE_SCORE, @@ -46,10 +45,6 @@ enum { STR_ROBOT_MOVED, STRS_REMOTE_MOVED, - STR_LOCALPLAYERS, - STR_TOTALPLAYERS, - STR_REMOTE, - STRS_VALUES_HEADER, STRD_REMAINS_HEADER, STRD_REMAINS_EXPL, @@ -64,6 +59,11 @@ enum { STRD_DUP_TRADED, STRSD_DUP_ONESCORE, + /* These three aren't in Android */ + STR_LOCALPLAYERS, + STR_TOTALPLAYERS, + STR_REMOTE, + STR_LAST }; diff --git a/xwords4/linux/lindutil.c b/xwords4/linux/lindutil.c index d4c372640..492c8238b 100644 --- a/xwords4/linux/lindutil.c +++ b/xwords4/linux/lindutil.c @@ -146,10 +146,8 @@ linux_dutil_getUserString( XW_DUtilCtxt* XP_UNUSED(uc), XP_U16 code ) return (XP_UCHAR*)"Score for turn: %d\n"; case STR_BONUS_ALL: return (XP_UCHAR*)"Bonus for using all tiles: 50\n"; - case STR_LOCAL_NAME: - return (XP_UCHAR*)"%s"; - case STR_NONLOCAL_NAME: - return (XP_UCHAR*)"%s (remote)"; + case STR_PENDING_PLAYER: + return (XP_UCHAR*)"(remote)"; case STRD_TIME_PENALTY_SUB: return (XP_UCHAR*)" - %d [time]"; /* added.... */