mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2024-11-23 11:31:33 +01:00
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:
parent
a0eb057e4a
commit
cc5582bdbc
|
@ -329,6 +329,7 @@ you are not actively using the program.\
|
||||||
<string name="engine_terminated">Engine terminated</string>
|
<string name="engine_terminated">Engine terminated</string>
|
||||||
<string name="uci_protocol_error">UCI protocol error</string>
|
<string name="uci_protocol_error">UCI protocol error</string>
|
||||||
<string name="start_new_game">Start New Game?</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_too_few_spaces">Too few spaces</string>
|
||||||
<string name="err_invalid_piece">Invalid piece</string>
|
<string name="err_invalid_piece">Invalid piece</string>
|
||||||
|
|
|
@ -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!!! 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!!! Green color for "main move". Red color for "don't play in tournaments" moves.
|
||||||
|
// FIXME!!! ECO opening codes
|
||||||
// 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!!! Remember multi-PV analysis setting when program restarted.
|
// FIXME!!! Remember multi-PV analysis setting when program restarted.
|
||||||
// FIXME!!! Use high-res buttons from Scid on the go.
|
// 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!!! Better behavior if engine is terminated. How exactly?
|
||||||
// FIXME!!! Handle PGN intents with more than one game.
|
// FIXME!!! Handle PGN intents with more than one game.
|
||||||
// FIXME!!! Make engine hash size configurable.
|
// FIXME!!! Make engine hash size configurable.
|
||||||
|
|
|
@ -26,6 +26,7 @@ import android.content.SharedPreferences;
|
||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
import android.graphics.Typeface;
|
import android.graphics.Typeface;
|
||||||
import android.preference.Preference;
|
import android.preference.Preference;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
|
@ -38,6 +39,7 @@ import android.widget.LinearLayout;
|
||||||
import android.widget.SeekBar;
|
import android.widget.SeekBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.SeekBar.OnSeekBarChangeListener;
|
import android.widget.SeekBar.OnSeekBarChangeListener;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
/** Lets user enter a percentage value using a seek bar. */
|
/** Lets user enter a percentage value using a seek bar. */
|
||||||
public class SeekBarPreference extends Preference
|
public class SeekBarPreference extends Preference
|
||||||
|
@ -46,6 +48,7 @@ public class SeekBarPreference extends Preference
|
||||||
private final static int DEFAULT_VALUE = 1000;
|
private final static int DEFAULT_VALUE = 1000;
|
||||||
private int currVal = DEFAULT_VALUE;
|
private int currVal = DEFAULT_VALUE;
|
||||||
private TextView currValBox;
|
private TextView currValBox;
|
||||||
|
private boolean showStrengthHint = true;
|
||||||
|
|
||||||
public SeekBarPreference(Context context) {
|
public SeekBarPreference(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
|
@ -187,6 +190,16 @@ public class SeekBarPreference extends Preference
|
||||||
SharedPreferences.Editor editor = getEditor();
|
SharedPreferences.Editor editor = getEditor();
|
||||||
editor.putInt(getKey(), progress);
|
editor.putInt(getKey(), progress);
|
||||||
editor.commit();
|
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
|
@Override
|
||||||
public void onStartTrackingTouch(SeekBar seekBar) {
|
public void onStartTrackingTouch(SeekBar seekBar) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user