add compile-time flag to disable selection of tiles in tray (other

than as part of an exchange) and to remove feature where tapping empty
cell moves selected tile there.  This is to address user confusion on
Android, and I'll ask for testing before putting this in the main
branch.  This leaves only place-arrow-then-tap as an alternative to
drag-and-drop, and may annoy people.  Worth trying: disable only the
automatic selection of another tile after the selected one is dropped.
This commit is contained in:
Andy2 2011-01-12 18:31:59 -08:00
parent f538338286
commit b82cca9e8b
2 changed files with 9 additions and 3 deletions

View file

@ -2286,6 +2286,7 @@ board_handlePenMove( BoardCtxt* board, XP_U16 xx, XP_U16 yy )
return result; return result;
} /* board_handlePenMove */ } /* board_handlePenMove */
#ifndef DISABLE_TILE_SEL
/* Called when user taps on the board and a tray tile's selected. /* Called when user taps on the board and a tray tile's selected.
*/ */
static XP_Bool static XP_Bool
@ -2320,6 +2321,7 @@ moveSelTileToBoardXY( BoardCtxt* board, XP_U16 col, XP_U16 row )
return result; return result;
} /* moveSelTileToBoardXY */ } /* moveSelTileToBoardXY */
#endif
XP_Bool XP_Bool
cellOccupied( const BoardCtxt* board, XP_U16 col, XP_U16 row, cellOccupied( const BoardCtxt* board, XP_U16 col, XP_U16 row,
@ -2412,7 +2414,10 @@ tryReplaceTile( BoardCtxt* board, XP_U16 pencol, XP_U16 penrow )
static XP_Bool static XP_Bool
handleActionInCell( BoardCtxt* board, XP_U16 col, XP_U16 row, XP_Bool isPen ) handleActionInCell( BoardCtxt* board, XP_U16 col, XP_U16 row, XP_Bool isPen )
{ {
return moveSelTileToBoardXY( board, col, row ) return XP_FALSE
#ifndef DISABLE_TILE_SEL
|| moveSelTileToBoardXY( board, col, row )
#endif
|| tryMoveArrow( board, col, row ) || tryMoveArrow( board, col, row )
|| (!isPen && tryReplaceTile( board, col, row )) || (!isPen && tryReplaceTile( board, col, row ))
; ;

View file

@ -372,7 +372,6 @@ static XP_Bool
handleActionInTray( BoardCtxt* board, XP_S16 index, XP_Bool onDivider ) handleActionInTray( BoardCtxt* board, XP_S16 index, XP_Bool onDivider )
{ {
XP_Bool result = XP_FALSE; XP_Bool result = XP_FALSE;
const XP_U16 selPlayer = board->selPlayer;
PerTurnInfo* pti = board->selInfo; PerTurnInfo* pti = board->selInfo;
if ( onDivider ) { if ( onDivider ) {
@ -387,6 +386,7 @@ handleActionInTray( BoardCtxt* board, XP_S16 index, XP_Bool onDivider )
} }
} else if ( index >= 0 ) { } else if ( index >= 0 ) {
result = moveTileToArrowLoc( board, (XP_U8)index ); result = moveTileToArrowLoc( board, (XP_U8)index );
#ifndef DISABLE_TILE_SEL
if ( !result ) { if ( !result ) {
TileBit newBits = 1 << index; TileBit newBits = 1 << index;
XP_U8 selBits = pti->traySelBits; XP_U8 selBits = pti->traySelBits;
@ -398,7 +398,7 @@ handleActionInTray( BoardCtxt* board, XP_S16 index, XP_Bool onDivider )
pti->traySelBits = NO_TILES; pti->traySelBits = NO_TILES;
} else if ( selBits != 0 ) { } else if ( selBits != 0 ) {
XP_U16 selIndex = indexForBits( selBits ); XP_U16 selIndex = indexForBits( selBits );
model_moveTileOnTray( board->model, selPlayer, model_moveTileOnTray( board->model, board->selPlayer,
selIndex, index ); selIndex, index );
pti->traySelBits = NO_TILES; pti->traySelBits = NO_TILES;
} else { } else {
@ -410,6 +410,7 @@ handleActionInTray( BoardCtxt* board, XP_S16 index, XP_Bool onDivider )
pti->dividerSelected = XP_FALSE; pti->dividerSelected = XP_FALSE;
result = XP_TRUE; result = XP_TRUE;
} }
#endif
} else if ( index == -(MAX_TRAY_TILES) ) { /* pending score tile */ } else if ( index == -(MAX_TRAY_TILES) ) { /* pending score tile */
result = board_commitTurn( board ); result = board_commitTurn( board );
#ifndef DISABLE_EMPTYTRAY_UNDO #ifndef DISABLE_EMPTYTRAY_UNDO