From 96df6aa3c73d25571802267cfcc63729a7cb0084 Mon Sep 17 00:00:00 2001 From: Hiraoka Date: Fri, 12 Feb 2021 23:32:25 +0900 Subject: [PATCH 1/2] Show "pass" mark on the board even when show-move-number is true --- .../featurecat/lizzie/gui/BoardRenderer.java | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/main/java/featurecat/lizzie/gui/BoardRenderer.java b/src/main/java/featurecat/lizzie/gui/BoardRenderer.java index 76351c04d..5f8c3ea29 100644 --- a/src/main/java/featurecat/lizzie/gui/BoardRenderer.java +++ b/src/main/java/featurecat/lizzie/gui/BoardRenderer.java @@ -715,29 +715,31 @@ 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; } + 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()); From 92e298d107df485f7b1c5867ae0cf83100efa4f8 Mon Sep 17 00:00:00 2001 From: Hiraoka Date: Sat, 13 Feb 2021 07:26:00 +0900 Subject: [PATCH 2/2] Fixup to the previous commit 'Show "pass" mark ...' --- .../featurecat/lizzie/gui/BoardRenderer.java | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/src/main/java/featurecat/lizzie/gui/BoardRenderer.java b/src/main/java/featurecat/lizzie/gui/BoardRenderer.java index 5f8c3ea29..d5a82abe2 100644 --- a/src/main/java/featurecat/lizzie/gui/BoardRenderer.java +++ b/src/main/java/featurecat/lizzie/gui/BoardRenderer.java @@ -695,6 +695,27 @@ private void drawMoveNumbers(Graphics2D g) { if (Lizzie.board == null) return; Board board = Lizzie.board; Optional 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(); @@ -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());