add config option to enable face-up tile picking

This commit is contained in:
Andy2 2011-10-28 22:24:47 -07:00
parent 8d228ae190
commit 8f3c4f6426
3 changed files with 12 additions and 1 deletions

View file

@ -217,6 +217,11 @@
android:entries="@array/phony_names"
/>
<CheckBox android:id="@+id/pick_faceup"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/pick_faceup"
/>
</LinearLayout>

View file

@ -1786,6 +1786,7 @@
<string name="tilepick_undo">Undo last</string>
<string name="tilepick_all">Pick for me</string>
<string name="cur_tilesf">Tile picker\n(so far: %s)</string>
<string name="pick_faceup">Pick tiles face-up</string>
</resources>

View file

@ -114,6 +114,7 @@ public class GameConfig extends XWActivity
,R.id.room_spinner
,R.id.refresh_button
,R.id.hints_allowed
,R.id.pick_faceup
,R.id.use_timer
,R.id.timer_minutes_edit
,R.id.smart_robot
@ -514,7 +515,10 @@ public class GameConfig extends XWActivity
setSmartnessSpinner();
Utils.setChecked( this, R.id.hints_allowed, !m_gi.hintsNotAllowed );
Utils.setChecked( this, R.id.hints_allowed,
!m_gi.hintsNotAllowed );
Utils.setChecked( this, R.id.pick_faceup,
m_gi.allowPickTiles );
Utils.setInt( this, R.id.timer_minutes_edit,
m_gi.gameSeconds/60/m_gi.nPlayers );
@ -950,6 +954,7 @@ public class GameConfig extends XWActivity
private void saveChanges()
{
m_gi.hintsNotAllowed = !Utils.getChecked( this, R.id.hints_allowed );
m_gi.allowPickTiles = Utils.getChecked( this, R.id.pick_faceup );
m_gi.timerEnabled = Utils.getChecked( this, R.id.use_timer );
m_gi.gameSeconds = 60 * m_gi.nPlayers *
Utils.getInt( this, R.id.timer_minutes_edit );