mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-05 20:45:49 +01:00
When a game is over, show "Game over" dialog containing score summary
every time it's opened. This is a quick way to get around it being a bit hard to tell a board's in that state.
This commit is contained in:
parent
264118a5ff
commit
e5bb360537
2 changed files with 19 additions and 4 deletions
|
@ -165,6 +165,7 @@ public class BoardActivity extends XWActivity
|
|||
|
||||
private int m_missing;
|
||||
private boolean m_haveInvited = false;
|
||||
private boolean m_overNotShown;
|
||||
|
||||
private static BoardActivity s_this = null;
|
||||
private static Class s_thisLocker = BoardActivity.class;
|
||||
|
@ -500,6 +501,7 @@ public class BoardActivity extends XWActivity
|
|||
Intent intent = getIntent();
|
||||
m_rowid = intent.getLongExtra( GameUtils.INTENT_KEY_ROWID, -1 );
|
||||
m_haveInvited = intent.getBooleanExtra( GameUtils.INVITED, false );
|
||||
m_overNotShown = true;
|
||||
|
||||
setBackgroundColor();
|
||||
setKeepScreenOn();
|
||||
|
@ -692,7 +694,7 @@ public class BoardActivity extends XWActivity
|
|||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
} // onPrepareOptionsMenu
|
||||
|
||||
public boolean onOptionsItemSelected( MenuItem item )
|
||||
{
|
||||
|
@ -1722,8 +1724,17 @@ public class BoardActivity extends XWActivity
|
|||
if ( 0 != (GameSummary.MSG_FLAGS_CHAT & flags) ) {
|
||||
startChatActivity();
|
||||
}
|
||||
if ( m_overNotShown ) {
|
||||
Boolean auto = null;
|
||||
if ( 0 != (GameSummary.MSG_FLAGS_GAMEOVER & flags) ) {
|
||||
m_jniThread.handle( JNICmd.CMD_POST_OVER );
|
||||
auto = new Boolean( false );
|
||||
} else if ( DBUtils.gameOver( this, m_rowid ) ) {
|
||||
auto = new Boolean( true );
|
||||
}
|
||||
if ( null != auto ) {
|
||||
m_overNotShown = false;
|
||||
m_jniThread.handle( JNICmd.CMD_POST_OVER, auto );
|
||||
}
|
||||
}
|
||||
if ( 0 != flags ) {
|
||||
DBUtils.setMsgFlags( m_rowid, GameSummary.MSG_FLAGS_NONE );
|
||||
|
|
|
@ -524,7 +524,11 @@ public class JNIThread extends Thread {
|
|||
|
||||
case CMD_POST_OVER:
|
||||
if ( XwJNI.server_getGameIsOver( m_jniGamePtr ) ) {
|
||||
sendForDialog( R.string.finalscores_title,
|
||||
boolean auto = 0 < args.length &&
|
||||
((Boolean)args[0]).booleanValue();
|
||||
int titleID = auto? R.string.summary_gameover
|
||||
: R.string.finalscores_title;
|
||||
sendForDialog( titleID,
|
||||
XwJNI.server_writeFinalScores( m_jniGamePtr ) );
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue