mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-22 07:28:16 +01:00
fix problem setting game timers
This commit is contained in:
parent
b95c86e4e3
commit
6292e498f2
2 changed files with 15 additions and 18 deletions
|
@ -727,10 +727,10 @@ public class GameConfigDelegate extends DelegateBase
|
||||||
if ( CommonPrefs.getDupModeHidden( m_activity ) ) {
|
if ( CommonPrefs.getDupModeHidden( m_activity ) ) {
|
||||||
setChecked( R.id.duplicate_check, false );
|
setChecked( R.id.duplicate_check, false );
|
||||||
} else {
|
} else {
|
||||||
CheckBox check = (CheckBox)findViewById( R.id.duplicate_check );
|
CheckBox dupCheck = (CheckBox)findViewById( R.id.duplicate_check );
|
||||||
check.setVisibility( View.VISIBLE );
|
dupCheck.setVisibility( View.VISIBLE );
|
||||||
check.setChecked( m_gi.inDuplicateMode );
|
dupCheck.setChecked( m_gi.inDuplicateMode );
|
||||||
check.setOnCheckedChangeListener( new OnCheckedChangeListener() {
|
dupCheck.setOnCheckedChangeListener( new OnCheckedChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged( CompoundButton buttonView,
|
public void onCheckedChanged( CompoundButton buttonView,
|
||||||
boolean checked ) {
|
boolean checked ) {
|
||||||
|
@ -761,11 +761,11 @@ public class GameConfigDelegate extends DelegateBase
|
||||||
TextView label = (TextView)findViewById(R.id.timer_label );
|
TextView label = (TextView)findViewById(R.id.timer_label );
|
||||||
label.setText( id );
|
label.setText( id );
|
||||||
|
|
||||||
// setInt( R.id.timer_minutes_edit,
|
int seconds = m_gi.gameSeconds / 60;
|
||||||
// m_gi.gameSeconds/60/m_gi.nPlayers );
|
if ( !m_gi.inDuplicateMode ) {
|
||||||
|
seconds /= m_gi.nPlayers;
|
||||||
// setChecked( R.id.use_timer, m_gi.timerEnabled );
|
}
|
||||||
// showTimerSet( m_gi.timerEnabled );
|
setInt( R.id.timer_minutes_edit, seconds );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showTimerSet( boolean show )
|
private void showTimerSet( boolean show )
|
||||||
|
@ -1285,11 +1285,10 @@ public class GameConfigDelegate extends DelegateBase
|
||||||
// Get timer value. It's per-move minutes in duplicate mode, otherwise
|
// Get timer value. It's per-move minutes in duplicate mode, otherwise
|
||||||
// it's for the whole game.
|
// it's for the whole game.
|
||||||
int seconds = 60 * getInt( R.id.timer_minutes_edit );
|
int seconds = 60 * getInt( R.id.timer_minutes_edit );
|
||||||
if ( m_gi.inDuplicateMode ) {
|
if ( !m_gi.inDuplicateMode ) {
|
||||||
m_gi.gameSeconds = seconds;
|
seconds *= m_gi.nPlayers;
|
||||||
} else {
|
|
||||||
m_gi.gameSeconds = seconds * m_gi.nPlayers;
|
|
||||||
}
|
}
|
||||||
|
m_gi.gameSeconds = seconds;
|
||||||
|
|
||||||
int position = m_phoniesSpinner.getSelectedItemPosition();
|
int position = m_phoniesSpinner.getSelectedItemPosition();
|
||||||
m_gi.phoniesAction = CurGameInfo.XWPhoniesChoice.values()[position];
|
m_gi.phoniesAction = CurGameInfo.XWPhoniesChoice.values()[position];
|
||||||
|
|
|
@ -832,9 +832,6 @@ gi_countLocalPlayers( const CurGameInfo* gi, XP_Bool humanOnly )
|
||||||
void
|
void
|
||||||
gi_readFromStream( MPFORMAL XWStreamCtxt* stream, CurGameInfo* gi )
|
gi_readFromStream( MPFORMAL XWStreamCtxt* stream, CurGameInfo* gi )
|
||||||
{
|
{
|
||||||
LocalPlayer* pl;
|
|
||||||
XP_U16 ii;
|
|
||||||
XP_UCHAR* str;
|
|
||||||
XP_U16 strVersion = stream_getVersion( stream );
|
XP_U16 strVersion = stream_getVersion( stream );
|
||||||
XP_U16 nColsNBits;
|
XP_U16 nColsNBits;
|
||||||
XP_ASSERT( 0 < strVersion );
|
XP_ASSERT( 0 < strVersion );
|
||||||
|
@ -845,7 +842,7 @@ gi_readFromStream( MPFORMAL XWStreamCtxt* stream, CurGameInfo* gi )
|
||||||
nColsNBits = NUMCOLS_NBITS_4;
|
nColsNBits = NUMCOLS_NBITS_4;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
str = stringFromStream( mpool, stream );
|
XP_UCHAR* str = stringFromStream( mpool, stream );
|
||||||
replaceStringIfDifferent( mpool, &gi->dictName, str );
|
replaceStringIfDifferent( mpool, &gi->dictName, str );
|
||||||
XP_FREEP( mpool, &str );
|
XP_FREEP( mpool, &str );
|
||||||
|
|
||||||
|
@ -907,7 +904,8 @@ gi_readFromStream( MPFORMAL XWStreamCtxt* stream, CurGameInfo* gi )
|
||||||
gi->gameSeconds = stream_getU16( stream );
|
gi->gameSeconds = stream_getU16( stream );
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( pl = gi->players, ii = 0; ii < gi->nPlayers; ++pl, ++ii ) {
|
for ( int ii = 0; ii < gi->nPlayers; ++ii ) {
|
||||||
|
LocalPlayer* pl = &gi->players[ii];
|
||||||
str = stringFromStream( mpool, stream );
|
str = stringFromStream( mpool, stream );
|
||||||
replaceStringIfDifferent( mpool, &pl->name, str );
|
replaceStringIfDifferent( mpool, &pl->name, str );
|
||||||
XP_FREEP( mpool, &str );
|
XP_FREEP( mpool, &str );
|
||||||
|
|
Loading…
Reference in a new issue