Skip to content

Commit

Permalink
Fixup to the previous commit 'Show "pass" mark ...'
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiraoka committed Feb 12, 2021
1 parent 96df6aa commit 92e298d
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions src/main/java/featurecat/lizzie/gui/BoardRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,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 @@ -720,26 +741,6 @@ private void drawMoveNumbers(Graphics2D g) {
return;
}

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

int[] moveNumberList =
branchOpt.map(b -> b.data.moveNumberList).orElse(board.getMoveNumberList());

Expand Down

0 comments on commit 92e298d

Please sign in to comment.