Allow deletion of picked tiles during face-up picking.

This commit is contained in:
ehouse 2004-05-14 08:57:38 +00:00
parent 36bbf2d254
commit 140f6aaf53
3 changed files with 19 additions and 5 deletions

View file

@ -1376,20 +1376,29 @@ fetchTiles( ServerCtxt* server, XP_U16 playerNum, XP_U16 nToFetch,
model_packTilesUtil( server->vol.model, pool,
XP_TRUE, &nUsed, texts, tiles );
++pi.thisPick;
chosen = util_userPickTile( server->vol.util, &pi,
playerNum, texts, nUsed );
if ( chosen < 0 ) {
if ( chosen == PICKER_PICKALL ) {
ask = XP_FALSE;
} else if ( chosen == PICKER_BACKUP ) {
if ( nSoFar > 0 ) {
TrayTileSet tiles;
tiles.nTiles = 1;
tiles.tiles[0] = resultTiles->tiles[--nSoFar];
pool_replaceTiles( server->pool, &tiles );
--pi.nCurTiles;
--pi.thisPick;
}
} else {
Tile tile = tiles[chosen];
oneTile.tiles[0] = tile;
pool_removeTiles( pool, &oneTile );
(void)dict_tilesToString( dict, &tile, 1, (XP_UCHAR*)&curTray[pi.nCurTiles++] );
(void)dict_tilesToString( dict, &tile, 1,
(XP_UCHAR*)&curTray[pi.nCurTiles++] );
resultTiles->tiles[nSoFar++] = tile;
++pi.thisPick;
}
}
#endif

View file

@ -46,9 +46,10 @@ typedef enum {
users */
#endif
ERR_CANT_TRADE_MID_MOVE,
ERR_CANT_ENGINE_MID_MOVE
ERR_CANT_ENGINE_MID_MOVE,
/* ERR_NOT_YOUR_TURN_TO_TRADE, */
/* ERR_NOT_YOUR_TURN_TO_MOVE, */
ERR_CANT_UNDO_TILEASSIGN
} UtilErrID;
typedef enum {
@ -63,6 +64,9 @@ typedef enum {
, PICK_FOR_CHEAT
} PICK_WHY;
#define PICKER_PICKALL -1
#define PICKER_BACKUP -2
typedef struct PickInfo {
XP_UCHAR4* curTiles;
XP_U16 nCurTiles;

View file

@ -205,6 +205,7 @@
#define XW_BLANK_LABEL_FIELD_ID 2402
#define XW_BLANK_OK_BUTTON_ID 2403
#define XW_BLANK_PICK_BUTTON_ID 2404
#define XW_BLANK_BACKUP_BUTTON_ID 2405
#define XW_COLORS_FACTORY_BUTTON_ID 2520
#define XW_COLORS_OK_BUTTON_ID 2521