mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-29 08:34:37 +01:00
use new field to determine if simple relay config dialog can handle
the game or if user's already changed it enough that the full-on dialog is required.
This commit is contained in:
parent
f36b253ae7
commit
73d7c7a27b
2 changed files with 15 additions and 1 deletions
|
@ -270,7 +270,16 @@ public class GamesList extends XWListActivity
|
|||
GameSummary summary = DBUtils.getSummary( this, path );
|
||||
if ( summary.conType == CommsAddrRec.CommsConnType.COMMS_CONN_RELAY
|
||||
&& summary.roomName.length() == 0 ) {
|
||||
GameUtils.doConfig( this, path, RelayGameActivity.class );
|
||||
// If it's unconfigured and of the type RelayGameActivity
|
||||
// can handle send it there, otherwise use the full-on
|
||||
// config.
|
||||
Class clazz;
|
||||
if ( RelayGameActivity.isSimpleGame( summary ) ) {
|
||||
clazz = RelayGameActivity.class;
|
||||
} else {
|
||||
clazz = GameConfig.class;
|
||||
}
|
||||
GameUtils.doConfig( this, path, clazz );
|
||||
} else {
|
||||
File file = new File( path );
|
||||
Uri uri = Uri.fromFile( file );
|
||||
|
|
|
@ -107,4 +107,9 @@ public class RelayGameActivity extends XWActivity
|
|||
}
|
||||
}
|
||||
|
||||
public static boolean isSimpleGame( GameSummary summary )
|
||||
{
|
||||
return summary.nPlayers == 2;
|
||||
}
|
||||
|
||||
} // class RelayGameActivity
|
||||
|
|
Loading…
Add table
Reference in a new issue