Commit graph

292 commits

Author SHA1 Message Date
Eric House
9e66d294a2 tap on pending blank tile brings up picker
It's been annoying to have to move a placed blank to change its
value. No more.
2017-04-08 13:44:59 -07:00
Eric House
6e5973c55b toward making tile picking work through rotations
Make face-up tile picker util method return void and add mechanism for
passing in selected tiles asynchronously, as has been done recently with
the rest of the once-blocking util callbacks. Works perfectly in the gtk
case. Likely crashes in curses (if picking face-up option is on.) In
java all the callbacks are there but rather than put up a UI we pretend
the user says "pick 'em for me" each time. Putting up a UI is next.
2017-03-09 20:36:14 -08:00
Eric House
05d583a324 fix timers: don't clear in snapshot case
Back in August I "fixed" timers running after the board was cleared but
didn't realize that util contexts were shared by snapshot
boards. Clearing those timers when the board's destroyed was stopping
timers for a visible board as well. So I added a boolean indicating
whether to clear timers. Ref counting or similar would be better, but a
lot of work given the concept isn't really in the common/ code at
all (outside of dicts...)
2017-02-27 20:20:25 -08:00
Eric House
ff99e89e9d fix compiler warning 2017-02-22 22:39:32 -08:00
Eric House
c271202faa make bad phonies alert non-blocking
Continue conversion of alerts that required blocking the JNI thread. Now
board_commitTurn() takes a second boolean indicating whether phonies
found have been approved by user. Common code informs user, and if he
approves client code calls board_commitTurn() again. In case where
turn's lost there's no call to make back, but there's the undesirable
change that if a robot moves next its move will be reported on top of
the turn-lost alert. Ideally new alerts would appear under, not on top
of, those that have not yet been dismissed.
2017-02-20 07:20:19 -08:00
Eric House
5f12d1a03b assign faces to blanks asynchronously
Next step in converting util_ methods that required blocking: blank tile
assignment. Now post a query and add a method that the client code can
call when the user's decided. Include enough state (col, row, and
playerNum) so that it's probably pretty safe.
2017-02-18 19:16:32 -08:00
Eric House
ca6edcfc9a make trade and move confirm non-blocking
Probably breaks curses build, but for gtk and Android
turn move and trade confirmation into a two-step process, making
board_commitTurn() non-interactive when called with a second
parameter. The old blocking util methods now return void and it's up to
the client code to interact (on the main thread) then re-call
board_commitTurn() if appropriate.
2017-02-17 08:58:20 -08:00
Eric House
2a0b21e5e8 make password fetching non-blocking
First attempt to stop blocking the jni thread: instead of returning a
password from a util_ method, have it include enough state that the UI
can return, put up a dialog, and then pass that state and the password
back and have them matched up again. I think this will work for the
remaining blocking Alerts too.
2017-02-17 06:23:44 -08:00
Eric House
1a830fbff2 use clang instead of gcc for ndk builds
And make changes to C code to fix resulting warning. The .so file
basically works but is not thoroughly tested.
2016-10-25 06:09:40 -07:00
Eric House
7994c42691 allow board cells to be wider than tall
There are some screen dimensions, especially with dual-pane mode, where
the board is just bit narrower than the screen. Rather than have narrow
white borders, allow the cells to take up the slack. The API takes an
upper bound on the ratio of width to height so things shouldn't get too
odd looking.
2016-09-15 20:37:29 -07:00
Eric House
4c923ead08 add isLocal param to server_getCurrentTurn
I want to store this information separately in summaries tables so
e.g. games can be displayed sorted by whether it's the local player's
turn.
2016-08-26 06:58:55 -07:00
Eric House
3b24aab8c3 add new jni call board_containsPt()
for use debugging layouts/orientation changes later
2016-08-15 17:26:10 -07:00
Eric House
bf7a38da08 copy more state into board being used for snapshot 2016-08-05 21:19:49 -07:00
Eric House
8b142e4a56 use new board_drawSnapshot() from android
BoardCanvas wouldn't render anything without an associated dict via
dictChanged()
2016-08-05 11:51:47 -07:00
Eric House
0c6283ea63 add board_drawSnapshot
Toward something that should work with android: pass a potentially
unique draw context into new method that creates a new board just for
the draw and makes its scoreboard and tray disappear.
2016-08-05 10:23:39 -07:00
Eric House
3c0a128266 produce, store and display actual snapshot
Done in a way that won't work for Android just to try out the gtk
way. Tweaks and reuses the existing draw context and board, which is
precisely what the android version can't easily do.
2016-08-05 09:42:55 -07:00
Eric House
2ca0fe5ca4 add board_getSelPlayer() 2016-03-06 06:34:49 -08:00
Eric House
86883eb51a handle tap on scoreboard by showing last move summary (as happens for
long-tap) when option to switch users is disabled.
2016-02-18 07:46:36 -08:00
Eric House
5084e70843 fix bug: if you're iterating through hints and you drag a tile to the
left of tray divider (without moving divider) it may still be included
in hinted moves. Fix is to reset engine whenever the set of tiles left
of divider changes.
2016-02-05 07:29:51 -08:00
Eric House
122335c53c Merge branch 'android_branch' into relay_noconn
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
2015-09-17 07:00:04 -07:00
Eric House
cba1293bec make return value void since it's never used 2015-09-15 20:54:01 -07:00
Eric House
47954f82d0 add index of sending player to chat transmission, and on receiving
side translate that into showing the sender's name in
notification. Not yet done: replacing silly "not me" in chat listing
with same, but now it should be easy.

