Skip to content

Commit

Permalink
check PGN line length > 0, add update rate
Browse files Browse the repository at this point in the history
  • Loading branch information
fohristiwhirl committed Jun 7, 2019
1 parent 54c59fa commit 032ae8a
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 3 deletions.
4 changes: 2 additions & 2 deletions 8_renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ function make_renderer() {

for (let m of renderer.moves) {

if (renderer.pgn_line && deviated_from_pgn === false && renderer.pgn_line[i] !== m) {
if (renderer.pgn_line && renderer.pgn_line.length > 0 && deviated_from_pgn === false && renderer.pgn_line[i] !== m) {
elements1.push(`<span class="red">(deviated)</span>`);
deviated_from_pgn = true;
}
Expand All @@ -642,7 +642,7 @@ function make_renderer() {

for (let m of renderer.user_line.slice(renderer.moves.length)) {

if (renderer.pgn_line && deviated_from_pgn === false && renderer.pgn_line[i] !== m) {
if (renderer.pgn_line && renderer.pgn_line.length > 0 && deviated_from_pgn === false && renderer.pgn_line[i] !== m) {
elements2.push(`<span class="red">(deviated)</span>`);
deviated_from_pgn = true;
}
Expand Down
43 changes: 42 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,48 @@ function menu_build() {
}
}
]
}
},
{
label: "Update rate",
submenu: [
{
label: "Slow",
click: () => {
windows.send("main-window", "set", {
key: "update_delay",
value: 500,
});
}
},
{
label: "Fast",
click: () => {
windows.send("main-window", "set", {
key: "update_delay",
value: 200,
});
}
},
{
label: "Faster",
click: () => {
windows.send("main-window", "set", {
key: "update_delay",
value: 80,
});
}
},
{
label: "Hyper",
click: () => {
windows.send("main-window", "set", {
key: "update_delay",
value: 20,
});
}
},
]
}
]
}
];
Expand Down

0 comments on commit 032ae8a

Please sign in to comment.