Skip to content

Commit

Permalink
Merge pull request #367 from zsalch/next_lmn
Browse files Browse the repository at this point in the history
next: Support Display Only Last Move Number
  • Loading branch information
featurecat committed Oct 1, 2018
2 parents 5abb9f4 + b8af7a4 commit d7fd4c6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/featurecat/lizzie/gui/BoardRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -473,11 +473,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 = 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++) {
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)];

Expand Down

0 comments on commit d7fd4c6

Please sign in to comment.