change meaning of timer setting to be per-player rather than per-game

based on information that that's how it's customarily done.  Will need
to communicate change with translators.
This commit is contained in:
Andy2 2010-06-16 06:39:27 -07:00
parent 78ad2feed9
commit 95056db997
10 changed files with 19 additions and 16 deletions

View file

@ -306,7 +306,7 @@
<string name="gamef">Partida %d</string>
<string name="playerf">Jugador %d</string>
<string name="initial_game_minutes">Minuts de partida</string>
<string name="initial_player_minutes">Minuts de partida</string>
<string name="git_rev_title">Id. versió codi font </string>

View file

@ -306,5 +306,5 @@
<string name="gamef">Hra %d</string>
<string name="playerf">Hráč %d</string>
<string name="initial_game_minutes">Délka hry v minutách</string>
<string name="initial_player_minutes">Délka hry v minutách</string>
</resources>

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2007 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
@ -304,5 +304,5 @@
<string name="gamef">Hra %d</string>
<string name="playerf">Hráč %d</string>
<string name="initial_game_minutes">Trvanie hry v minutách</string>
<string name="initial_player_minutes">Trvanie hry v minutách</string>
</resources>

View file

@ -26,7 +26,7 @@
<string name="key_sms_port">key_sms_port</string>
<string name="key_dict_host">key_dict_host</string>
<string name="key_board_size">key_board_size</string>
<string name="key_initial_game_minutes">key_initial_game_minutes</string>
<string name="key_initial_player_minutes">key_initial_player_minutes</string>
<string name="key_default_dict">key_default_dict</string>
<string name="key_default_phonies">key_default_phonies</string>
<string name="key_default_timerenabled">key_default_timerenabled</string>

View file

@ -165,7 +165,7 @@
<string name="configure_role">Configure connection</string>
<string name="configure_rolef">Configure %s connection</string>
<string name="settings_label">Game settings</string>
<string name="minutes_label">Minutes in game</string>
<string name="minutes_label">Minutes per player</string>
<string name="smart_robot">Smart robot</string>
@ -328,7 +328,7 @@
<string name="gamef">Game %d</string>
<string name="playerf">Player %d</string>
<string name="initial_game_minutes">Game time (minutes)</string>
<string name="initial_player_minutes">Timer minutes per player</string>
<string name="git_rev_title">Source version id</string>

View file

@ -24,8 +24,8 @@
android:defaultValue="false"
/>
<EditTextPreference android:key="@string/key_initial_game_minutes"
android:title="@string/initial_game_minutes"
<EditTextPreference android:key="@string/key_initial_player_minutes"
android:title="@string/initial_player_minutes"
android:defaultValue="25"
android:numeric="decimal"
/>

View file

@ -430,7 +430,8 @@ public class GameConfig extends Activity implements View.OnClickListener {
m_phoniesSpinner.setSelection( m_gi.phoniesAction.ordinal() );
Utils.setChecked( this, R.id.hints_allowed, !m_gi.hintsNotAllowed );
Utils.setInt( this, R.id.timer_minutes_edit, m_gi.gameSeconds/60 );
Utils.setInt( this, R.id.timer_minutes_edit,
m_gi.gameSeconds/60/m_gi.nPlayers );
CheckBox check = (CheckBox)findViewById( R.id.use_timer );
CompoundButton.OnCheckedChangeListener lstnr =
@ -773,7 +774,8 @@ public class GameConfig extends Activity implements View.OnClickListener {
{
m_gi.hintsNotAllowed = !Utils.getChecked( this, R.id.hints_allowed );
m_gi.timerEnabled = Utils.getChecked( this, R.id.use_timer );
m_gi.gameSeconds = 60 * Utils.getInt( this, R.id.timer_minutes_edit );
m_gi.gameSeconds = 60 * m_gi.nPlayers *
Utils.getInt( this, R.id.timer_minutes_edit );
m_gi.robotSmartness
= Utils.getChecked( this, R.id.smart_robot ) ? 1 : 0;

View file

@ -115,7 +115,7 @@ public class PrefsActivity extends PreferenceActivity
// R.string.key_sms_port,
R.string.key_dict_host,
R.string.key_board_size,
R.string.key_initial_game_minutes,
R.string.key_initial_player_minutes,
R.string.key_default_dict,
R.string.key_default_phonies,
};

View file

@ -165,9 +165,9 @@ public class CommonPrefs {
}
}
public static int getDefaultGameMinutes( Context context )
public static int getDefaultPlayerMinutes( Context context )
{
String value = getString( context, R.string.key_initial_game_minutes );
String value = getString( context, R.string.key_initial_player_minutes );
try {
return Integer.parseInt( value );
} catch ( Exception ex ) {

View file

@ -58,7 +58,8 @@ public class CurGameInfo {
public CurGameInfo( Context context ) {
m_inProgress = false;
nPlayers = 2;
gameSeconds = 60 * CommonPrefs.getDefaultGameMinutes( context );
gameSeconds = 60 * nPlayers *
CommonPrefs.getDefaultPlayerMinutes( context );
boardSize = CommonPrefs.getDefaultBoardSize( context );
players = new LocalPlayer[MAX_NUM_PLAYERS];
serverRole = DeviceRole.SERVER_STANDALONE;