DroidFish: In analysis mode, don't show the strength setting in the title bar. Strength is always 100% in analysis mode.

This commit is contained in:
Peter Osterlund 2012-08-26 15:28:58 +00:00
parent 1f01daf133
commit 7f5718ccb2
3 changed files with 18 additions and 1 deletions

View File

@ -887,6 +887,10 @@ public class DroidFish extends Activity implements GUIInterface {
private final void setEngineStrength(String engine, int strength) {
ctrl.setEngineStrength(engine, strength);
setEngineTitle(engine, strength);
}
private final void setEngineTitle(String engine, int strength) {
if (engine.contains("/")) {
int idx = engine.lastIndexOf('/');
String eName = engine.substring(idx + 1);
@ -897,7 +901,8 @@ public class DroidFish extends Activity implements GUIInterface {
String eName = getString(engine.equals("cuckoochess") ?
R.string.cuckoochess_engine :
R.string.stockfish_engine);
if (strength < 1000) {
boolean analysis = (ctrl != null) && ctrl.analysisMode();
if ((strength < 1000) && !analysis) {
engineTitleText.setText(String.format("%s: %d%%", eName, strength / 10));
} else {
engineTitleText.setText(eName);
@ -905,6 +910,13 @@ public class DroidFish extends Activity implements GUIInterface {
}
}
@Override
public void updateEngineTitle() {
String engine = settings.getString("engine", "stockfish");
int strength = settings.getInt("strength", 1000);
setEngineTitle(engine, strength);
}
private final void setFullScreenMode(boolean fullScreenMode) {
WindowManager.LayoutParams attrs = getWindow().getAttributes();
if (fullScreenMode) {
@ -1388,6 +1400,7 @@ public class DroidFish extends Activity implements GUIInterface {
ctrl.newGame(gameMode);
ctrl.startGame();
setBoardFlip(true);
updateEngineTitle();
}
static private final int PROMOTE_DIALOG = 0;

View File

@ -77,6 +77,9 @@ public interface GUIInterface {
/** Report remaining thinking time to GUI. */
public void setRemainingTime(long wTime, long bTime, long nextUpdate);
/** Update engine title text. */
public void updateEngineTitle();
/** Report a move made that is a candidate for GUI animation. */
public void setAnimMove(Position sourcePos, Move move, boolean forward);

View File

@ -128,6 +128,7 @@ public class DroidChessController {
updateGameMode();
abortSearch();
updateComputeThreads();
gui.updateEngineTitle();
updateGUI();
}
}