diff --git a/xwords4/common/board.c b/xwords4/common/board.c index 5c99163fb..96808b709 100644 --- a/xwords4/common/board.c +++ b/xwords4/common/board.c @@ -1545,8 +1545,18 @@ board_flip( BoardCtxt* board ) XP_Bool board_toggle_showValues( BoardCtxt* board ) { + XP_Bool changed; board->showCellValues = !board->showCellValues; - return invalCellsWithTiles( board ); + + /* We show the tile values when showCellValues is set even if + hideValsInTray is set. So inval the tray if there will be a change. + And set changed to true in case there are no tiles on the baord yet. + */ + changed = board->hideValsInTray && (board->trayVisState == TRAY_REVEALED); + if ( changed ) { + board_invalTrayTiles( board, ALLTILES ); + } + return invalCellsWithTiles( board ) || changed; } /* board_toggle_showValues */ XP_Bool diff --git a/xwords4/common/server.c b/xwords4/common/server.c index 72c31743e..78483bbd8 100644 --- a/xwords4/common/server.c +++ b/xwords4/common/server.c @@ -1531,7 +1531,7 @@ nextTurn( ServerCtxt* server, XP_S16 nxtTurn ) "has" enough to be allowed to take the turn just undone. */ playerTilesLeft = MAX_TRAY_TILES; } - SETSTATE( server, XWSTATE_INTURN ); /* unless game over */ + SETSTATE( server, XWSTATE_INTURN ); /* even if game over, if undoing */ if ( (playerTilesLeft > 0) && tileCountsOk(server) && NPASSES_OK(server) ){ diff --git a/xwords4/common/tray.c b/xwords4/common/tray.c index 8cfe7fbc4..040d3ccf4 100644 --- a/xwords4/common/tray.c +++ b/xwords4/common/tray.c @@ -172,7 +172,8 @@ drawTray( BoardCtxt* board ) dict_tilesToString( dictionary, &tile, 1, textP, sizeof(buf) ); } - if ( board->hideValsInTray ) { + if ( board->hideValsInTray + && !board->showCellValues ) { value = -1; } else { value = dict_getTileValue( dictionary, tile );