Conflicts:
	xwords4/android/XWords4/archive/R.java
2015-08-12 07:43:20 -07:00
Eric House
8f7267b3ec add index of sending player to chat transmission, and on receiving
side translate that into showing the sender's name in
notification. Not yet done: replacing silly "not me" in chat listing
with same, but now it should be easy.
2015-08-12 07:36:36 -07:00
Eric House
684c7ff3e3 Merge branch 'android_branch' into relay_noconn
Conflicts:
	xwords4/android/XWords4/archive/R.java
	xwords4/android/XWords4/res/values/strings.xml
	xwords4/android/XWords4/res_src/values-ba_CK/strings.xml
	xwords4/android/XWords4/res_src/values-ca_PS/strings.xml
	xwords4/android/XWords4/src/org/eehouse/android/xw4/SMSInviteDelegate.java
2015-07-26 13:22:45 -07:00
Eric House
75cd6c6693 fix logic behind "unable to find move" alert 2015-07-26 13:17:59 -07:00
Eric House
0bb51e8b93 show a toast when hint can't find anything, on the principle that user
should see some response to every action.

Conflicts:
	xwords4/android/XWords4/archive/R.java
2015-07-26 12:09:15 -07:00
Eric House
5dc8291981 show a toast when hint can't find anything, on the principle that user
should see some response to every action.
2015-07-11 16:24:21 -07:00
Eric House
33d0db93e8 add some consts 2015-07-06 20:23:22 -07:00
Eric House
f0c3c11dc8 invalidate all tiles after committing a turn in order to force redraw
of the Pts. display in case where fewer than seven tiles remain and
the board isn't being switched.
2015-06-10 07:31:00 -07:00
Eric House
4eb836ab2b fix to compile -- graft missed a constant defined earlier 2014-10-09 21:21:27 -07:00
Eric House
badc40f90b move dividerLoc into model and use to limit sorting to tiles to its
right
2014-10-09 20:09:24 -07:00
Eric House
a485480496 make divider wider 2014-09-22 07:05:45 -07:00
Eric House
b77d529099 fix linux-side compile errors 2014-08-21 07:15:20 -07:00
Eric House
e998fbfcba log less 2014-08-09 17:11:35 -07:00
Eric House
56336f7178 double the max size of a tile, fixing board not using full screen in
portrait mode on Nexus 10.
2014-07-24 20:36:37 -07:00
Eric House
a902bdcbad limit width of scoreboard too 2014-07-17 21:31:17 -07:00
Eric House
d51a5e67f0 fix for super-wide screen: tiles are never wider than tall. Next:
scoreboard.
2014-07-17 08:01:00 -07:00
Eric House
39983f65b6 remove logging 2014-02-27 21:44:25 -08:00
Eric House
e34cc9007d fix problems with opening and using wordlists on 64-bit linux by
making XP_U32 32 rather than 64 bits. Duh. Do same on Android jni just
in case.
2014-01-07 06:58:20 -08:00
Eric House
b43855a313 fix curses build for 64bit compile and to use common layout (meaning
tray is now under the board unstead of to the right).  Works on 64-bit
system at least for non-networked games.
2014-01-05 13:04:59 -08:00
Eric House
3f67afaefb replace tabs with spaces; no code change 2014-01-05 12:57:46 -08:00
Eric House
b5d6c513a6 add canUndo to GameStateInfo and use to hide the undo menu 2013-12-03 07:06:48 -08:00
Eric House
94216a5fb9 add canTrade to GameStateInfo, pass through to java world, and use to
determine whether to show trade menuitem
2013-12-01 21:53:41 -08:00
Eric House
9fa9ba643f fix linux crash when timers enabled: clear timer while taking down board 2013-12-01 18:50:18 -08:00
Eric House
0cc45ad865 add new field canHideRack to GameStateInfo and use it to disable menu. 2013-11-17 13:54:21 -08:00
Eric House
14c7b7370a fix layout bug where board overlapped tray 2013-11-16 18:31:14 -08:00
Eric House
088dd1bd75 center board when it must be narrower than screen 2013-11-15 20:46:22 -08:00
Eric House
7d1a1228f0 fix bug where scrolling used when shrinking would suffice 2013-11-14 06:56:11 -08:00
Eric House
c9ba7b2fe1 When timer fires for pen held on board, don't do anything if we're in
trade mode.
2013-11-10 07:08:49 -08:00
Eric House
dfdbd9a8a2 pass scoreWidth separately into formatting code so space can be left
for network status icon.
2013-11-09 05:34:23 -08:00