mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-27 07:58:49 +01:00
add pref controlling whether can switch to look at tray of user whose
turn it isn't
This commit is contained in:
parent
8da9a1e8fa
commit
5b8cf716b3
4 changed files with 12 additions and 7 deletions
|
@ -421,7 +421,9 @@ board_prefsChanged( BoardCtxt* board, CommonPrefs* cp )
|
|||
board->disableArrow = !cp->showBoardArrow;
|
||||
board->hideValsInTray = cp->hideTileValues;
|
||||
board->skipCommitConfirm = cp->skipCommitConfirm;
|
||||
board->allowPeek = cp->allowPeek;
|
||||
board->showColors = cp->showColors;
|
||||
board->allowPeek = cp->allowPeek;
|
||||
|
||||
if ( showArrowChanged ) {
|
||||
showArrowChanged = setArrowVisible( board, XP_FALSE );
|
||||
|
@ -814,7 +816,8 @@ board_commitTurn( BoardCtxt* board )
|
|||
* singletons that may have to be hidden or shown.
|
||||
*/
|
||||
static void
|
||||
selectPlayerImpl( BoardCtxt* board, XP_U16 newPlayer, XP_Bool reveal )
|
||||
selectPlayerImpl( BoardCtxt* board, XP_U16 newPlayer, XP_Bool reveal,
|
||||
XP_Bool canPeek )
|
||||
{
|
||||
if ( !board->gameOver && server_getCurrentTurn(board->server) < 0 ) {
|
||||
/* game not started yet; do nothing */
|
||||
|
@ -822,7 +825,7 @@ selectPlayerImpl( BoardCtxt* board, XP_U16 newPlayer, XP_Bool reveal )
|
|||
if ( reveal ) {
|
||||
checkRevealTray( board );
|
||||
}
|
||||
} else {
|
||||
} else if ( canPeek ) {
|
||||
PerTurnInfo* newInfo = &board->pti[newPlayer];
|
||||
XP_U16 oldPlayer = board->selPlayer;
|
||||
model_foreachPendingCell( board->model, newPlayer,
|
||||
|
@ -872,9 +875,9 @@ selectPlayerImpl( BoardCtxt* board, XP_U16 newPlayer, XP_Bool reveal )
|
|||
} /* selectPlayerImpl */
|
||||
|
||||
void
|
||||
board_selectPlayer( BoardCtxt* board, XP_U16 newPlayer )
|
||||
board_selectPlayer( BoardCtxt* board, XP_U16 newPlayer, XP_Bool canSwitch )
|
||||
{
|
||||
selectPlayerImpl( board, newPlayer, XP_TRUE );
|
||||
selectPlayerImpl( board, newPlayer, XP_TRUE, canSwitch );
|
||||
} /* board_selectPlayer */
|
||||
|
||||
void
|
||||
|
@ -3308,7 +3311,7 @@ boardTurnChanged( void* p_board )
|
|||
nextPlayer = chooseBestSelPlayer( board );
|
||||
if ( nextPlayer >= 0 ) {
|
||||
XP_U16 nHumans = gi_countLocalHumans( board->gi );
|
||||
selectPlayerImpl( board, nextPlayer, nHumans <= 1 );
|
||||
selectPlayerImpl( board, nextPlayer, nHumans <= 1, XP_TRUE );
|
||||
}
|
||||
|
||||
setTimerIf( board );
|
||||
|
|
|
@ -173,6 +173,7 @@ struct BoardCtxt {
|
|||
XP_Bool disableArrow;
|
||||
XP_Bool hideValsInTray;
|
||||
XP_Bool skipCommitConfirm;
|
||||
XP_Bool allowPeek; /* Can look at non-turn player's rack */
|
||||
|
||||
XP_Bool eraseTray;
|
||||
XP_Bool boardObscuresTray;
|
||||
|
@ -246,7 +247,7 @@ void figureTrayTileRect( BoardCtxt* board, XP_U16 index, XP_Rect* rect );
|
|||
XP_Bool rectsIntersect( const XP_Rect* rect1, const XP_Rect* rect2 );
|
||||
XP_S16 pointToTileIndex( BoardCtxt* board, XP_U16 x, XP_U16 y,
|
||||
XP_Bool* onDividerP );
|
||||
void board_selectPlayer( BoardCtxt* board, XP_U16 newPlayer );
|
||||
void board_selectPlayer( BoardCtxt* board, XP_U16 newPlayer, XP_Bool canPeek );
|
||||
void flipIf( const BoardCtxt* board, XP_U16 col, XP_U16 row,
|
||||
XP_U16* fCol, XP_U16* fRow );
|
||||
XP_Bool pointOnSomething( BoardCtxt* board, XP_U16 x, XP_U16 y,
|
||||
|
|
|
@ -135,6 +135,7 @@ typedef struct CommonPrefs {
|
|||
XP_U16 robotThinkMin, robotThinkMax;
|
||||
#endif
|
||||
XP_Bool showColors; /* applies to all games */
|
||||
XP_Bool allowPeek; /* applies to all games */
|
||||
} CommonPrefs;
|
||||
|
||||
#ifdef XWFEATURE_BLUETOOTH
|
||||
|
|
|
@ -324,7 +324,7 @@ handlePenUpScore( BoardCtxt* board, XP_U16 xx, XP_U16 yy )
|
|||
if ( rectNum == CURSOR_LOC_REM ) {
|
||||
util_remSelected( board->util );
|
||||
} else if ( --rectNum >= 0 ) {
|
||||
board_selectPlayer( board, rectNum );
|
||||
board_selectPlayer( board, rectNum, board->allowPeek );
|
||||
} else {
|
||||
result = XP_FALSE;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue