mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-12-18 19:52:19 +01:00
DroidFish: Added option to not highlight the last played move.
This commit is contained in:
@@ -52,6 +52,7 @@ public abstract class ChessBoard extends View {
|
||||
public boolean flipped;
|
||||
public boolean drawSquareLabels;
|
||||
boolean toggleSelection;
|
||||
boolean highlightLastMove; // If true, last move is marked with a rectangle
|
||||
|
||||
List<Move> moveHints;
|
||||
|
||||
@@ -97,6 +98,7 @@ public abstract class ChessBoard extends View {
|
||||
flipped = false;
|
||||
drawSquareLabels = false;
|
||||
toggleSelection = false;
|
||||
highlightLastMove = true;
|
||||
|
||||
darkPaint = new Paint();
|
||||
brightPaint = new Paint();
|
||||
|
||||
@@ -113,7 +113,7 @@ public class ChessBoardPlay extends ChessBoard {
|
||||
}
|
||||
if (!myColor(p)) {
|
||||
Move m = new Move(selectedSquare, sq, Piece.EMPTY);
|
||||
setSelection(sq);
|
||||
setSelection(highlightLastMove ? sq : -1);
|
||||
userSelectedSquare = false;
|
||||
return m;
|
||||
} else
|
||||
@@ -140,7 +140,7 @@ public class ChessBoardPlay extends ChessBoard {
|
||||
anyMatch = match.second;
|
||||
}
|
||||
if (matchingMove != null) {
|
||||
setSelection(matchingMove.to);
|
||||
setSelection(highlightLastMove ? matchingMove.to : -1);
|
||||
userSelectedSquare = false;
|
||||
return matchingMove;
|
||||
}
|
||||
|
||||
@@ -515,6 +515,7 @@ public class DroidFish extends Activity implements GUIInterface {
|
||||
cb.setDrawSquareLabels(oldCB.drawSquareLabels);
|
||||
cb.oneTouchMoves = oldCB.oneTouchMoves;
|
||||
cb.toggleSelection = oldCB.toggleSelection;
|
||||
cb.highlightLastMove = oldCB.highlightLastMove;
|
||||
setSelection(oldCB.selectedSquare);
|
||||
cb.userSelectedSquare = oldCB.userSelectedSquare;
|
||||
setStatusString(statusStr);
|
||||
@@ -822,6 +823,7 @@ public class DroidFish extends Activity implements GUIInterface {
|
||||
cb.setDrawSquareLabels(drawSquareLabels);
|
||||
cb.oneTouchMoves = settings.getBoolean("oneTouchMoves", false);
|
||||
cb.toggleSelection = getIntSetting("squareSelectType", 0) == 1;
|
||||
cb.highlightLastMove = settings.getBoolean("highlightLastMove", true);
|
||||
|
||||
mShowThinking = settings.getBoolean("showThinking", false);
|
||||
mShowStats = settings.getBoolean("showStats", true);
|
||||
@@ -1358,7 +1360,7 @@ public class DroidFish extends Activity implements GUIInterface {
|
||||
|
||||
@Override
|
||||
public void setSelection(int sq) {
|
||||
cb.setSelection(sq);
|
||||
cb.setSelection(cb.highlightLastMove ? sq : -1);
|
||||
cb.userSelectedSquare = false;
|
||||
setEgtbHints(sq);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user