mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-02-20 02:57:53 +01:00
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:
parent
1f01daf133
commit
7f5718ccb2
|
@ -887,6 +887,10 @@ public class DroidFish extends Activity implements GUIInterface {
|
||||||
|
|
||||||
private final void setEngineStrength(String engine, int strength) {
|
private final void setEngineStrength(String engine, int strength) {
|
||||||
ctrl.setEngineStrength(engine, strength);
|
ctrl.setEngineStrength(engine, strength);
|
||||||
|
setEngineTitle(engine, strength);
|
||||||
|
}
|
||||||
|
|
||||||
|
private final void setEngineTitle(String engine, int strength) {
|
||||||
if (engine.contains("/")) {
|
if (engine.contains("/")) {
|
||||||
int idx = engine.lastIndexOf('/');
|
int idx = engine.lastIndexOf('/');
|
||||||
String eName = engine.substring(idx + 1);
|
String eName = engine.substring(idx + 1);
|
||||||
|
@ -897,7 +901,8 @@ public class DroidFish extends Activity implements GUIInterface {
|
||||||
String eName = getString(engine.equals("cuckoochess") ?
|
String eName = getString(engine.equals("cuckoochess") ?
|
||||||
R.string.cuckoochess_engine :
|
R.string.cuckoochess_engine :
|
||||||
R.string.stockfish_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));
|
engineTitleText.setText(String.format("%s: %d%%", eName, strength / 10));
|
||||||
} else {
|
} else {
|
||||||
engineTitleText.setText(eName);
|
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) {
|
private final void setFullScreenMode(boolean fullScreenMode) {
|
||||||
WindowManager.LayoutParams attrs = getWindow().getAttributes();
|
WindowManager.LayoutParams attrs = getWindow().getAttributes();
|
||||||
if (fullScreenMode) {
|
if (fullScreenMode) {
|
||||||
|
@ -1388,6 +1400,7 @@ public class DroidFish extends Activity implements GUIInterface {
|
||||||
ctrl.newGame(gameMode);
|
ctrl.newGame(gameMode);
|
||||||
ctrl.startGame();
|
ctrl.startGame();
|
||||||
setBoardFlip(true);
|
setBoardFlip(true);
|
||||||
|
updateEngineTitle();
|
||||||
}
|
}
|
||||||
|
|
||||||
static private final int PROMOTE_DIALOG = 0;
|
static private final int PROMOTE_DIALOG = 0;
|
||||||
|
|
|
@ -77,6 +77,9 @@ public interface GUIInterface {
|
||||||
/** Report remaining thinking time to GUI. */
|
/** Report remaining thinking time to GUI. */
|
||||||
public void setRemainingTime(long wTime, long bTime, long nextUpdate);
|
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. */
|
/** Report a move made that is a candidate for GUI animation. */
|
||||||
public void setAnimMove(Position sourcePos, Move move, boolean forward);
|
public void setAnimMove(Position sourcePos, Move move, boolean forward);
|
||||||
|
|
||||||
|
|
|
@ -128,6 +128,7 @@ public class DroidChessController {
|
||||||
updateGameMode();
|
updateGameMode();
|
||||||
abortSearch();
|
abortSearch();
|
||||||
updateComputeThreads();
|
updateComputeThreads();
|
||||||
|
gui.updateEngineTitle();
|
||||||
updateGUI();
|
updateGUI();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user