DroidFish: If setting strength to 0% when stockfish engine is used, show a hint that using the CuckooChess engine gives even lower strength.

This commit is contained in:
Peter Osterlund 2012-04-08 16:42:21 +00:00
parent a0eb057e4a
commit cc5582bdbc
3 changed files with 19 additions and 3 deletions

View File

@ -329,6 +329,7 @@ you are not actively using the program.\
<string name="engine_terminated">Engine terminated</string>
<string name="uci_protocol_error">UCI protocol error</string>
<string name="start_new_game">Start New Game?</string>
<string name="strength_cuckoo_hint">Use the CuckooChess engine for even lower strength.</string>
<string name="err_too_few_spaces">Too few spaces</string>
<string name="err_invalid_piece">Invalid piece</string>

View File

@ -132,13 +132,15 @@ public class DroidFish extends Activity implements GUIInterface {
// FIXME!!! Show extended book info. (Win percent, number of games, performance rating, etc.)
// FIXME!!! Green color for "main move". Red color for "don't play in tournaments" moves.
// FIXME!!! Add anti-lamer test: 8/8/8/8/8/8/3R3r/k3K2R w K - 0 1 bm O-O
// FIXME!!! Add anti-lamer test: 4kr2/8/8/4PpN1/8/8/4Q3/3RK3 w - f6 0 2 bm exf6
// FIXME!!! ECO opening codes
// FIXME!!! Remember multi-PV analysis setting when program restarted.
// FIXME!!! Use high-res buttons from Scid on the go.
// FIXME!!! Option to display coordinates in border outside chess board.
// FIXME!!! Hard to understand how to undo a single half-move.
// FIXME!!! Hard to understand how "save game" works.
// FIXME!!! Better behavior if engine is terminated. How exactly?
// FIXME!!! Handle PGN intents with more than one game.
// FIXME!!! Make engine hash size configurable.

View File

@ -26,6 +26,7 @@ import android.content.SharedPreferences;
import android.content.res.TypedArray;
import android.graphics.Typeface;
import android.preference.Preference;
import android.preference.PreferenceManager;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.KeyEvent;
@ -38,6 +39,7 @@ import android.widget.LinearLayout;
import android.widget.SeekBar;
import android.widget.TextView;
import android.widget.SeekBar.OnSeekBarChangeListener;
import android.widget.Toast;
/** Lets user enter a percentage value using a seek bar. */
public class SeekBarPreference extends Preference
@ -46,6 +48,7 @@ public class SeekBarPreference extends Preference
private final static int DEFAULT_VALUE = 1000;
private int currVal = DEFAULT_VALUE;
private TextView currValBox;
private boolean showStrengthHint = true;
public SeekBarPreference(Context context) {
super(context);
@ -187,6 +190,16 @@ public class SeekBarPreference extends Preference
SharedPreferences.Editor editor = getEditor();
editor.putInt(getKey(), progress);
editor.commit();
if ((progress == 0) && showStrengthHint) {
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(getContext());
String engine = settings.getString("engine", "stockfish");
if ("stockfish".equals(engine)) {
showStrengthHint = false;
if (getKey().equals("strength"))
Toast.makeText(getContext(), R.string.strength_cuckoo_hint,
Toast.LENGTH_LONG).show();
}
}
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {