don't encourage invited games to invite others; instead remind that

they've been invited and can only wait for the game to begin. (Unless
more than two devices are involved this should only happen briefly and
when connections aren't working perfectly.)
This commit is contained in:
Eric House 2016-01-11 23:53:16 -08:00
parent e1f6bc3c8e
commit e94ec48613
5 changed files with 609 additions and 592 deletions

File diff suppressed because it is too large Load diff

View file

@ -553,6 +553,10 @@
<item quantity="other">You have already invited %1$d players to
this game. We are waiting for them to connect back.</item>
</plurals>
<string name="invited_msg">This game was created from an
invitation you received. As soon as it is able to connect to the
sender and any other invitees have arrived play will
begin.</string>
<!-- Appended to message above if local device has NFC available -->
<string name="invite_if_nfc">Or just Tap to Invite -- if the other

View file

@ -471,6 +471,10 @@
<item quantity="other">Uoy evah ydaerla detivni %1$d sreyalp ot
siht emag. Ew era gnitiaw rof meht ot tcennoc kcab.</item>
</plurals>
<string name="invited_msg">Siht emag saw detaerc morf na
noitativni uoy deviecer. Sa noos sa ti si elba ot tcennoc ot eht
rednes dna yna rehto seetivni evah devirra yalp lliw
nigeb.</string>
<!-- Appended to message above if local device has NFC available -->
<string name="invite_if_nfc">Ro tsuj Pat ot Etivni -- fi eht rehto
ecived osla sah Diordna Gnimaeb dna si ybraen.</string>

View file

@ -471,6 +471,10 @@
<item quantity="other">YOU HAVE ALREADY INVITED %1$d PLAYERS TO
THIS GAME. WE ARE WAITING FOR THEM TO CONNECT BACK.</item>
</plurals>
<string name="invited_msg">THIS GAME WAS CREATED FROM AN
INVITATION YOU RECEIVED. AS SOON AS IT IS ABLE TO CONNECT TO THE
SENDER AND ANY OTHER INVITEES HAVE ARRIVED PLAY WILL
BEGIN.</string>
<!-- Appended to message above if local device has NFC available -->
<string name="invite_if_nfc">OR JUST TAP TO INVITE -- IF THE OTHER
DEVICE ALSO HAS ANDROID BEAMING AND IS NEARBY.</string>

View file

@ -486,19 +486,19 @@ public class BoardDelegate extends DelegateBase
AlertDialog ad = (AlertDialog)dialog;
String message;
int titleID;
boolean nukePosButton = false;
boolean nukeInviteButton = false;
boolean nukeNeutButton = true;
int buttonTxt = R.string.newgame_invite;
if ( m_summary.hasRematchInfo() ) {
titleID = R.string.info_title;;
message = getString( R.string.rematch_msg );
nukePosButton = true;
nukeInviteButton = true;
} else {
if ( !m_relayConnected ) {
titleID = R.string.seeking_relay;
// If relay is only means, don't allow at all
boolean relayOnly = 1 >= m_connTypes.size();
nukePosButton = relayOnly;
nukeInviteButton = relayOnly;
message = getString( R.string.no_relay_conn );
if ( NetStateCache.netAvail( m_activity )
&& NetStateCache.onWifi() ) {
@ -523,13 +523,17 @@ public class BoardDelegate extends DelegateBase
nSent, nSent );
buttonTxt = R.string.button_reinvite;
nukeNeutButton = false;
} else if ( DeviceRole.SERVER_ISCLIENT == m_gi.serverRole ) {
message = getString( R.string.invited_msg );
titleID = R.string.waiting_title;
nukeInviteButton = true;
} else {
titleID = R.string.waiting_title;
message = getQuantityString( R.plurals.invite_msg_fmt,
m_nMissing, m_nMissing );
}
if ( ! haveSent ) {
if ( ! haveSent && ! nukeInviteButton ) {
String ps = null;
if ( m_nMissing > 1 ) {
ps = getString( R.string.invite_multiple );
@ -552,8 +556,8 @@ public class BoardDelegate extends DelegateBase
ad.setTitle( titleID );
Button button = ad.getButton( AlertDialog.BUTTON_POSITIVE );
button.setVisibility( nukePosButton ? View.GONE : View.VISIBLE );
if ( !nukePosButton ) {
button.setVisibility( nukeInviteButton ? View.GONE : View.VISIBLE );
if ( !nukeInviteButton ) {
button.setText( buttonTxt );
}
button = ad.getButton( AlertDialog.BUTTON_NEUTRAL );