Commit graph

56 commits

Author SHA1 Message Date
Andy2
cd5dedfa67 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.
2011-01-12 19:00:48 -08:00
Andy2
4a12f7a96f Revert "in attempt to work around non-random rand() in jni world, call back"
This reverts commit 99c92e779d.

Conflicts:

	xwords4/android/XWords4/jni/utilwrapper.c
2010-12-07 18:43:53 -08:00
Andy2
99c92e779d in attempt to work around non-random rand() in jni world, call back
into the java world by making it a util_ctxt function.  Do same on
linux to test.  We'll see how it is -- and can back this commit out if
there's no improvement.
2010-12-02 19:02:36 -08:00
Eric House
34ecac303a make optional and then turn off feature whereby tap in empty part of
tray undoes current move.  It's too easy to hit this on a capacitive
display.
2010-06-06 13:32:12 -07:00
ehouse
641ae18864 Use new dict api to support utf8 faces. 2009-04-05 19:20:22 +00:00
ehouse
c754726b0f Don't pass valid bitmaps ptr when drawing blank tile. 2009-01-17 18:24:18 +00:00
ehouse
6d7a81fce6 change draw api so all available bitmaps (only 2 in current format)
can be passed for tile and cell drawing
2009-01-13 12:57:56 +00:00
ehouse
13001301ec Indicate tiles whose values should be hidden with a new bit rather
than a negative value.
2008-12-13 07:32:53 +00:00
ehouse
d3d3dd561f Pass string for tile even when it has a bitmap. Let platform decide which to use. 2008-12-04 06:13:59 +00:00
ehouse
542e441b69 hide focus when pen used, but remember where it was (don't set to
OBJ_NONE) so can replace it when focus keys used again.
2008-11-22 16:37:29 +00:00
ehouse
46b574b4e7 fix inval of focussed tile to take divider into account. 2008-11-20 05:12:48 +00:00
ehouse
4ff04dac84 When tray's not revealed, cursor should travel over all tiles to be
consistent with display of 7 tiles even if some are really on board.
2008-10-31 04:30:58 +00:00
ehouse
bbe8cceb6e debug changes: change defines to remove gremlin-only code; add missing constants. 2008-10-11 16:46:08 +00:00
ehouse
018be047ad fix bug: need to reset engine when divider moved via keys as well as
when dragged.
2008-10-10 08:38:23 +00:00
ehouse
eb1f083a19 Require two key events to reveal tray and act on a tile; don't treat
divider as wider (to make it easier to tap on) when keyboard being
used to select.
2008-09-18 03:53:53 +00:00
ehouse
6c5e3b7149 draw divider focussed when all of tray has focus 2008-07-28 05:04:34 +00:00
ehouse
0c751cc4d1 Add feature lost when five-way drag of divider became possible: don't
allow focus rect to stop on any empty tray slot but the leftmost.
2008-07-24 12:39:46 +00:00
ehouse
47088c8030 Return true on preflight for cursor move so will get called again.
Fixes tray nav on Palm.
2008-07-18 09:05:04 +00:00
ehouse
c20e85eccd combine all per-player arrays in board into a single array of structs.
access can then be via a ptr, more effecient and faster.  The change
seems to save 1K of generated code.  No changes to algorithms, only to
field access.
2008-07-18 07:49:00 +00:00
ehouse
5422b82fd3 Implement new model for focus/tray interaction aimed at smartphones
with five-ways and no obvious alt key.  Focus once dived into tray
moves over tiles *and* divider.  Tap of center key toggles
selectedness of object under focus.  Movement of focus when object is
selected drags the object (tile or divider) unless in trade mode.
This is easier to discover and behaves more like drag-and-drop -- and
lets you move the divider.  Works for linux and win32.  Key nav in
tray is broken on palm.
2008-07-17 05:16:09 +00:00
ehouse
f749fdd560 Remove all tabs. No code changes. 2008-05-31 03:26:16 +00:00
ehouse
6280129788 Fix bug that number key tries to move tile to board even during trade.
Generalize use of number to select tile in tray so that during trade
keys will toggle selected tiles.  Letters too.
2008-05-19 01:18:43 +00:00
ehouse
6c81a63fce redraw tray (if dirty) even if hidden. On wince at least this
prevents the bottoms of the tiles from peeking out from under a
partially obscuring board, giving away information.  In cases where
the board completely hides the tray this is unnecessary, but making
that optimiztion can come later.  This is a bug.
2008-04-14 01:31:53 +00:00
ehouse
123923fd4b rewrite invalCellsUnderRect to be less stupid: start from rect passed
in rather than whole board.
2008-03-14 09:20:26 +00:00
ehouse
0b1f4b8f0a merge with drag_n_drop branch: apply patch generated with this command on that branch: svn diff -r 2080:2087 2008-03-08 23:16:21 +00:00
ehouse
13803e2596 When showing cell values, also show tile values if the don't-show tile values preference is set. 2007-04-06 01:41:16 +00:00
ehouse
0a426b0876 Get rid of draw_eraseMiniWindow: just inval what's under it; make use
of CELL_ISCURSOR consistent: when focus not dived all elements have it
set (or only perimeter for board, settable at compile time); get rid
of draw_drawCursor since CELL_ISCURSOR is all that's needed;
2007-01-19 08:20:11 +00:00
ehouse
f329966a8a on keyDown, look at what keyUp will do and, if nothing, don't handle
the event.  This lets focus transfer work as before there was keyDown.
2007-01-12 03:28:20 +00:00
ehouse
994ee5b254 remove dead code. 2007-01-09 02:38:22 +00:00
ehouse
0303e56c43 Break key handling into keyUp and keyDown, and treat keyDown the same
as penDown.  Idea is to be able to set timers to get bonus square
hints etc. without stylus.  Works, but transitions are rough because
keyDown doesn't know whether keyUp will result in a focus change.
2007-01-06 17:32:08 +00:00
ehouse
7fe5718cc5 When "dived" focus reaches and crosses border of object, return as if
not handled.  This causes the platform to handle the key event itself,
typically by moving the focus to the next top-level object.
2006-11-17 13:41:13 +00:00
ehouse
abca6a4092 Two big changes. Pass focus bit into all or and players when focus
not dived and tray or scoreboard focussed.  This lets platform decide
to display top-level focus via mods to all elements.  Second, when
moving focus to top level from dived, claim not to have handled the
key event (but return true if needs redraw).  This allows platform to
handle shifting focus without requiring callback (which removed.)
2006-11-14 06:46:04 +00:00
ehouse
d3812271a2 Add to draw APIs of individual elements (e.g. board cells) whether
they're focussed so that they can draw that during rather than after
everything else.  On palm, use this to draw focus using the system
selected color rather than with the blue nav rect.  Since a new param
was too much, add new enum type CellFlags and pass as bitvector to
draw APIs.
2006-11-12 14:36:15 +00:00
ehouse
b171900dfb When moving focus through tray, skip empty space; when through board,
skip cells with tiles permanently played.  Space char raises focus but does
not move it laterally.
2006-11-09 06:05:40 +00:00
ehouse
2aa9664884 When internal focus reaches edge of object, move it back up and onto
the next object using a callback to the platform to determine what, if
any, object is next.  Adjust curses platform to cooperate.  Works
well.  Palm is next.
2006-11-07 05:46:44 +00:00
ehouse
44eaa36319 More progress on one-handed navigation: fix ncurses board clipped to
bottom of tray; add focus-related params to draw*Finished routines
(and simplify to one) so platforms don't have to save from Begin
routines (and stop palm doing that); check version of saved game, and
handle case where older binary tries to open newer version; redraw
Palm tray buttons after focus change to stop focus-rect ghosting; fix
annoying overlap in saved games dialog; palm version goes to a3.
2006-11-05 16:54:18 +00:00
ehouse
3153e2b867 Lots of progress on one-handed navigation: add gadgets to stand in for board
scoreboard and tray on palm; make center drill into the focussed object and
spacebar come back up then move the focus among them.  Integrate with other
focussable objects on main form.  Go from separate drawCursor routines to
same for all three, with cursor only visible when focus is drilled down.
On curses, add a hilite rect routine that can be called after text is laid
down, and use for cursors.
2006-11-03 06:23:54 +00:00
ehouse
a5f71143c0 Fix crash on pre-fiveway palmos where FrmGetFocus always returns -1;
add new preference for whether small value nums are drawn in tiles in
tray.
2006-10-29 17:41:14 +00:00
ehouse
7614d971c1 randIntArray runs once and returns whether array is modified. Tray calls
again until it is.  newgame calls once: it's possible that juggling won't
do anything.  Still pending: do we tell users when nothing changed, or
leave them to figure out that it's not a bug?
2006-06-27 06:30:44 +00:00
ehouse
15df92fc65 add missing include file 2006-06-22 03:36:51 +00:00
ehouse
f60dade9a0 move randIntArray to strutils, and use instead of similar code to juggle tiles in tray. 2006-06-16 01:19:11 +00:00
ehouse
92485783af update email address in header comments: no code change 2006-01-08 01:25:02 +00:00
ehouse
dc84bd22df dict_tilesToString sig change 2005-07-08 03:02:31 +00:00
ehouse
272e66e635 nuke logging that was polluting ncurses screen 2005-03-19 21:44:35 +00:00
ehouse
66eeeae7d6 change trayCursorLoc to be a 3-bit number so stores smaller 2005-01-23 17:28:29 +00:00
ehouse
333c795f3c kill log statement 2005-01-23 08:20:13 +00:00
ehouse
bbd8d917bc up/down arrow keys move divider 2005-01-04 03:11:56 +00:00
ehouse
6e53150418 always hide arrow when undoing partial move, not just when done from
tray.
2004-07-10 22:57:17 +00:00
ehouse
bb291f1e75 Hide cursor arrow when pen in empty tray region returns tiles to tray. 2004-07-10 22:40:50 +00:00
ehouse
18023ecab3 remove unused variable 2004-06-24 05:19:52 +00:00