mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-16 15:41:16 +01:00
query user for html vs text before creating new networked game so it
isn't left sitting if [s]he cancels.
This commit is contained in:
parent
66a673c478
commit
eeac03d40f
1 changed files with 19 additions and 23 deletions
|
@ -30,8 +30,6 @@ import android.widget.Button;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
// import junit.framework.Assert;
|
|
||||||
|
|
||||||
import org.eehouse.android.xw4.jni.CurGameInfo;
|
import org.eehouse.android.xw4.jni.CurGameInfo;
|
||||||
import org.eehouse.android.xw4.jni.CommonPrefs;
|
import org.eehouse.android.xw4.jni.CommonPrefs;
|
||||||
import org.eehouse.android.xw4.jni.CommsAddrRec;
|
import org.eehouse.android.xw4.jni.CommsAddrRec;
|
||||||
|
@ -88,7 +86,21 @@ public class NewGameActivity extends XWActivity {
|
||||||
|
|
||||||
private void makeNewGame( boolean networked, boolean launch )
|
private void makeNewGame( boolean networked, boolean launch )
|
||||||
{
|
{
|
||||||
boolean finished = true;
|
if ( launch && networked ) {
|
||||||
|
// Let 'em cancel before we make the game
|
||||||
|
showTextOrHtmlThen( new DlgDelegate.TextOrHtmlClicked() {
|
||||||
|
public void clicked( boolean choseText ) {
|
||||||
|
makeNewGame( true, true, choseText );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
} else {
|
||||||
|
makeNewGame( networked, launch, false );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void makeNewGame( boolean networked, boolean launch,
|
||||||
|
boolean choseText )
|
||||||
|
{
|
||||||
String room = null;
|
String room = null;
|
||||||
long rowid;
|
long rowid;
|
||||||
int[] lang = {0};
|
int[] lang = {0};
|
||||||
|
@ -103,32 +115,16 @@ public class NewGameActivity extends XWActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( launch ) {
|
if ( launch ) {
|
||||||
|
GameUtils.launchGame( this, rowid, networked );
|
||||||
if ( networked ) {
|
if ( networked ) {
|
||||||
finished = false;
|
GameUtils.launchInviteActivity( this, choseText, room,
|
||||||
final String froom = room;
|
lang[0], nPlayers );
|
||||||
final long frowid = rowid;
|
|
||||||
final int flang = lang[0];
|
|
||||||
showTextOrHtmlThen( new DlgDelegate.TextOrHtmlClicked() {
|
|
||||||
public void clicked( boolean choseText ) {
|
|
||||||
GameUtils.launchGame( NewGameActivity.this,
|
|
||||||
frowid, true );
|
|
||||||
GameUtils.
|
|
||||||
launchInviteActivity( NewGameActivity.this,
|
|
||||||
choseText, froom, flang,
|
|
||||||
nPlayers );
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
} else {
|
|
||||||
GameUtils.launchGame( this, rowid, false );
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
GameUtils.doConfig( this, rowid, GameConfig.class );
|
GameUtils.doConfig( this, rowid, GameConfig.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( finished ) {
|
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue