mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-28 09:58:30 +01:00
fix bug: need to reset engine when divider moved via keys as well as
when dragged.
This commit is contained in:
parent
37e922e92b
commit
018be047ad
1 changed files with 6 additions and 0 deletions
|
@ -568,6 +568,7 @@ tray_moveCursor( BoardCtxt* board, XP_Key cursorKey, XP_Bool preflightOnly,
|
|||
up = XP_TRUE;
|
||||
} else if ( (cursorKey == XP_CURSOR_KEY_RIGHT)
|
||||
|| (cursorKey == XP_CURSOR_KEY_LEFT) ) {
|
||||
XP_Bool resetEngine = XP_FALSE;
|
||||
XP_S16 delta = cursorKey == XP_CURSOR_KEY_RIGHT ? 1 : -1;
|
||||
const XP_U16 selPlayer = board->selPlayer;
|
||||
PerTurnInfo* pti = board->selInfo;
|
||||
|
@ -594,12 +595,14 @@ tray_moveCursor( BoardCtxt* board, XP_Key cursorKey, XP_Bool preflightOnly,
|
|||
} else if ( cursorOnDivider ) {
|
||||
/* just drag the divider */
|
||||
pti->dividerLoc = newLoc;
|
||||
resetEngine = XP_TRUE;
|
||||
} else if ( pti->tradeInProgress ) {
|
||||
/* nothing to do */
|
||||
} else {
|
||||
/* drag the tile, skipping over the divider if needed */
|
||||
if ( (newLoc == pti->dividerLoc) && (newLoc > 0) ) {
|
||||
newLoc += delta;
|
||||
resetEngine = XP_TRUE;
|
||||
}
|
||||
newTileLoc = newLoc;
|
||||
adjustForDivider( board, &newTileLoc );
|
||||
|
@ -635,6 +638,9 @@ tray_moveCursor( BoardCtxt* board, XP_Key cursorKey, XP_Bool preflightOnly,
|
|||
/* fix this!!! */
|
||||
board->dividerInvalid = XP_TRUE;
|
||||
board_invalTrayTiles( board, ALLTILES );
|
||||
if ( resetEngine ) {
|
||||
board_resetEngine( board );
|
||||
}
|
||||
}
|
||||
draw = XP_TRUE;
|
||||
|
||||
|
|
Loading…
Reference in a new issue