mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2024-11-27 14:15:16 +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) {
|
||||
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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -128,6 +128,7 @@ public class DroidChessController {
|
|||
updateGameMode();
|
||||
abortSearch();
|
||||
updateComputeThreads();
|
||||
gui.updateEngineTitle();
|
||||
updateGUI();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user