Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distinguish the next move. #81

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/modules/board_drawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -946,9 +946,13 @@ let board_drawer_prototype = {

for (let n = 0; n < node.children.length; n++) {

let is_main_line = (n === 0 && node.children.length !== 1);

for (let key of ["B", "W"]) {

let draw_colour = (key === "B") ? "#00000080" : "#ffffffa0";
let black_code = is_main_line ? "#000000d0" : "#00000080";
let white_code = is_main_line ? "#fffffff0" : "#ffffffa0";
let draw_colour = (key === "B") ? black_code : white_code;

let moves_played = node.children[n].all_values(key);

Expand All @@ -964,13 +968,15 @@ let board_drawer_prototype = {
if (this.needed_marks[x][y]) {
if (!this.needed_marks[x][y].next_mark_colour) {
this.needed_marks[x][y].next_mark_colour = draw_colour;
this.needed_marks[x][y].is_main_line = is_main_line;
} else {
// We already have this mark due to some sibling, do nothing.
}
} else {
this.needed_marks[x][y] = {
type: "next",
next_mark_colour: draw_colour,
is_main_line: is_main_line,
};
}
}
Expand Down