mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-14 08:01:38 +01:00
add to game state passed into java world whether it's the cur selected
player's turn, and use that to enable/disable Pass/Turn done button.
This commit is contained in:
parent
179560867f
commit
90f11abc37
7 changed files with 12 additions and 0 deletions
|
@ -1185,6 +1185,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_game_1getState
|
|||
setBool( env, jgsi, "tradeTilesSelected", info.tradeTilesSelected );
|
||||
setBool( env, jgsi, "gameIsConnected", info.gameIsConnected );
|
||||
setBool( env, jgsi, "canShuffle", info.canShuffle );
|
||||
setBool( env, jgsi, "curTurnSelected", info.curTurnSelected );
|
||||
|
||||
XWJNI_END();
|
||||
}
|
||||
|
|
|
@ -613,6 +613,7 @@ public class BoardActivity extends XWActivity
|
|||
strId = R.string.board_menu_done;
|
||||
}
|
||||
item.setTitle( strId );
|
||||
item.setEnabled( null == m_gsi || m_gsi.curTurnSelected );
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -99,6 +99,7 @@ public class JNIThread extends Thread {
|
|||
public boolean tradeTilesSelected;
|
||||
public boolean gameIsConnected;
|
||||
public boolean canShuffle;
|
||||
public boolean curTurnSelected;
|
||||
public GameStateInfo clone() {
|
||||
GameStateInfo obj = null;
|
||||
try {
|
||||
|
|
|
@ -541,6 +541,12 @@ board_getYOffset( const BoardCtxt* board )
|
|||
return vsd->offset;
|
||||
} /* board_getYOffset */
|
||||
|
||||
XP_Bool
|
||||
board_curTurnSelected( const BoardCtxt* board )
|
||||
{
|
||||
return MY_TURN( board );
|
||||
}
|
||||
|
||||
XP_U16
|
||||
board_visTileCount( const BoardCtxt* board )
|
||||
{
|
||||
|
|
|
@ -78,6 +78,7 @@ void board_reset( BoardCtxt* board );
|
|||
XP_Bool board_setYOffset( BoardCtxt* board, XP_U16 newOffset );
|
||||
XP_U16 board_getYOffset( const BoardCtxt* board );
|
||||
|
||||
XP_Bool board_curTurnSelected( const BoardCtxt* board );
|
||||
XP_U16 board_visTileCount( const BoardCtxt* board );
|
||||
XP_Bool board_canShuffle( const BoardCtxt* board );
|
||||
XP_Bool board_canTogglePending( const BoardCtxt* board );
|
||||
|
|
|
@ -280,6 +280,7 @@ game_saveToStream( const XWGame* game, const CurGameInfo* gi,
|
|||
void
|
||||
game_getState( const XWGame* game, GameStateInfo* gsi )
|
||||
{
|
||||
gsi->curTurnSelected = board_curTurnSelected( game->board );
|
||||
gsi->visTileCount = board_visTileCount( game->board );
|
||||
gsi->canHint = board_canHint( game->board );
|
||||
gsi->canRedo = board_canTogglePending( game->board );
|
||||
|
|
|
@ -97,6 +97,7 @@ typedef struct _GameStateInfo {
|
|||
XP_Bool tradeTilesSelected;
|
||||
XP_Bool gameIsConnected;
|
||||
XP_Bool canShuffle;
|
||||
XP_Bool curTurnSelected;
|
||||
} GameStateInfo;
|
||||
|
||||
typedef struct XWGame {
|
||||
|
|
Loading…
Reference in a new issue