From e1d279c4b7254e6c53903e86bf85996bba7b12e1 Mon Sep 17 00:00:00 2001 From: Hiraoka Date: Sun, 7 Feb 2021 19:35:49 +0900 Subject: [PATCH] Revive stoneless movenums in #223, that was disabled by #436 and #586 --- src/main/java/featurecat/lizzie/gui/BoardRenderer.java | 5 ++--- src/main/java/featurecat/lizzie/gui/Input.java | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/featurecat/lizzie/gui/BoardRenderer.java b/src/main/java/featurecat/lizzie/gui/BoardRenderer.java index 76351c04d..556019295 100644 --- a/src/main/java/featurecat/lizzie/gui/BoardRenderer.java +++ b/src/main/java/featurecat/lizzie/gui/BoardRenderer.java @@ -627,7 +627,7 @@ private void drawBranch() { variation = suggestedMove.get().variation; } } - Branch branch = new Branch(Lizzie.board, variation, displayedBranchLength); + Branch branch = new Branch(Lizzie.board, variation, -1); if (isMainBoard) mouseOverCoords = suggestedMove.get().coordinate; branchOpt = Optional.of(branch); variationOpt = Optional.of(variation); @@ -766,14 +766,13 @@ private void drawMoveNumbers(Graphics2D g) { if (moveNumberList[Board.getIndex(i, j)] > 0 && (!branchOpt.isPresent() || !Lizzie.frame.isMouseOver(i, j))) { boolean reverse = (moveNumberList[Board.getIndex(i, j)] > maxBranchMoves()); + if (reverse && !Lizzie.config.showRawBoard) continue; if (lastMoveOpt.isPresent() && lastMoveOpt.get()[0] == i && lastMoveOpt.get()[1] == j) { - if (reverse) continue; g.setColor(Color.RED.brighter()); // stoneHere.isBlack() ? Color.RED.brighter() : // Color.BLUE.brighter()); } else { // Draw white letters on black stones nomally. // But use black letters for showing black moves without stones. - if (reverse) continue; g.setColor(stoneHere.isBlack() ^ reverse ? Color.WHITE : Color.BLACK); } diff --git a/src/main/java/featurecat/lizzie/gui/Input.java b/src/main/java/featurecat/lizzie/gui/Input.java index bd5298a41..d6cc2623c 100644 --- a/src/main/java/featurecat/lizzie/gui/Input.java +++ b/src/main/java/featurecat/lizzie/gui/Input.java @@ -216,7 +216,7 @@ public void keyPressed(KeyEvent e) { } else if (controlIsPressed(e)) { undo(10); } else { - if (Lizzie.frame.isMouseOver) { + if (Lizzie.frame.isMouseOver && !Lizzie.config.showRawBoard) { Lizzie.frame.doBranch(-1); } else { undo(); @@ -238,7 +238,7 @@ public void keyPressed(KeyEvent e) { } else if (controlIsPressed(e)) { redo(10); } else { - if (Lizzie.frame.isMouseOver) { + if (Lizzie.frame.isMouseOver && !Lizzie.config.showRawBoard) { Lizzie.frame.doBranch(1); } else { redo();