From f664e8c3dcb776587c0824a54368deab4648667d Mon Sep 17 00:00:00 2001
From: cyqsimon <28627918+cyqsimon@users.noreply.github.com>
Date: Thu, 5 Jan 2023 19:07:21 +0800
Subject: [PATCH 01/16] Fix icon paths
---
files/scripts/install.sh | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/files/scripts/install.sh b/files/scripts/install.sh
index 62d70f44..236f8309 100755
--- a/files/scripts/install.sh
+++ b/files/scripts/install.sh
@@ -64,11 +64,12 @@ ICON_SVG_PATH="/usr/local/share/icons/hicolor/scalable/apps/nibbler.svg"
echo "Installing Nibbler to ${INSTALL_DIR}"
echo "Creating binary symlink at ${BIN_SYMLINK_PATH}"
echo "Installing desktop entry to ${DESKTOP_ENTRY_PATH}"
-echo "Installing icon to ${ICON_PATH}"
+echo "Installing icons to ${ICON_PNG_PATH} and ${ICON_SVG_PATH}"
echo "This will require sudo privilege."
# remove old and make sure directories are created
-for FILE in "${INSTALL_DIR}" "${BIN_SYMLINK_PATH}" "${DESKTOP_ENTRY_PATH}" "${ICON_PATH}"; do
+for FILE in "${INSTALL_DIR}" "${BIN_SYMLINK_PATH}" "${DESKTOP_ENTRY_PATH}" \
+ "${ICON_PNG_PATH}" "${ICON_SVG_PATH}"; do
sudo rm -rf "$FILE"
sudo mkdir -p $(dirname "$FILE")
done
From eb377961087a01cd448b774cd7a9e0489441dc7f Mon Sep 17 00:00:00 2001
From: rooklift <16438795+rooklift@users.noreply.github.com>
Date: Wed, 25 Jan 2023 15:41:22 +0000
Subject: [PATCH 02/16] In the abnormal situation where there are 2 or more
castling rights on the same side, use the closest when parsing PGN
---
files/src/renderer/40_position.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/files/src/renderer/40_position.js b/files/src/renderer/40_position.js
index 8ce13f48..ef1835b9 100644
--- a/files/src/renderer/40_position.js
+++ b/files/src/renderer/40_position.js
@@ -727,6 +727,7 @@ const position_prototype = {
if (long_flag) {
possible_rights_chars = possible_rights_chars.slice(0, king_loc.x);
+ possible_rights_chars.reverse(); // So we propose the shortest move first, if more than 1 is allowed by the rights.
} else {
possible_rights_chars = possible_rights_chars.slice(king_loc.x + 1);
}
From 3bcbbf5bab747d46a83230fd91a80264f1293a2e Mon Sep 17 00:00:00 2001
From: rooklift <16438795+rooklift@users.noreply.github.com>
Date: Wed, 25 Jan 2023 15:51:12 +0000
Subject: [PATCH 03/16] Update .gitignore
---
files/.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/files/.gitignore b/files/.gitignore
index 43f17e38..de61c20e 100644
--- a/files/.gitignore
+++ b/files/.gitignore
@@ -1,3 +1,4 @@
.DS_Store
scripts/dist
scripts/electron_zipped
+scripts/update_my_installation.py
From 53b815375edca23a7e4bab5af063c4095e90b67d Mon Sep 17 00:00:00 2001
From: rooklift <16438795+rooklift@users.noreply.github.com>
Date: Thu, 27 Apr 2023 15:38:38 +0100
Subject: [PATCH 04/16] config.logfile_timestamp
---
files/src/main.js | 11 +++++++++
files/src/modules/config_io.js | 1 +
files/src/renderer/20_utils.js | 45 ++++++++++++++++++++++++++++++++--
3 files changed, 55 insertions(+), 2 deletions(-)
diff --git a/files/src/main.js b/files/src/main.js
index 120233f6..341618c9 100644
--- a/files/src/main.js
+++ b/files/src/main.js
@@ -4130,6 +4130,17 @@ function menu_build() {
});
}
},
+ {
+ label: "Use unique logfile each time",
+ type: "checkbox",
+ checked: config.logfile_timestamp,
+ click: () => {
+ win.webContents.send("call", {
+ fn: "toggle",
+ args: ["logfile_timestamp"],
+ });
+ }
+ },
{
type: "separator"
},
diff --git a/files/src/modules/config_io.js b/files/src/modules/config_io.js
index 0b7a9b08..51da48e0 100644
--- a/files/src/modules/config_io.js
+++ b/files/src/modules/config_io.js
@@ -141,6 +141,7 @@ exports.defaults = {
"logfile": null,
"clear_log": true,
+ "logfile_timestamp": false,
"log_info_lines": false,
"log_useless_info": false,
"log_illegal_moves": true,
diff --git a/files/src/renderer/20_utils.js b/files/src/renderer/20_utils.js
index 4c11f173..9eec1da0 100644
--- a/files/src/renderer/20_utils.js
+++ b/files/src/renderer/20_utils.js
@@ -313,9 +313,13 @@ function Log(s) {
Log.stream = undefined;
Log.logfilename = undefined;
}
- console.log(`Logging to ${config.logfile}`);
+
+ let actual_filepath = config.logfile_timestamp ? UniqueFilepath(config.logfile) : config.logfile;
+ // Note that this isn't saved even temporarily - as far as the rest of the logic is concerned, we are logging to config.logfile
+
+ console.log(`Logging to ${actual_filepath}`);
let flags = (config.clear_log) ? "w" : "a";
- let stream = fs.createWriteStream(config.logfile, {flags: flags}); // Want var "stream" available via closure for the below...
+ let stream = fs.createWriteStream(actual_filepath, {flags: flags}); // Want var "stream" available via closure for the below...
stream.on("error", (err) => {
console.log(err);
@@ -340,6 +344,43 @@ function LogBoth(s) {
Log(s);
}
+function UniqueFilepath(filepath) {
+
+ const alpha = "abcdefghijklmnopqrstuvwxyz";
+
+ let extname = path.extname(filepath);
+ let basename = path.basename(filepath, extname);
+ let dirname = path.dirname(filepath);
+
+ let dt = new Date();
+
+ let y = dt.getFullYear().toString();
+ let m = (dt.getMonth() + 1).toString();
+ let d = dt.getDate().toString();
+ let h = dt.getHours().toString();
+ let n = dt.getMinutes().toString();
+ let s = dt.getSeconds().toString();
+
+ if (m.length === 1) m = "0" + m;
+ if (d.length === 1) d = "0" + d;
+ if (h.length === 1) h = "0" + h;
+ if (n.length === 1) n = "0" + n;
+ if (s.length === 1) s = "0" + s;
+
+ let newbase = `${basename}-${y}-${m}-${d}-${h}${n}${s}`;
+
+ for (let n = 0; n < 26; n++) {
+ let test = path.join(dirname, newbase) + alpha[n] + extname;
+ if (!fs.existsSync(test)) {
+ return test;
+ }
+ }
+
+ // If you start 27 instances of Nibbler within a second, that's your problem.
+
+ return filepath;
+}
+
function New2DArray(width, height, defval) {
let ret = [];
From 4d65c519cf94ac7cec68b9517e7816a957803b2c Mon Sep 17 00:00:00 2001
From: dav <63931154+dav1312@users.noreply.github.com>
Date: Thu, 16 Feb 2023 22:02:06 +0100
Subject: [PATCH 05/16] Custom
---
README.md | 2 +-
files/src/main.js | 334 +++++++++++++++----------
files/src/modules/config_io.js | 60 ++---
files/src/nibbler.css | 103 ++++++++
files/src/renderer/50_table.js | 4 +-
files/src/renderer/51_node.js | 2 +-
files/src/renderer/55_winrate_graph.js | 18 ++
files/src/renderer/72_tree_draw.js | 4 -
files/src/renderer/82_infobox.js | 8 +-
files/src/renderer/95_hub.js | 2 +-
10 files changed, 357 insertions(+), 180 deletions(-)
diff --git a/README.md b/README.md
index 5653af76..dc85fe34 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@ These days, Nibbler more-or-less works with traditional engines like [Stockfish]
For prebuilt binary releases, see the [Releases](https://github.com/rooklift/nibbler/releases) section. For help, the [Discord](https://discordapp.com/invite/pKujYxD) may be your best bet, or open an issue here.
-
+
## Features
diff --git a/files/src/main.js b/files/src/main.js
index 341618c9..eae4aabe 100644
--- a/files/src/main.js
+++ b/files/src/main.js
@@ -2579,6 +2579,30 @@ function menu_build() {
{
type: "separator"
},
+ {
+ label: "10,000,000,000",
+ type: "checkbox",
+ checked: false,
+ click: () => {
+ win.webContents.send("call", {
+ fn: "set_node_limit",
+ args: [10 * billion]
+ });
+ // Will receive an ack IPC which sets menu checks.
+ }
+ },
+ {
+ label: "5,000,000,000",
+ type: "checkbox",
+ checked: false,
+ click: () => {
+ win.webContents.send("call", {
+ fn: "set_node_limit",
+ args: [5 * billion]
+ });
+ // Will receive an ack IPC which sets menu checks.
+ }
+ },
{
label: "1,000,000,000",
type: "checkbox",
@@ -2591,6 +2615,30 @@ function menu_build() {
// Will receive an ack IPC which sets menu checks.
}
},
+ {
+ label: "500,000,000",
+ type: "checkbox",
+ checked: false,
+ click: () => {
+ win.webContents.send("call", {
+ fn: "set_node_limit",
+ args: [500 * million]
+ });
+ // Will receive an ack IPC which sets menu checks.
+ }
+ },
+ {
+ label: "250,000,000",
+ type: "checkbox",
+ checked: false,
+ click: () => {
+ win.webContents.send("call", {
+ fn: "set_node_limit",
+ args: [250 * million]
+ });
+ // Will receive an ack IPC which sets menu checks.
+ }
+ },
{
label: "100,000,000",
type: "checkbox",
@@ -2604,97 +2652,97 @@ function menu_build() {
}
},
{
- label: "10,000,000",
+ label: "50,000,000",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_node_limit",
- args: [10 * million]
+ args: [50 * million]
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "1,000,000",
+ label: "25,000,000",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_node_limit",
- args: [1 * million]
+ args: [25 * million]
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "100,000",
+ label: "10,000,000",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_node_limit",
- args: [100000]
+ args: [10 * million]
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "10,000",
+ label: "5,000,000",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_node_limit",
- args: [10000]
+ args: [5 * million]
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "1,000",
+ label: "1,000,000",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_node_limit",
- args: [1000]
+ args: [1 * million]
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "100",
+ label: "100,000",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_node_limit",
- args: [100]
+ args: [100000]
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "10",
+ label: "10,000",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_node_limit",
- args: [10]
+ args: [10000]
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "2",
+ label: "1,000",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_node_limit",
- args: [2]
+ args: [1000]
});
// Will receive an ack IPC which sets menu checks.
}
@@ -2739,6 +2787,30 @@ function menu_build() {
{
label: "Limit - auto-eval / play",
submenu: [
+ {
+ label: "10,000,000,000",
+ type: "checkbox",
+ checked: false,
+ click: () => {
+ win.webContents.send("call", {
+ fn: "set_node_limit_special",
+ args: [10 * billion]
+ });
+ // Will receive an ack IPC which sets menu checks.
+ }
+ },
+ {
+ label: "5,000,000,000",
+ type: "checkbox",
+ checked: false,
+ click: () => {
+ win.webContents.send("call", {
+ fn: "set_node_limit_special",
+ args: [5 * billion]
+ });
+ // Will receive an ack IPC which sets menu checks.
+ }
+ },
{
label: "1,000,000,000",
type: "checkbox",
@@ -2751,6 +2823,30 @@ function menu_build() {
// Will receive an ack IPC which sets menu checks.
}
},
+ {
+ label: "500,000,000",
+ type: "checkbox",
+ checked: false,
+ click: () => {
+ win.webContents.send("call", {
+ fn: "set_node_limit_special",
+ args: [500 * million]
+ });
+ // Will receive an ack IPC which sets menu checks.
+ }
+ },
+ {
+ label: "250,000,000",
+ type: "checkbox",
+ checked: false,
+ click: () => {
+ win.webContents.send("call", {
+ fn: "set_node_limit_special",
+ args: [250 * million]
+ });
+ // Will receive an ack IPC which sets menu checks.
+ }
+ },
{
label: "100,000,000",
type: "checkbox",
@@ -2764,97 +2860,97 @@ function menu_build() {
}
},
{
- label: "10,000,000",
+ label: "50,000,000",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_node_limit_special",
- args: [10 * million]
+ args: [50 * million]
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "1,000,000",
+ label: "25,000,000",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_node_limit_special",
- args: [1 * million]
+ args: [25 * million]
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "100,000",
+ label: "10,000,000",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_node_limit_special",
- args: [100000]
+ args: [10 * million]
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "10,000",
+ label: "5,000,000",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_node_limit_special",
- args: [10000]
+ args: [5 * million]
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "1,000",
+ label: "1,000,000",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_node_limit_special",
- args: [1000]
+ args: [1 * million]
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "100",
+ label: "100,000",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_node_limit_special",
- args: [100]
+ args: [100000]
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "10",
+ label: "10,000",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_node_limit_special",
- args: [10]
+ args: [10000]
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "2",
+ label: "1,000",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_node_limit_special",
- args: [2]
+ args: [1000]
});
// Will receive an ack IPC which sets menu checks.
}
@@ -2911,369 +3007,333 @@ function menu_build() {
label: "Threads",
submenu: [
{
- label: "128",
+ label: "12",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_uci_option_permanent",
- args: ["Threads", 128],
+ args: ["Threads", 12],
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "96",
+ label: "10",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_uci_option_permanent",
- args: ["Threads", 96],
+ args: ["Threads", 10],
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "64",
+ label: "8",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_uci_option_permanent",
- args: ["Threads", 64],
+ args: ["Threads", 8],
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "48",
+ label: "7",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_uci_option_permanent",
- args: ["Threads", 48],
+ args: ["Threads", 7],
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "32",
+ label: "6",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_uci_option_permanent",
- args: ["Threads", 32],
+ args: ["Threads", 6],
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "24",
+ label: "5",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_uci_option_permanent",
- args: ["Threads", 24],
+ args: ["Threads", 5],
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "16",
+ label: "4",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_uci_option_permanent",
- args: ["Threads", 16],
+ args: ["Threads", 4],
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "14",
+ label: "3",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_uci_option_permanent",
- args: ["Threads", 14],
+ args: ["Threads", 3],
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "12",
+ label: "2",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_uci_option_permanent",
- args: ["Threads", 12],
+ args: ["Threads", 2],
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "10",
+ label: "1",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_uci_option_permanent",
- args: ["Threads", 10],
+ args: ["Threads", 1],
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "8",
- type: "checkbox",
- checked: false,
- click: () => {
- win.webContents.send("call", {
- fn: "set_uci_option_permanent",
- args: ["Threads", 8],
- });
- // Will receive an ack IPC which sets menu checks.
- }
+ type: "separator"
},
{
- label: "7",
- type: "checkbox",
- checked: false,
+ label: "Warning about threads",
click: () => {
- win.webContents.send("call", {
- fn: "set_uci_option_permanent",
- args: ["Threads", 7],
- });
- // Will receive an ack IPC which sets menu checks.
+ alert(messages.thread_warning);
}
},
+ ]
+ },
+ {
+ label: "Hash",
+ submenu: [
{
- label: "6",
+ label: "16 GB",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_uci_option_permanent",
- args: ["Threads", 6],
+ args: ["Hash", 16 * 1024]
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "5",
+ label: "12 GB",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_uci_option_permanent",
- args: ["Threads", 5],
+ args: ["Hash", 12 * 1024]
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "4",
+ label: "10 GB",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_uci_option_permanent",
- args: ["Threads", 4],
+ args: ["Hash", 10 * 1024]
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "3",
+ label: "8 GB",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_uci_option_permanent",
- args: ["Threads", 3],
+ args: ["Hash", 8 * 1024]
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "2",
+ label: "6 GB",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_uci_option_permanent",
- args: ["Threads", 2],
+ args: ["Hash", 6 * 1024]
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "1",
+ label: "4 GB",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_uci_option_permanent",
- args: ["Threads", 1],
+ args: ["Hash", 4 * 1024]
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- type: "separator"
- },
- {
- label: "Warning about threads",
- click: () => {
- alert(win, messages.thread_warning);
- }
- },
- ]
- },
- {
- label: "Hash",
- submenu: [
- {
- label: "120 GB",
+ label: "2 GB",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_uci_option_permanent",
- args: ["Hash", 120 * 1024]
+ args: ["Hash", 2 * 1024]
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "56 GB",
+ label: "1 GB",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_uci_option_permanent",
- args: ["Hash", 56 * 1024]
+ args: ["Hash", 1 * 1024]
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "24 GB",
+ label: "512 MB",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_uci_option_permanent",
- args: ["Hash", 24 * 1024]
+ args: ["Hash", 1 * 512]
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "12 GB",
+ label: "256 MB",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_uci_option_permanent",
- args: ["Hash", 12 * 1024]
+ args: ["Hash", 1 * 256]
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "8 GB",
+ label: "128 MB",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_uci_option_permanent",
- args: ["Hash", 8 * 1024]
+ args: ["Hash", 1 * 128]
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "6 GB",
+ label: "64 MB",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_uci_option_permanent",
- args: ["Hash", 6 * 1024]
+ args: ["Hash", 1 * 64]
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "4 GB",
+ label: "16 MB",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_uci_option_permanent",
- args: ["Hash", 4 * 1024]
+ args: ["Hash", 1 * 16]
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "2 GB",
- type: "checkbox",
- checked: false,
+ type: "separator"
+ },
+ {
+ label: "I want other hash options!",
click: () => {
- win.webContents.send("call", {
- fn: "set_uci_option_permanent",
- args: ["Hash", 2 * 1024]
- });
- // Will receive an ack IPC which sets menu checks.
+ alert(messages.about_hashes);
}
- },
+ }
+ ]
+ },
+ {
+ label: "MultiPV",
+ submenu: [
{
- label: "1 GB",
+ label: "500",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_uci_option_permanent",
- args: ["Hash", 1 * 1024]
+ args: ["MultiPV", 500]
});
// Will receive an ack IPC which sets menu checks.
}
},
{
- label: "0 GB",
+ label: "10",
type: "checkbox",
checked: false,
click: () => {
win.webContents.send("call", {
fn: "set_uci_option_permanent",
- args: ["Hash", 1] // 1 MB is Stockfish actual minimum.
+ args: ["MultiPV", 10]
});
// Will receive an ack IPC which sets menu checks.
}
},
- {
- type: "separator"
- },
- {
- label: "I want other hash options!",
- click: () => {
- alert(win, messages.about_hashes);
- }
- }
- ]
- },
- {
- label: "MultiPV",
- submenu: [
{
label: "5",
type: "checkbox",
diff --git a/files/src/modules/config_io.js b/files/src/modules/config_io.js
index 51da48e0..9933bfe7 100644
--- a/files/src/modules/config_io.js
+++ b/files/src/modules/config_io.js
@@ -28,28 +28,28 @@ exports.defaults = {
"width": 1280,
"height": 835,
- "board_size": 640,
- "info_font_size": 16,
- "pgn_font_size": 16,
- "fen_font_size": 16,
+ "board_size": 416,
+ "info_font_size": 18,
+ "pgn_font_size": 18,
+ "fen_font_size": 18,
"arrow_width": 8,
"arrowhead_radius": 12,
"board_font": "18px Arial",
- "graph_height": 96,
+ "graph_height": 192,
"graph_line_width": 2,
"graph_minimum_length": 41, // Desired depth + 1
- "light_square": "#dadada",
- "dark_square": "#b4b4b4",
- "active_square": "#66aaaa",
- "move_squares_with_alpha": "#ffff0026",
+ "light_square": "#f0d9b5",
+ "dark_square": "#b58863",
+ "active_square": "#ffff0080",
+ "move_squares_with_alpha": "#ffff0080",
- "best_colour": "#66aaaa",
- "good_colour": "#66aa66",
- "bad_colour": "#cccc66",
- "terrible_colour": "#cc6666",
- "actual_move_colour": "#cc9966",
+ "best_colour": "#4da3ff",
+ "good_colour": "#6fc383",
+ "bad_colour": "#ffac38",
+ "terrible_colour": "#e0525d",
+ "actual_move_colour": "#fff",
"searchmoves_buttons": true,
"focus_on_text": "focused:",
@@ -58,50 +58,50 @@ exports.defaults = {
"accept_bounds": false,
"max_info_lines": null, // Hidden option
- "bad_move_threshold": 0.02,
- "terrible_move_threshold": 0.04,
- "ab_filter_threshold": 0.1,
+ "bad_move_threshold": 0.05,
+ "terrible_move_threshold": 0.1,
+ "ab_filter_threshold": 0.25,
"arrow_filter_type": "N",
"arrow_filter_value": 0.01,
"arrows_enabled": true,
"click_spotlight": true,
- "next_move_arrow": false,
- "next_move_outline": false,
+ "next_move_arrow": true,
+ "next_move_outline": true,
"next_move_unique_colour": false,
"arrowhead_type": 0,
"ev_pov": null,
- "cp_pov": null,
- "wdl_pov": null,
+ "cp_pov": "w",
+ "wdl_pov": "w",
- "show_cp": false,
+ "show_cp": true,
"show_n": true,
"show_n_abs": true,
"show_depth": true,
- "show_p": true,
+ "show_p": false,
"show_v": false,
"show_q": false,
"show_u": false,
"show_s": false,
"show_m": false,
"show_wdl": true,
- "infobox_stats_newline": false,
- "infobox_pv_move_numbers": false,
- "hover_draw": false,
- "hover_method": 2,
+ "infobox_stats_newline": true,
+ "infobox_pv_move_numbers": true,
+ "hover_draw": true,
+ "hover_method": 1,
"looker_api": null,
"look_past_25": false,
"pv_click_event": 1, // 0: nothing, 1: goto, 2: tree
- "pgn_ev": true,
+ "pgn_ev": false,
"pgn_cp": false,
- "pgn_n": true,
+ "pgn_n": false,
"pgn_n_abs": false,
- "pgn_of_n": true,
+ "pgn_of_n": false,
"pgn_depth": false,
"pgn_p": false,
"pgn_v": false,
diff --git a/files/src/nibbler.css b/files/src/nibbler.css
index e6d20863..00ae681d 100644
--- a/files/src/nibbler.css
+++ b/files/src/nibbler.css
@@ -253,3 +253,106 @@ span.movelist_highlight_yellow {
span.nobr {
white-space: nowrap; /* Used for O-O and O-O-O moves */
}
+
+/* ----------------------------------- */
+
+#rightgridder {
+ position: relative;
+}
+
+#graph {
+ border-top: 1px solid #666666;
+ border-bottom: 1px solid #666666;
+}
+
+.pink {
+ color: #999999;
+}
+
+.infoline > .gray:last-child {
+ color: #ff8a8ab3;
+}
+
+#infobox {
+ margin-top: .5em;
+ margin-left: calc(1em - 5px);
+}
+
+#infobox > .infoline {
+ margin-bottom: 0;
+ padding-top: .5em;
+ padding-bottom: .5em;
+ border-bottom: .5px solid #99999969;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+#infobox > .infoline:hover {
+ white-space: normal;
+ word-break: break-all;
+}
+
+#infobox > .infoline > .gray {
+ margin-left: 5px;
+}
+
+#infobox > .infoline > [id^="infobox_"] {
+ word-break: break-all;
+ white-space: nowrap;
+ padding: 0 5px 0 5px;
+ border-radius: 3px;
+ transition: .1s;
+}
+
+#infobox > .infoline > [id^="infobox_"]:first-child {
+ margin-left: -6px;
+}
+
+#infobox > .infoline > [id^="infobox_"]:hover {
+ background-color: #eeeeee1f;
+ transition: .1s;
+}
+
+#fenbox {
+ margin: calc(.5em - 4px) calc(1em - 4px);
+ padding: 8px;
+}
+
+#fenbox:focus {
+ outline-offset: 0;
+}
+
+#movelist {
+ margin: 0;
+ padding: 0 1em 1em calc(1em - 2px);
+}
+
+#movelist > span {
+ display: inline-block;
+ padding: 0 5px 0 5px;
+ border-radius: 3px;
+ transition: .1s;
+}
+
+#movelist > span:hover {
+ background-color: #eeeeee33;
+ transition: .1s;
+}
+
+#movelist > .movelist_highlight_blue {
+ background-color: #eeeeee40;
+ color: #eeeeee;
+}
+
+#movelist > .movelist_highlight_yellow {
+ background-color: #ffff0033;
+}
+
+#movelist > .movelist_highlight_yellow:hover {
+ background-color: #ffff0040;
+}
+
+#statusbox > .gray {
+ white-space: normal;
+}
diff --git a/files/src/renderer/50_table.js b/files/src/renderer/50_table.js
index f6661d0e..bcd2db3d 100644
--- a/files/src/renderer/50_table.js
+++ b/files/src/renderer/50_table.js
@@ -201,9 +201,9 @@ const info_prototype = {
mate = 0 - mate;
}
if (mate < 0) {
- return `(-M${0 - mate})`;
+ return `-M${0 - mate}`;
} else {
- return `(+M${mate})`;
+ return `+M${mate}`;
}
},
diff --git a/files/src/renderer/51_node.js b/files/src/renderer/51_node.js
index b6e4099c..89bb648f 100644
--- a/files/src/renderer/51_node.js
+++ b/files/src/renderer/51_node.js
@@ -285,7 +285,7 @@ const node_prototype = {
let s = "";
if (need_number_string) {
- s += this.parent.board.next_number_string() + " ";
+ s += this.parent.board.next_number_string();
}
s += this.nice_move();
diff --git a/files/src/renderer/55_winrate_graph.js b/files/src/renderer/55_winrate_graph.js
index d174d222..133a1989 100644
--- a/files/src/renderer/55_winrate_graph.js
+++ b/files/src/renderer/55_winrate_graph.js
@@ -34,6 +34,8 @@ function NewGrapher() {
let eval_list = node.future_eval_history();
this.draw_50_percent_line(width, height);
+ this.draw_percent_lines(width, height);
+ this.draw_white_side(width, height);
this.draw_position_line(eval_list.length, node);
// We make lists of contiguous edges that can be drawn at once...
@@ -152,6 +154,22 @@ function NewGrapher() {
graphctx.stroke();
};
+ grapher.draw_percent_lines = function(width, height) {
+
+ graphctx.fillStyle = "#ffffff33";
+ for (let i = 0; i < 5; i++) {
+ graphctx.fillRect(0, height / 10 * i * 2, width, height / 10);
+ }
+ graphctx.stroke();
+ };
+
+ grapher.draw_white_side = function(width, height) {
+
+ graphctx.fillStyle = "#ffffff1a";
+ graphctx.fillRect(0, 0, width, height / 2);
+ graphctx.stroke();
+ };
+
grapher.draw_position_line = function(eval_list_length, node) {
if (eval_list_length < 2) {
diff --git a/files/src/renderer/72_tree_draw.js b/files/src/renderer/72_tree_draw.js
index 79df7e16..9ea7c4ec 100644
--- a/files/src/renderer/72_tree_draw.js
+++ b/files/src/renderer/72_tree_draw.js
@@ -108,10 +108,6 @@ let tree_draw_props = {
let p = pseudoelements[n];
let nextp = pseudoelements[n + 1]; // Possibly undefined
- if (!nextp || (p.text !== "(" && nextp.text !== ")")) {
- p.text += " ";
- }
-
all_spans.push(`${p.opener}${p.text}${p.closer}`);
}
diff --git a/files/src/renderer/82_infobox.js b/files/src/renderer/82_infobox.js
index 27712514..c0cd0a49 100644
--- a/files/src/renderer/82_infobox.js
+++ b/files/src/renderer/82_infobox.js
@@ -190,13 +190,13 @@ let infobox_props = {
let numstring = "";
if (config.infobox_pv_move_numbers) {
if (colour === "w") {
- numstring = `${movenum}. `;
+ numstring = `${movenum}.`;
} else if (colour === "b" && i === 0) {
- numstring = `${movenum}... `;
+ numstring = `${movenum}...`;
}
}
- substrings.push(`${numstring}${nice_pv[i]} `);
+ substrings.push(`${numstring}${nice_pv[i]}`);
this.info_clickers.push({
move: info.pv[i],
is_start: i === 0,
@@ -253,7 +253,7 @@ let infobox_props = {
if (config.infobox_stats_newline) {
substrings.push("
");
}
- substrings.push(`(${extra_stat_strings.join(', ')})`);
+ substrings.push(`${extra_stat_strings.join(' | ')}`);
}
// Close the whole div...
diff --git a/files/src/renderer/95_hub.js b/files/src/renderer/95_hub.js
index d2d1782c..47e5df73 100644
--- a/files/src/renderer/95_hub.js
+++ b/files/src/renderer/95_hub.js
@@ -1035,7 +1035,7 @@ let hub_props = {
if (!this.engine.leelaish && !engineconfig[this.engine.filepath].options["MultiPV"]) {
// This likely indicates the engine is new to the config.
- engineconfig[this.engine.filepath].options["MultiPV"] = 3; // Will get ack'd when engine_send_all_options() happens
+ engineconfig[this.engine.filepath].options["MultiPV"] = 1; // Will get ack'd when engine_send_all_options() happens
engineconfig[this.engine.filepath].search_nodes_special = 10000000;
this.send_ack_node_limit(true);
}
From 36679391b86613f2676cba4f449a07ca03d33b95 Mon Sep 17 00:00:00 2001
From: dav1312 <63931154+dav1312@users.noreply.github.com>
Date: Thu, 16 Feb 2023 22:02:06 +0100
Subject: [PATCH 06/16] Rearrange elements
---
files/src/nibbler.css | 22 ++++++++++------------
files/src/nibbler.html | 10 +++++-----
2 files changed, 15 insertions(+), 17 deletions(-)
diff --git a/files/src/nibbler.css b/files/src/nibbler.css
index 00ae681d..ad38d961 100644
--- a/files/src/nibbler.css
+++ b/files/src/nibbler.css
@@ -28,11 +28,12 @@ body {
display: grid;
height: 100vh;
grid-template-columns: min-content 1fr;
- grid-template-rows: min-content min-content 1fr;
+ grid-template-rows: min-content min-content min-content 1fr;
grid-template-areas:
"a b"
+ "e e"
"f f"
- "g g";
+ "g g"
}
#rightgridder {
@@ -41,11 +42,9 @@ body {
margin: 1em 0 0 0;
height: 0; /* js needs to keep this equal to the boardsize */
grid-template-columns: none;
- grid-template-rows: min-content 1fr min-content;
grid-template-areas:
"c"
- "d"
- "e";
+ "d";
}
#boardsquares {
@@ -75,18 +74,17 @@ body {
}
#statusbox {
- grid-area: c;
+ grid-area: f;
margin: 0 0 0 1em;
border: none;
display: block;
font-family: monospace, monospace;
pointer-events: auto;
- overflow: hidden;
white-space: pre;
}
#infobox {
- grid-area: d;
+ grid-area: g;
margin: 1em 1em 0 1em;
display: block;
color: #cccccc; /* only used for Lc0 stderr output at startup */
@@ -99,7 +97,7 @@ body {
}
#graph {
- grid-area: e;
+ grid-area: d;
align-self: end;
display: block;
margin: 10px 0 0 1em;
@@ -112,7 +110,7 @@ input[type=text]:focus {
}
#fenbox {
- grid-area: f;
+ grid-area: e;
margin: 1em 1em 0 1em;
background-color: #080808;
border: none;
@@ -126,7 +124,7 @@ input[type=text]:focus {
}
#movelist {
- grid-area: g;
+ grid-area: c;
margin: 1em 1em 1em 1em;
display: block;
color: #999999;
@@ -325,7 +323,7 @@ span.nobr {
#movelist {
margin: 0;
- padding: 0 1em 1em calc(1em - 2px);
+ padding: 0 1em 0 calc(1em - 2px);
}
#movelist > span {
diff --git a/files/src/nibbler.html b/files/src/nibbler.html
index 97c8c546..c3706c84 100644
--- a/files/src/nibbler.html
+++ b/files/src/nibbler.html
@@ -20,15 +20,15 @@