From 96a325dec8e16487eeb805ae1ca14d9302e3b4d5 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Wed, 19 Jan 2022 17:07:20 +0100 Subject: [PATCH 01/15] Force threads when compiling web editor instead of erroring out This makes the build process more seamless. A similar option is already forced for initial memorywhen needed. (cherry picked from commit da19898c24d1b0122949ab61726618a332ed69cd) --- platform/javascript/detect.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index 0af2b8452413..eb298337a29a 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -88,10 +88,10 @@ def configure(env): if env["tools"]: if not env["threads_enabled"]: - print("Threads must be enabled to build the editor. Please add the 'threads_enabled=yes' option") - sys.exit(255) + print('Note: Forcing "threads_enabled=yes" as it is required for the web editor.') + env["threads_enabled"] = "yes" if env["initial_memory"] < 64: - print("Editor build requires at least 64MiB of initial memory. Forcing it.") + print('Note: Forcing "initial_memory=64" as it is required for the web editor.') env["initial_memory"] = 64 else: # Disable exceptions and rtti on non-tools (template) builds From d3473b2a951f41c80c0eb65a193224bb3a0b154e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20T=2E=20Listwon?= Date: Wed, 19 Jan 2022 11:33:27 +0100 Subject: [PATCH 02/15] Rework Node::get_node to omit is_absolute() check in best case scenario (cherry picked from commit e2792cc71caa89997c0127abd5bb4b0e19d67f46) --- scene/main/node.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 675294af7577..9df729c75183 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -1303,12 +1303,14 @@ Node *Node::get_node_or_null(const NodePath &p_path) const { Node *Node::get_node(const NodePath &p_path) const { Node *node = get_node_or_null(p_path); - if (p_path.is_absolute()) { - ERR_FAIL_COND_V_MSG(!node, nullptr, - vformat("(Node not found: \"%s\" (absolute path attempted from \"%s\").)", p_path, get_path())); - } else { - ERR_FAIL_COND_V_MSG(!node, nullptr, - vformat("(Node not found: \"%s\" (relative to \"%s\").)", p_path, get_path())); + if (unlikely(!node)) { + if (p_path.is_absolute()) { + ERR_FAIL_V_MSG(nullptr, + vformat("(Node not found: \"%s\" (absolute path attempted from \"%s\").)", p_path, get_path())); + } else { + ERR_FAIL_V_MSG(nullptr, + vformat("(Node not found: \"%s\" (relative to \"%s\").)", p_path, get_path())); + } } return node; From b8a7a742641337311113f38168808dfc8793f6d8 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Wed, 19 Jan 2022 20:19:24 +0100 Subject: [PATCH 03/15] Tweak theme color to match the Godot editor's background color This makes for a more seamless-looking address bar/status bar when using the web editor on a mobile device, either directly in the brower or installed as a progressive web app. This also specifies a theme color for the web editor's offline fallback. (cherry picked from commit 7ef459c2d77b8ee1420511f5dff615786bab37dc) --- misc/dist/html/editor.html | 4 ++-- misc/dist/html/manifest.json | 2 +- misc/dist/html/offline.html | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/misc/dist/html/editor.html b/misc/dist/html/editor.html index 9319091355c8..b5cb28db2767 100644 --- a/misc/dist/html/editor.html +++ b/misc/dist/html/editor.html @@ -9,8 +9,8 @@ - - + + diff --git a/misc/dist/html/manifest.json b/misc/dist/html/manifest.json index 0ca27b3742f8..adc8106e2aed 100644 --- a/misc/dist/html/manifest.json +++ b/misc/dist/html/manifest.json @@ -6,7 +6,7 @@ "start_url": "./godot.tools.html", "display": "standalone", "orientation": "landscape", - "theme_color": "#478cbf", + "theme_color": "#202531", "icons": [ { "src": "favicon.png", diff --git a/misc/dist/html/offline.html b/misc/dist/html/offline.html index 000c21b4d316..5cfc3362d905 100644 --- a/misc/dist/html/offline.html +++ b/misc/dist/html/offline.html @@ -4,6 +4,8 @@ + + You are offline