Skip to content

Commit

Permalink
Merge featurecat#873 (squashed)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiraoka committed Feb 17, 2021
1 parent 9dc13b3 commit d8be7ea
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions src/main/java/featurecat/lizzie/gui/BoardRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,27 @@ private void drawMoveNumbers(Graphics2D g) {
if (Lizzie.board == null) return;
Board board = Lizzie.board;
Optional<int[]> lastMoveOpt = branchOpt.map(b -> b.data.lastMove).orElse(board.getLastMove());

if (!lastMoveOpt.isPresent() && board.getData().moveNumber != 0 && !board.inScoreMode()) {
g.setColor(
board.getData().blackToPlay ? new Color(255, 255, 255, 150) : new Color(0, 0, 0, 150));
g.fillOval(
x + boardWidth / 2 - 4 * stoneRadius,
y + boardHeight / 2 - 4 * stoneRadius,
stoneRadius * 8,
stoneRadius * 8);
g.setColor(
board.getData().blackToPlay ? new Color(0, 0, 0, 255) : new Color(255, 255, 255, 255));
drawString(
g,
x + boardWidth / 2,
y + boardHeight / 2,
MainFrame.uiFont,
"pass",
stoneRadius * 4,
stoneRadius * 6);
}

if (Lizzie.config.allowMoveNumber == 0 && !branchOpt.isPresent()) {
if (lastMoveOpt.isPresent()) {
int[] lastMove = lastMoveOpt.get();
Expand All @@ -748,24 +769,6 @@ private void drawMoveNumbers(Graphics2D g) {
} else {
drawCircle(g, stoneX, stoneY, lastMoveMarkerRadius);
}
} else if (board.getData().moveNumber != 0 && !board.inScoreMode()) {
g.setColor(
board.getData().blackToPlay ? new Color(255, 255, 255, 150) : new Color(0, 0, 0, 150));
g.fillOval(
x + boardWidth / 2 - 4 * stoneRadius,
y + boardHeight / 2 - 4 * stoneRadius,
stoneRadius * 8,
stoneRadius * 8);
g.setColor(
board.getData().blackToPlay ? new Color(0, 0, 0, 255) : new Color(255, 255, 255, 255));
drawString(
g,
x + boardWidth / 2,
y + boardHeight / 2,
MainFrame.uiFont,
"pass",
stoneRadius * 4,
stoneRadius * 6);
}

return;
Expand Down

0 comments on commit d8be7ea

Please sign in to comment.