Commit graph

4823 commits

Author SHA1 Message Date
Andy2
e4b952222a unify two ways of saving words encountered during scoring, removing
one and changing the site that used it to use the other.  Not visible
outside of common, but should make it easier to harvest a list of all
words for one move or the entire game.
2011-09-02 19:11:04 -07:00
Andy2
2f91b8ed3d remove unused strings 2011-09-02 18:37:58 -07:00
Andy2
da475347a5 get rid of unused constants 2011-09-02 18:36:26 -07:00
Andy2
2d2f3e23fd change signature of util_playerScoreHeld(): pass player num rather
than formatted text. Client code can use new
model_getPlayersLastScore() or whatever else it wants to build text to
show the user.
2011-09-02 18:36:03 -07:00
Andy2
b6a4621617 trivial optimization 2011-09-02 18:34:07 -07:00
Andy2
42950c38bd export model_getPlayersLastScore() 2011-09-02 18:33:34 -07:00
Andy2
99679357a8 Exit trade mode on "commit" even if no tiles selected (in keeping with
error message on Android); don't block trade if pending tiles are on
board; instead undo them. There's redo now so there's no need to
confirm, no data loss.
2011-09-02 06:48:06 -07:00
Andy2
dadf41ad2e add "cancel trade" menu item 2011-09-02 06:38:30 -07:00
Andy2
c2150bc9ed get rid of util_setInTrade() 2011-09-02 06:14:29 -07:00
Andy2
9cf7e6ca18 get rid of util_setInTrade() 2011-09-01 19:53:03 -07:00
Andy2
5d08b6b3cd don't make scoreboard entries translucent during trade if option to
change which player is shown is enabled.
2011-09-01 19:52:36 -07:00
Andy2
e94524958f get rid of util_setInTrade(); fix passing of selBits when trading
(broken with prev checkin.)
2011-09-01 19:51:26 -07:00
Andy2
437e4e21ac There are buttons not menu items for exiting exchange mode so
reference them in newbie text.  And get rid of string for toast
exiting the mode since we don't show it.
2011-09-01 18:54:27 -07:00
Andy2
934daab6c8 don't need util_setInTrade. There's already code passing the result
of game_getState() in after every draw() call and it has an inTrade
ivar.  Use that.
2011-09-01 18:53:38 -07:00
Andy2
9a60bcf265 draw the X at 7x7 transluscent if in trade mode. 2011-09-01 18:52:21 -07:00
Andy2
8e45dcd720 exit trade mode only in the case where we're asking user to confirm,
and do it before server can call callback that changes selPlayer so
it'll actually work.
2011-09-01 18:50:09 -07:00
Andy2
671877cbca implement new util_ methods in jni and java; remove old miniwindow
stuff.  In java, respond to util_playerScoreHeld() and
util_bonusSquareHeld() by putting up toasts with existing strings.
For util_setInTrade(), fix exchange mode. Add two buttons at bottom
that replace toolbar (and corresponding buttons on menu). Redraw
scoreboard and board with high transparency to make it clear they're
disabled.  Still to do: deal with case where ability to switch which
player's tray is visible is enabled.
2011-08-31 06:37:33 -07:00
Andy2
9c60a5c05b make sure util_setInTrade() gets called every time internal state
changes, including on creation/load from stream.
2011-08-31 06:33:36 -07:00
Eric House
cfa4c96d22 just for grins: japanese dict-building files. There are too many kana
for the current format so this can only be for demos, but I might as
well record it.
2011-08-29 20:42:27 -07:00
Eric House
8c811c3d5a Merge branch 'android_branch' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into android_branch 2011-08-29 20:36:53 -07:00
Eric House
c01981bc8f Make miniwindow stuff compile-time optional. The goal's to use native
features where they look better or are easier to manage, e.g. Toasts
and dialogs on Android.
2011-08-29 20:36:01 -07:00
Eric House
3b719f54de add compile-time option to use glib main loop (instead of select())
with ncurses.  The goals to make it easier to include watch on pipes
for incoming messages to better model Android -- and to be a bit more
modern.  Works for one run of test script but needs more testing to be
turned on.
2011-08-29 20:24:15 -07:00
Andy2
45421e8f86 add a bit of space between players column and column to right so
numbers don't run together.
2011-08-28 15:44:23 -07:00
Andy2
5bc63edeb6 replace Runnable passed to showNotAgainDlgThen() with callbackID, same
scheme as the rest of DlgDelegate.  I'm still using a single ivar for
all dialogs, meaning they can't stack, but except for duplicate
showNotAgainDlgThen calls (where the message can be ignored) it
doesn't seem to be happening.  Asserts are still in place to tell me
if I'm wrong.
2011-08-28 15:38:52 -07:00
Andy2
656110841f cleanup after review of recent changes: remove logging etc. didn't
mean to check in.
2011-08-25 18:48:41 -07:00
Andy2
0a2255a8fe add two recent changes 2011-08-25 18:26:49 -07:00
Andy2
632acfd171 Oops: add new pref color to list restored. 2011-08-25 18:26:34 -07:00
Andy2
5acc2205be add pref to edit color used to draw bonus hints on cells 2011-08-25 18:13:42 -07:00
Andy2
79acccc6bf record, commented out, attempt to send NBS message. sendDataMessage()
crashes internally, and googling finds lots of reports/questions and
no answers.  It appears NBS is broken on Android, at least for CDMA.
Might want to revisit on a newer OS version that the 2.1 I'm running
now.
2011-08-25 06:52:12 -07:00
Andy2
711f12fa9e It's ok to cache listeners but only with the instance whose ivars they
reference: revert prev change but make cache vars non-static.
2011-08-25 05:49:09 -07:00
Andy2
3416ae59a7 use a constant for the DISMISS button. And don't use static
listeners.  They wind up getting called with mixed DlgDelegate.this
values, including one belonging to an Activity that's long-since
stopped and so the wrong ids are getting passed back.
2011-08-24 22:43:54 -07:00
Andy2
5aeac29787 Pass 0 to dlgButtonClicked() for dismiss, as -1 is the value of a
button!  Also assert the heck out of callbackIds to see if Android is
guaranteeing that no two dialogs can be up at once.  I'm counting on
that, and need to know if it's not true.
2011-08-24 21:44:10 -07:00
Andy2
1cd1a849e6 don't put dismiss listeners on every damn dialog! They replace rather
than chaining.
2011-08-24 21:41:35 -07:00
Andy2
5769ae6a31 cleanup: there are two listeners created over and over; better to
store in a class static and reuse.
2011-08-24 18:51:47 -07:00
Andy2
4ac84dde23 change sig of DlgDelegate's dlgButtonClicked() method to include id of
button rather than just boolean.  Add onDismissListener so can tell if
whole thing was backed-out of (since that's a different choice from
the two buttons "text" and "html" used in one case.)  Fix compile
error that slipped by earlier: frequent clean builds required with
java.
2011-08-24 18:22:21 -07:00
Andy2
50c692024b fix crashes when reloading (rare unless android:configChanges removed
from AndroidManifest.xml). Problem was that managed dialogs are
recreated between onStart() and onResume() yet onResume() was where
ivars (specifically m_gi) were set.  Can't just set them in onStart()
because then I'd want to save state them in onStop() which isn't
guaranteed to be called.  So create a function loadGame() and call it
from both, using a flag to prevent its running twice (which flag is
cleared in onPause())
2011-08-24 18:18:17 -07:00
Andy2
3a2af96c24 use new callback-replaced-by-id mechanism to query for html/text
choice.
2011-08-24 06:51:00 -07:00
Andy2
f88697fd3f complete conversion of showConfirmThen, removing old methods and
adding second param to buttonClicked() callback indicating which
button was cancelled.
2011-08-24 06:14:42 -07:00
Andy2
7d0cbcf07f use new showConfirmThen scheme 2011-08-24 06:12:57 -07:00
Andy2
85c38e831f cleanup: null's same as empty onClick handler 2011-08-24 05:40:13 -07:00
Andy2
fbb467af80 convert some more callbacks to ints passed back: GamesList done. 2011-08-23 20:25:59 -07:00
Andy2
05607a15b9 toward a bundleable DlgDelegate: add new interface to replace
OnClickListerners passed on, have clients of DlgDelegate implement it,
and convert one dialog to use it.  Will eventually remove old code.
2011-08-23 19:50:01 -07:00
Andy2
0d85a67700 verify that bundle saving works in DlgDelegate and fix one
disappearing message.  Still need solution for callbacks passed in.
2011-08-23 19:18:45 -07:00
Andy2
7a235ed6b6 put onPrepareDialog() back -- it's required to use DlgDelegate dialogs. 2011-08-23 18:51:48 -07:00
Andy2
7da5b24e0f rewrite DictsActivity to not crash when un- and re-loaded: make
dialogs depend only on bundleable ivars -- ints and strings, not Views
-- and bundle them.  Don't use onPrepareDialog, only onCreateDialog,
and so call removeDialog() every time one's dismissed.  Do some
refactoring to support this.
2011-08-23 18:41:19 -07:00
Andy2
84e61f3b3f remove no-op line 2011-08-22 18:43:42 -07:00
Andy2
953909d0f0 remove logging 2011-08-22 18:40:44 -07:00
Andy2
3537161d3b add change 2011-08-22 18:40:30 -07:00
Andy2
3296cad731 pass bundle into DlgDelegate so state can be saved and restored. Not
doing anything with it yet because any scheme to survive
OS-restoration has to deal with the Runnables I'm saving that can't be
bundled.  Work in progress....
2011-08-22 18:10:22 -07:00
Andy2
7e6daa5797 move role out of players column to where it can be a full line long,
preventing it from increasing the size of the item by line-wrapping.
For now it's outside the View that gets hidden, but that may need to
change.
2011-08-22 07:05:33 -07:00