mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-28 07:58:08 +01:00
add three not-again messages displayed after connection is first made
with the relay, for first-in-room, last-in-room, and the less common middle case. Add confirmation dialog for game reset.
This commit is contained in:
parent
6de7fb28e3
commit
5b6a5aafe8
4 changed files with 67 additions and 14 deletions
|
@ -50,6 +50,9 @@
|
|||
<string name="key_notagain_undo">key_notagain_undo</string>
|
||||
<string name="key_notagain_done">key_notagain_done</string>
|
||||
<string name="key_notagain_unlock">key_notagain_unlock</string>
|
||||
<string name="key_notagain_conndall">key_notagain_conndall</string>
|
||||
<string name="key_notagain_conndfirst">key_notagain_conndfirst</string>
|
||||
<string name="key_notagain_conndmid">key_notagain_conndmid</string>
|
||||
|
||||
<string name="relayids_extra">org.eehouse.android.xw4.relayids_extra</string>
|
||||
|
||||
|
|
|
@ -186,7 +186,11 @@
|
|||
save these changes it must be restarted. Do you want to save
|
||||
these changes?</string>
|
||||
<string name="confirm_delete_all">Are you sure you want to
|
||||
delete all games? This action cannot be undone.</string>
|
||||
delete all games? This action cannot be undone.</string>
|
||||
<string name="confirm_reset">Are you sure you want to reset this
|
||||
game? Resetting erases all moves and any connection
|
||||
information.</string>
|
||||
|
||||
<string name="confirm_delete_dict">Are you sure you want to delete
|
||||
this dictionary? You will not be able to open any games that use
|
||||
it.</string>
|
||||
|
@ -293,8 +297,8 @@
|
|||
<string name="tab_sms">SMS (broken)</string>
|
||||
<string name="tab_bluetooth">Bluetooth (pending)</string>
|
||||
|
||||
<string name="msg_relay_waiting">Connected to relay in room
|
||||
\"%s\". Waiting for %d player[s].</string>
|
||||
<string name="msg_relay_waiting">Device %d connected to relay in
|
||||
room \"%s\". Waiting for %d player[s].</string>
|
||||
<string name="msg_relay_all_heref">All players are here in room
|
||||
\"%s\".</string>
|
||||
<string name="title_relay_status">Connection status.</string>
|
||||
|
@ -419,9 +423,15 @@
|
|||
Or try joining or creating a public room.</string>
|
||||
|
||||
<string name="not_again_newgame">The new game you have created has
|
||||
two players, the first a robot, both on this device. To play
|
||||
the game, tap it; to change its configuration or for other
|
||||
options, long-tap it.</string>
|
||||
two players, the first a robot, both on this device. Tap it to
|
||||
play; long-tap it to change its configuration or for other
|
||||
options.</string>
|
||||
<string name="not_again_newgamenet">The new game you have created
|
||||
has two players but only one is on this device. To play the
|
||||
game, tap it, and it will begin by connecting over the internet
|
||||
looking for that other player in the default no-name
|
||||
room. Long-tap it to configure - e.g. change the room name - or
|
||||
for other options.</string>
|
||||
|
||||
<string name="not_again_hintprev">This button shows all possible
|
||||
moves in ascending order (using tiles to the right of the rack
|
||||
|
@ -439,7 +449,6 @@
|
|||
<string name="not_again_undo">This button undos or redoes the
|
||||
current turn.</string>
|
||||
|
||||
<string name="not_again_newgamenet">The new game you have created </string>
|
||||
<string name="not_again_done">The \"pts\" counter that appears at
|
||||
the right end of the rack is an alternative to this menu
|
||||
item.</string>
|
||||
|
@ -448,4 +457,16 @@
|
|||
restarting it. When you leave this page you will have a chance
|
||||
to discard changes to avoid a restart.</string>
|
||||
|
||||
<string name="not_again_conndall">You have connected and joined a
|
||||
game on the relay; the room is now full. The device that
|
||||
created the room will now assign your initial tiles and play can
|
||||
begin.</string>
|
||||
<string name="not_again_conndfirst">You have connected and started
|
||||
a game in a new room. Once the remaining devices have joined
|
||||
your room and Crosswords has assigned them tiles the game can
|
||||
begin.</string>
|
||||
<string name="not_again_conndmid">You have connected and joined a
|
||||
game on the relay. You will be notified when the remaining
|
||||
device[s] have joined your room and play can begin.</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -625,7 +625,9 @@ public class BoardActivity extends XWActivity implements UtilCtxt {
|
|||
{
|
||||
CommsTransport.ConndMsg cndmsg =
|
||||
(CommsTransport.ConndMsg)msg.obj;
|
||||
Utils.logf( "handleConndMessage: devOrder=%d", cndmsg.m_devOrder );
|
||||
|
||||
int naMsg;
|
||||
int naKey;
|
||||
String str = null;
|
||||
if ( cndmsg.m_allHere ) {
|
||||
// All players have now joined the game. The device that
|
||||
|
@ -633,16 +635,34 @@ public class BoardActivity extends XWActivity implements UtilCtxt {
|
|||
// the first player's turn
|
||||
String fmt = getString( R.string.msg_relay_all_heref );
|
||||
str = String.format( fmt, cndmsg.m_room );
|
||||
naMsg = R.string.not_again_conndall;
|
||||
naKey = R.string.key_notagain_conndall;
|
||||
} else if ( cndmsg.m_nMissing > 0 ) {
|
||||
String fmt = getString( R.string.msg_relay_waiting );
|
||||
str = String.format( fmt, cndmsg.m_room, cndmsg.m_nMissing );
|
||||
str = String.format( fmt, cndmsg.m_devOrder,
|
||||
cndmsg.m_room, cndmsg.m_nMissing );
|
||||
if ( cndmsg.m_devOrder == 1 ) {
|
||||
naMsg = R.string.not_again_conndfirst;
|
||||
naKey = R.string.key_notagain_conndfirst;
|
||||
} else {
|
||||
naMsg = R.string.not_again_conndmid;
|
||||
naKey = R.string.key_notagain_conndmid;
|
||||
}
|
||||
} else {
|
||||
naMsg = naKey = 0; // keep compiler happy
|
||||
}
|
||||
|
||||
if ( null != str ) {
|
||||
Toast.makeText( BoardActivity.this, str,
|
||||
Toast.LENGTH_SHORT).show();
|
||||
final String fstr = str;
|
||||
Runnable proc = new Runnable() {
|
||||
public void run() {
|
||||
Toast.makeText( BoardActivity.this, fstr,
|
||||
Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
};
|
||||
showNotAgainDlgThen( naMsg, naKey, proc );
|
||||
}
|
||||
}
|
||||
} // handleConndMessage
|
||||
|
||||
//////////////////////////////////////////
|
||||
// XW_UtilCtxt interface implementation //
|
||||
|
|
|
@ -298,8 +298,17 @@ public class GamesList extends XWListActivity
|
|||
|
||||
case R.id.list_item_reset:
|
||||
// TODO confirm_data_loss();
|
||||
GameUtils.resetGame( this, path, path );
|
||||
invalPath = path;
|
||||
final String fpath = path;
|
||||
DialogInterface.OnClickListener lstnr =
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick( DialogInterface dlg, int ii ) {
|
||||
GameUtils.resetGame( GamesList.this,
|
||||
fpath, fpath );
|
||||
m_adapter.inval( fpath );
|
||||
onContentChanged();
|
||||
}
|
||||
};
|
||||
showConfirmThen( R.string.confirm_reset, lstnr );
|
||||
break;
|
||||
case R.id.list_item_new_from:
|
||||
String newName = GameUtils.resetGame( this, path );
|
||||
|
|
Loading…
Add table
Reference in a new issue