DroidFish: Added option to not highlight the last played move.

This commit is contained in:
Peter Osterlund
2012-12-29 21:09:16 +00:00
parent 55a328134c
commit 5a0b918bc6
5 changed files with 19 additions and 6 deletions

View File

@@ -204,8 +204,10 @@ you are not actively using the program.\
<string name="start_new_game">Start New Game?</string>
<string name="strength_cuckoo_hint">Use the CuckooChess engine for even lower strength.</string>
<string name="piece_names">P N B R Q K</string>
<string name="material_diff_summary">Displays an additional subtitle for captured pieces</string>
<string name="highlight_last_move_title">Highlight last move</string>
<string name="highlight_last_move_summary">Draw rectangle around last moved piece</string>
<string name="material_diff_title">Show Material Difference</string>
<string name="material_diff_summary">Displays an additional subtitle for captured pieces</string>
<string name="err_too_few_spaces">Too few spaces</string>
<string name="err_invalid_piece">Invalid piece</string>
<string name="err_invalid_side">Invalid side</string>

View File

@@ -87,10 +87,17 @@
android:entries="@array/thinking_arrows_texts"
android:defaultValue="@string/thinking_arrows_default">
</ListPreference>
<CheckBoxPreference
android:key="highlightLastMove"
android:title="@string/highlight_last_move_title"
android:summary="@string/highlight_last_move_summary"
android:defaultValue="true">
</CheckBoxPreference>
<CheckBoxPreference
android:key="materialDiff"
android:title="@string/material_diff_title"
android:summary="@string/material_diff_summary"
android:title="@string/material_diff_title">
android:defaultValue="false">
</CheckBoxPreference>
</PreferenceCategory>
<PreferenceCategory

View File

@@ -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();

View File

@@ -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;
}

View File

@@ -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);
}