When showing cell values, also show tile values if the don't-show tile values preference is set.

This commit is contained in:
ehouse 2007-04-06 01:41:16 +00:00
parent 128d9c56ef
commit 13803e2596
3 changed files with 14 additions and 3 deletions

View file

@ -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

View file

@ -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) ){

View file

@ -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 );