From 271e5def409acaff4209c39ef9f26ff303aee48c Mon Sep 17 00:00:00 2001 From: zsalch Date: Tue, 18 Sep 2018 14:31:31 +0800 Subject: [PATCH 1/3] Support Display Only Last Move Number --- src/main/java/featurecat/lizzie/gui/BoardRenderer.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/featurecat/lizzie/gui/BoardRenderer.java b/src/main/java/featurecat/lizzie/gui/BoardRenderer.java index bdc437d7f..3c87a2b5d 100644 --- a/src/main/java/featurecat/lizzie/gui/BoardRenderer.java +++ b/src/main/java/featurecat/lizzie/gui/BoardRenderer.java @@ -469,11 +469,20 @@ private void drawMoveNumbers(Graphics2D g) { int[] moveNumberList = branch == null ? Lizzie.board.getMoveNumberList() : branch.data.moveNumberList; + // Allow to display only last move number + int lastMoveNumber = Lizzie.board.getData().moveNumber; + int onlyLastMoveNumber = (!Lizzie.config.uiConfig.isNull("only-last-move-number")) ? Lizzie.config.uiConfig.getInt("only-last-move-number") : 9999; + for (int i = 0; i < Board.BOARD_SIZE; i++) { for (int j = 0; j < Board.BOARD_SIZE; j++) { int stoneX = x + scaledMargin + squareLength * i; int stoneY = y + scaledMargin + squareLength * j; + // Allow to display only last move number + if (lastMoveNumber - moveNumberList[Board.getIndex(i, j)] >= onlyLastMoveNumber) { + continue; + } + Stone stoneAtThisPoint = branch == null ? Lizzie.board.getStones()[Board.getIndex(i, j)] : branch.data.stones[Board.getIndex(i, j)]; From c5e326a223695e15a7edb4c85fd52874ba65e066 Mon Sep 17 00:00:00 2001 From: zsalch Date: Wed, 19 Sep 2018 07:42:49 +0800 Subject: [PATCH 2/3] Change uiConfig.optInt Method --- src/main/java/featurecat/lizzie/gui/BoardRenderer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/featurecat/lizzie/gui/BoardRenderer.java b/src/main/java/featurecat/lizzie/gui/BoardRenderer.java index 3c87a2b5d..7b44a7191 100644 --- a/src/main/java/featurecat/lizzie/gui/BoardRenderer.java +++ b/src/main/java/featurecat/lizzie/gui/BoardRenderer.java @@ -471,8 +471,8 @@ private void drawMoveNumbers(Graphics2D g) { // Allow to display only last move number int lastMoveNumber = Lizzie.board.getData().moveNumber; - int onlyLastMoveNumber = (!Lizzie.config.uiConfig.isNull("only-last-move-number")) ? Lizzie.config.uiConfig.getInt("only-last-move-number") : 9999; - + int onlyLastMoveNumber = Lizzie.config.uiConfig.optInt("only-last-move-number", 9999); + for (int i = 0; i < Board.BOARD_SIZE; i++) { for (int j = 0; j < Board.BOARD_SIZE; j++) { int stoneX = x + scaledMargin + squareLength * i; From b8af7a44ae78a506579d7c1db78bacb25822a226 Mon Sep 17 00:00:00 2001 From: zsalch Date: Tue, 25 Sep 2018 13:11:32 +0800 Subject: [PATCH 3/3] Fix branch move number when mouse moveover --- src/main/java/featurecat/lizzie/gui/BoardRenderer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/featurecat/lizzie/gui/BoardRenderer.java b/src/main/java/featurecat/lizzie/gui/BoardRenderer.java index 7b44a7191..0fa1d3fd5 100644 --- a/src/main/java/featurecat/lizzie/gui/BoardRenderer.java +++ b/src/main/java/featurecat/lizzie/gui/BoardRenderer.java @@ -470,7 +470,7 @@ private void drawMoveNumbers(Graphics2D g) { int[] moveNumberList = branch == null ? Lizzie.board.getMoveNumberList() : branch.data.moveNumberList; // Allow to display only last move number - int lastMoveNumber = Lizzie.board.getData().moveNumber; + int lastMoveNumber = branch == null ? Lizzie.board.getData().moveNumber : branch.data.moveNumber; int onlyLastMoveNumber = Lizzie.config.uiConfig.optInt("only-last-move-number", 9999); for (int i = 0; i < Board.BOARD_SIZE; i++) {