mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-11 08:48:06 +01:00
Return true on preflight for cursor move so will get called again.
Fixes tray nav on Palm.
This commit is contained in:
parent
5fb7bb95d4
commit
2d024b506d
1 changed files with 9 additions and 11 deletions
|
@ -565,8 +565,8 @@ tray_moveCursor( BoardCtxt* board, XP_Key cursorKey, XP_Bool preflightOnly,
|
||||||
|
|
||||||
if ( cursorKey == XP_CURSOR_KEY_UP || cursorKey == XP_CURSOR_KEY_DOWN ) {
|
if ( cursorKey == XP_CURSOR_KEY_UP || cursorKey == XP_CURSOR_KEY_DOWN ) {
|
||||||
up = XP_TRUE;
|
up = XP_TRUE;
|
||||||
} else if ( cursorKey == XP_CURSOR_KEY_RIGHT
|
} else if ( (cursorKey == XP_CURSOR_KEY_RIGHT)
|
||||||
|| cursorKey == XP_CURSOR_KEY_LEFT ) {
|
|| (cursorKey == XP_CURSOR_KEY_LEFT) ) {
|
||||||
XP_S16 delta = cursorKey == XP_CURSOR_KEY_RIGHT ? 1 : -1;
|
XP_S16 delta = cursorKey == XP_CURSOR_KEY_RIGHT ? 1 : -1;
|
||||||
const XP_U16 selPlayer = board->selPlayer;
|
const XP_U16 selPlayer = board->selPlayer;
|
||||||
PerTurnInfo* pti = board->selInfo;
|
PerTurnInfo* pti = board->selInfo;
|
||||||
|
@ -618,11 +618,8 @@ tray_moveCursor( BoardCtxt* board, XP_Key cursorKey, XP_Bool preflightOnly,
|
||||||
/* fix this!!! */
|
/* fix this!!! */
|
||||||
board->dividerInvalid = XP_TRUE;
|
board->dividerInvalid = XP_TRUE;
|
||||||
board_invalTrayTiles( board, ALLTILES );
|
board_invalTrayTiles( board, ALLTILES );
|
||||||
|
|
||||||
draw = XP_TRUE;
|
|
||||||
}
|
}
|
||||||
} else {
|
draw = XP_TRUE;
|
||||||
draw = XP_FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
*pUp = up;
|
*pUp = up;
|
||||||
|
@ -635,7 +632,8 @@ tray_moveCursor( BoardCtxt* board, XP_Key cursorKey, XP_Bool preflightOnly,
|
||||||
{
|
{
|
||||||
XP_Bool draw = XP_FALSE;
|
XP_Bool draw = XP_FALSE;
|
||||||
XP_Bool up = XP_FALSE;
|
XP_Bool up = XP_FALSE;
|
||||||
XP_U16 selPlayer = board->selPlayer;
|
const XP_U16 selPlayer = board->selPlayer;
|
||||||
|
PerTurnInfo* pti = board->selInfo;
|
||||||
XP_S16 pos;
|
XP_S16 pos;
|
||||||
TileBit what = 0;
|
TileBit what = 0;
|
||||||
|
|
||||||
|
@ -656,8 +654,8 @@ tray_moveCursor( BoardCtxt* board, XP_Key cursorKey, XP_Bool preflightOnly,
|
||||||
break;
|
break;
|
||||||
case XP_CURSOR_KEY_RIGHT:
|
case XP_CURSOR_KEY_RIGHT:
|
||||||
case XP_CURSOR_KEY_LEFT:
|
case XP_CURSOR_KEY_LEFT:
|
||||||
what = what | (1 << board->trayCursorLoc[selPlayer]);
|
what = what | (1 << pti->trayCursorLoc);
|
||||||
pos = board->trayCursorLoc[selPlayer];
|
pos = pti->trayCursorLoc;
|
||||||
/* Loop in order to skip all empty tile slots but one */
|
/* Loop in order to skip all empty tile slots but one */
|
||||||
for ( ; ; ) {
|
for ( ; ; ) {
|
||||||
pos += (cursorKey == XP_CURSOR_KEY_RIGHT ? 1 : -1);
|
pos += (cursorKey == XP_CURSOR_KEY_RIGHT ? 1 : -1);
|
||||||
|
@ -675,14 +673,14 @@ tray_moveCursor( BoardCtxt* board, XP_Key cursorKey, XP_Bool preflightOnly,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( !preflightOnly ) {
|
if ( !preflightOnly ) {
|
||||||
board->trayCursorLoc[selPlayer] = pos;
|
pti->trayCursorLoc = pos;
|
||||||
what = what | (1 << pos);
|
what = what | (1 << pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ( !preflightOnly ) {
|
if ( !preflightOnly ) {
|
||||||
what = what | (1 << board->trayCursorLoc[selPlayer]);
|
what = what | (1 << pti->trayCursorLoc);
|
||||||
board_invalTrayTiles( board, what );
|
board_invalTrayTiles( board, what );
|
||||||
}
|
}
|
||||||
draw = XP_TRUE;
|
draw = XP_TRUE;
|
||||||
|
|
Loading…
Add table
Reference in a new issue