DroidFish: Fixed problems with the "Flip Board: Player" setting. Board flip should be considered when editing the game headers and when changing the player name in preferences.

This commit is contained in:
Peter Osterlund 2012-05-15 17:46:41 +00:00
parent 5601d65217
commit ad76eda35b

View File

@ -684,11 +684,12 @@ public class DroidFish extends Activity implements GUIInterface {
private final void readPrefs() { private final void readPrefs() {
int modeNr = getIntSetting("gameMode", 1); int modeNr = getIntSetting("gameMode", 1);
gameMode = new GameMode(modeNr); gameMode = new GameMode(modeNr);
String oldPlayerName = playerName;
playerName = settings.getString("playerName", "Player"); playerName = settings.getString("playerName", "Player");
boardFlipped = settings.getBoolean("boardFlipped", false); boardFlipped = settings.getBoolean("boardFlipped", false);
autoSwapSides = settings.getBoolean("autoSwapSides", false); autoSwapSides = settings.getBoolean("autoSwapSides", false);
playerNameFlip = settings.getBoolean("playerNameFlip", true); playerNameFlip = settings.getBoolean("playerNameFlip", true);
setBoardFlip(false); setBoardFlip(!playerName.equals(oldPlayerName));
boolean drawSquareLabels = settings.getBoolean("drawSquareLabels", false); boolean drawSquareLabels = settings.getBoolean("drawSquareLabels", false);
cb.setDrawSquareLabels(drawSquareLabels); cb.setDrawSquareLabels(drawSquareLabels);
cb.oneTouchMoves = settings.getBoolean("oneTouchMoves", false); cb.oneTouchMoves = settings.getBoolean("oneTouchMoves", false);
@ -1857,6 +1858,7 @@ public class DroidFish extends Activity implements GUIInterface {
headers.put("White", white.getText().toString().trim()); headers.put("White", white.getText().toString().trim());
headers.put("Black", black.getText().toString().trim()); headers.put("Black", black.getText().toString().trim());
ctrl.setHeaders(headers); ctrl.setHeaders(headers);
setBoardFlip(true);
} }
}); });