mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-04 23:02:02 +01:00
up/down arrow keys move divider
This commit is contained in:
parent
b9d411c708
commit
bbd8d917bc
1 changed files with 14 additions and 10 deletions
|
@ -103,6 +103,8 @@ drawTray( BoardCtxt* board, XP_Bool focussed )
|
||||||
XP_Rect tileRect;
|
XP_Rect tileRect;
|
||||||
short i;
|
short i;
|
||||||
|
|
||||||
|
XP_LOGF( "drawTray" );
|
||||||
|
|
||||||
if ( (board->trayInvalBits != 0) || board->dividerInvalid ) {
|
if ( (board->trayInvalBits != 0) || board->dividerInvalid ) {
|
||||||
XP_S16 turn = board->selPlayer;
|
XP_S16 turn = board->selPlayer;
|
||||||
|
|
||||||
|
@ -118,6 +120,7 @@ drawTray( BoardCtxt* board, XP_Bool focussed )
|
||||||
if ( (board->trayVisState != TRAY_HIDDEN) && dictionary != NULL ) {
|
if ( (board->trayVisState != TRAY_HIDDEN) && dictionary != NULL ) {
|
||||||
XP_Bool showFaces = board->trayVisState == TRAY_REVEALED;
|
XP_Bool showFaces = board->trayVisState == TRAY_REVEALED;
|
||||||
|
|
||||||
|
XP_LOGF( "turn=%d", turn );
|
||||||
if ( turn >= 0 ) {
|
if ( turn >= 0 ) {
|
||||||
XP_U16 numInTray = showFaces?
|
XP_U16 numInTray = showFaces?
|
||||||
model_getNumTilesInTray( board->model, turn ):
|
model_getNumTilesInTray( board->model, turn ):
|
||||||
|
@ -632,6 +635,7 @@ board_juggleTray( BoardCtxt* board )
|
||||||
XP_Bool
|
XP_Bool
|
||||||
tray_moveCursor( BoardCtxt* board, XP_Key cursorKey )
|
tray_moveCursor( BoardCtxt* board, XP_Key cursorKey )
|
||||||
{
|
{
|
||||||
|
XP_Bool result;
|
||||||
XP_U16 selPlayer = board->selPlayer;
|
XP_U16 selPlayer = board->selPlayer;
|
||||||
XP_U16 numTrayTiles = model_getNumTilesInTray( board->model,
|
XP_U16 numTrayTiles = model_getNumTilesInTray( board->model,
|
||||||
selPlayer );
|
selPlayer );
|
||||||
|
@ -641,13 +645,10 @@ tray_moveCursor( BoardCtxt* board, XP_Key cursorKey )
|
||||||
|
|
||||||
numTrayTiles = MAX_TRAY_TILES;
|
numTrayTiles = MAX_TRAY_TILES;
|
||||||
|
|
||||||
if ( oldSel == 0 ) {
|
if ( cursorKey == XP_CURSOR_KEY_UP ) {
|
||||||
if ( cursorKey == XP_CURSOR_KEY_LEFT ) {
|
result = board_moveDivider( board, XP_FALSE );
|
||||||
newSel = 1 << (numTrayTiles - 1);
|
} else if ( cursorKey == XP_CURSOR_KEY_DOWN ) {
|
||||||
} else {
|
result = board_moveDivider( board, XP_TRUE );
|
||||||
XP_ASSERT( cursorKey == XP_CURSOR_KEY_RIGHT );
|
|
||||||
newSel = 1;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
pos = indexForBits( oldSel );
|
pos = indexForBits( oldSel );
|
||||||
|
|
||||||
|
@ -659,10 +660,13 @@ tray_moveCursor( BoardCtxt* board, XP_Key cursorKey )
|
||||||
}
|
}
|
||||||
|
|
||||||
newSel = 1 << (pos % numTrayTiles);
|
newSel = 1 << (pos % numTrayTiles);
|
||||||
}
|
|
||||||
board->trayCursorLoc[selPlayer] = newSel;
|
board->trayCursorLoc[selPlayer] = newSel;
|
||||||
board_invalTrayTiles( board, newSel | oldSel );
|
board_invalTrayTiles( board, newSel | oldSel );
|
||||||
return XP_TRUE;
|
result = XP_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
} /* tray_moveCursor */
|
} /* tray_moveCursor */
|
||||||
|
|
||||||
XP_Bool
|
XP_Bool
|
||||||
|
|
Loading…
Reference in a new issue