mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-30 08:34:16 +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_undo">key_notagain_undo</string>
|
||||||
<string name="key_notagain_done">key_notagain_done</string>
|
<string name="key_notagain_done">key_notagain_done</string>
|
||||||
<string name="key_notagain_unlock">key_notagain_unlock</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>
|
<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
|
save these changes it must be restarted. Do you want to save
|
||||||
these changes?</string>
|
these changes?</string>
|
||||||
<string name="confirm_delete_all">Are you sure you want to
|
<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
|
<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
|
this dictionary? You will not be able to open any games that use
|
||||||
it.</string>
|
it.</string>
|
||||||
|
@ -293,8 +297,8 @@
|
||||||
<string name="tab_sms">SMS (broken)</string>
|
<string name="tab_sms">SMS (broken)</string>
|
||||||
<string name="tab_bluetooth">Bluetooth (pending)</string>
|
<string name="tab_bluetooth">Bluetooth (pending)</string>
|
||||||
|
|
||||||
<string name="msg_relay_waiting">Connected to relay in room
|
<string name="msg_relay_waiting">Device %d connected to relay in
|
||||||
\"%s\". Waiting for %d player[s].</string>
|
room \"%s\". Waiting for %d player[s].</string>
|
||||||
<string name="msg_relay_all_heref">All players are here in room
|
<string name="msg_relay_all_heref">All players are here in room
|
||||||
\"%s\".</string>
|
\"%s\".</string>
|
||||||
<string name="title_relay_status">Connection status.</string>
|
<string name="title_relay_status">Connection status.</string>
|
||||||
|
@ -419,9 +423,15 @@
|
||||||
Or try joining or creating a public room.</string>
|
Or try joining or creating a public room.</string>
|
||||||
|
|
||||||
<string name="not_again_newgame">The new game you have created has
|
<string name="not_again_newgame">The new game you have created has
|
||||||
two players, the first a robot, both on this device. To play
|
two players, the first a robot, both on this device. Tap it to
|
||||||
the game, tap it; to change its configuration or for other
|
play; long-tap it to change its configuration or for other
|
||||||
options, long-tap it.</string>
|
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
|
<string name="not_again_hintprev">This button shows all possible
|
||||||
moves in ascending order (using tiles to the right of the rack
|
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
|
<string name="not_again_undo">This button undos or redoes the
|
||||||
current turn.</string>
|
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
|
<string name="not_again_done">The \"pts\" counter that appears at
|
||||||
the right end of the rack is an alternative to this menu
|
the right end of the rack is an alternative to this menu
|
||||||
item.</string>
|
item.</string>
|
||||||
|
@ -448,4 +457,16 @@
|
||||||
restarting it. When you leave this page you will have a chance
|
restarting it. When you leave this page you will have a chance
|
||||||
to discard changes to avoid a restart.</string>
|
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>
|
</resources>
|
||||||
|
|
|
@ -625,7 +625,9 @@ public class BoardActivity extends XWActivity implements UtilCtxt {
|
||||||
{
|
{
|
||||||
CommsTransport.ConndMsg cndmsg =
|
CommsTransport.ConndMsg cndmsg =
|
||||||
(CommsTransport.ConndMsg)msg.obj;
|
(CommsTransport.ConndMsg)msg.obj;
|
||||||
Utils.logf( "handleConndMessage: devOrder=%d", cndmsg.m_devOrder );
|
|
||||||
|
int naMsg;
|
||||||
|
int naKey;
|
||||||
String str = null;
|
String str = null;
|
||||||
if ( cndmsg.m_allHere ) {
|
if ( cndmsg.m_allHere ) {
|
||||||
// All players have now joined the game. The device that
|
// 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
|
// the first player's turn
|
||||||
String fmt = getString( R.string.msg_relay_all_heref );
|
String fmt = getString( R.string.msg_relay_all_heref );
|
||||||
str = String.format( fmt, cndmsg.m_room );
|
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 ) {
|
} else if ( cndmsg.m_nMissing > 0 ) {
|
||||||
String fmt = getString( R.string.msg_relay_waiting );
|
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 ) {
|
if ( null != str ) {
|
||||||
Toast.makeText( BoardActivity.this, str,
|
final String fstr = str;
|
||||||
Toast.LENGTH_SHORT).show();
|
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 //
|
// XW_UtilCtxt interface implementation //
|
||||||
|
|
|
@ -298,8 +298,17 @@ public class GamesList extends XWListActivity
|
||||||
|
|
||||||
case R.id.list_item_reset:
|
case R.id.list_item_reset:
|
||||||
// TODO confirm_data_loss();
|
// TODO confirm_data_loss();
|
||||||
GameUtils.resetGame( this, path, path );
|
final String fpath = path;
|
||||||
invalPath = 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;
|
break;
|
||||||
case R.id.list_item_new_from:
|
case R.id.list_item_new_from:
|
||||||
String newName = GameUtils.resetGame( this, path );
|
String newName = GameUtils.resetGame( this, path );
|
||||||
|
|
Loading…
Add table
Reference in a new issue