From a99879ba6c7294f2538a51bceec4e6db32213d10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 24 Sep 2020 09:05:05 +0200 Subject: [PATCH 01/36] MessageQueue: Change default queue size to 4096 KB 1024 KB was low enough that many users seem to hit it, which can lead to the editor freezing. The proper fixed as described in #35653 would be to implement a page allocator to prevent this overflow, but as a stop-gap measure, we can increase the default value to a more lenient 4096 KB which should be high enough for the vast majority of use cases. The default size can be brought down again if/when #35653 is properly fixed, and if it's actually relevant from a memory point of view. (cherry picked from commit 5009ba54b2600570c929a1ee14edf6e9b61f0680) --- core/message_queue.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/message_queue.h b/core/message_queue.h index e9a92ff5b7..9eb4b0261c 100644 --- a/core/message_queue.h +++ b/core/message_queue.h @@ -39,8 +39,7 @@ class MessageQueue { _THREAD_SAFE_CLASS_ enum { - - DEFAULT_QUEUE_SIZE_KB = 1024 + DEFAULT_QUEUE_SIZE_KB = 4096 }; enum { From 28be48fb6731fb522ab992fe2b3e6a39d0ab4bc7 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Wed, 23 Sep 2020 23:48:37 +0200 Subject: [PATCH 02/36] Reference the Color constants cheatsheet in the class reference (cherry picked from commit de490855671cbef3be63e26180900235f8cbc0e1) --- doc/classes/Color.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml index 37b9a4903b..bfedeb212f 100644 --- a/doc/classes/Color.xml +++ b/doc/classes/Color.xml @@ -8,6 +8,7 @@ You can also create a color from standardized color names by using [method @GDScript.ColorN] or directly using the color constants defined here. The standardized color set is based on the [url=https://en.wikipedia.org/wiki/X11_color_names]X11 color names[/url]. If you want to supply values in a range of 0 to 255, you should use [method @GDScript.Color8]. [b]Note:[/b] In a boolean context, a Color will evaluate to [code]false[/code] if it's equal to [code]Color(0, 0, 0, 1)[/code] (opaque black). Otherwise, a Color will always evaluate to [code]true[/code]. + [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/color_constants.png]Color constants cheatsheet[/url] From d0eedd4c23cf6386c18906287d8f6b7885af3e0a Mon Sep 17 00:00:00 2001 From: Francois Belair Date: Mon, 14 Sep 2020 17:49:17 -0400 Subject: [PATCH 03/36] Make LSP ignore $/ messages Fixes #38814 (cherry picked from commit 9c273307d8ba93da561faf3f9be71d0e0f291825) --- modules/jsonrpc/jsonrpc.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/jsonrpc/jsonrpc.cpp b/modules/jsonrpc/jsonrpc.cpp index 2dce9a286e..2a60b24719 100644 --- a/modules/jsonrpc/jsonrpc.cpp +++ b/modules/jsonrpc/jsonrpc.cpp @@ -98,6 +98,10 @@ Variant JSONRPC::process_action(const Variant &p_action, bool p_process_arr_elem if (p_action.get_type() == Variant::DICTIONARY) { Dictionary dict = p_action; String method = dict.get("method", ""); + if (method.begins_with("$/")) { + return ret; + } + Array args; if (dict.has("params")) { Variant params = dict.get("params", Variant()); From 1257beac964ae4bb2c36ffcf9bc77e8d2baa0d04 Mon Sep 17 00:00:00 2001 From: skyace65 Date: Tue, 15 Sep 2020 09:34:12 -0400 Subject: [PATCH 04/36] Add documentation for shelf filters (cherry picked from commit 75adefd4b67f1368dce0f50b24f02d2dc62d749c) --- doc/classes/AudioEffectHighShelfFilter.xml | 2 ++ doc/classes/AudioEffectLowShelfFilter.xml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/doc/classes/AudioEffectHighShelfFilter.xml b/doc/classes/AudioEffectHighShelfFilter.xml index 4b631d68dc..0a17bfd9a5 100644 --- a/doc/classes/AudioEffectHighShelfFilter.xml +++ b/doc/classes/AudioEffectHighShelfFilter.xml @@ -1,10 +1,12 @@ + Reduces all frequencies above the [member AudioEffectFilter.cutoff_hz]. + https://docs.godotengine.org/en/latest/tutorials/audio/audio_buses.html diff --git a/doc/classes/AudioEffectLowShelfFilter.xml b/doc/classes/AudioEffectLowShelfFilter.xml index b1e919c445..da54c57ef7 100644 --- a/doc/classes/AudioEffectLowShelfFilter.xml +++ b/doc/classes/AudioEffectLowShelfFilter.xml @@ -1,10 +1,12 @@ + Reduces all frequencies below the [member AudioEffectFilter.cutoff_hz]. + https://docs.godotengine.org/en/latest/tutorials/audio/audio_buses.html From 880ab559ec882ed45cdeb80740ef8f3e7a6b95c9 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Wed, 23 Sep 2020 23:24:58 +0200 Subject: [PATCH 05/36] Improve documentation related to printing error/warning messages (cherry picked from commit 50f3a8e312d5449771ff12843471731996c0f2d6) --- modules/gdscript/doc_classes/@GDScript.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/gdscript/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml index 93ce9870c9..1866af282c 100644 --- a/modules/gdscript/doc_classes/@GDScript.xml +++ b/modules/gdscript/doc_classes/@GDScript.xml @@ -817,6 +817,7 @@ a = [1, 2, 3] print("a", "b", a) # Prints ab[1, 2, 3] [/codeblock] + [b]Note:[/b] Consider using [method push_error] and [method push_warning] to print error and warning messages instead of [method print]. This distinguishes them from print messages used for debugging purposes, while also displaying a stack trace when an error or warning is printed. @@ -890,6 +891,7 @@ [codeblock] push_error("test error") # Prints "test error" to debugger and terminal as error call [/codeblock] + [b]Note:[/b] Errors printed this way will not pause project execution. To print an error message and pause project execution in debug builds, use [code]assert(false, "test error")[/code] instead. From 44bdd8f16c348bd0b665a22d10fd3d4b5e8033fa Mon Sep 17 00:00:00 2001 From: Danil Alexeev Date: Mon, 14 Sep 2020 21:14:27 +0300 Subject: [PATCH 06/36] Improvement for the Copy button in the Output Log Now if no text is selected, pressing the Copy button copies the entire text. (cherry picked from commit fb6eb21afc0a98b2b1439268abb0facd53222a43) --- editor/editor_log.cpp | 9 ++++++++- scene/gui/rich_text_label.cpp | 14 ++++++++++---- scene/gui/rich_text_label.h | 1 + 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/editor/editor_log.cpp b/editor/editor_log.cpp index d80ccbd9a0..2a59bbc3fb 100644 --- a/editor/editor_log.cpp +++ b/editor/editor_log.cpp @@ -82,8 +82,15 @@ void EditorLog::_clear_request() { } void EditorLog::_copy_request() { + String text = log->get_selected_text(); - log->selection_copy(); + if (text == "") { + text = log->get_text(); + } + + if (text != "") { + OS::get_singleton()->set_clipboard(text); + } } void EditorLog::clear() { diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 21cfa410eb..0c1a7b13fa 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -2578,10 +2578,10 @@ bool RichTextLabel::search(const String &p_string, bool p_from_selection, bool p return false; } -void RichTextLabel::selection_copy() { - - if (!selection.active || !selection.enabled) - return; +String RichTextLabel::get_selected_text() { + if (!selection.active || !selection.enabled) { + return ""; + } String text; @@ -2611,6 +2611,12 @@ void RichTextLabel::selection_copy() { item = _get_next_item(item, true); } + return text; +} + +void RichTextLabel::selection_copy() { + String text = get_selected_text(); + if (text != "") { OS::get_singleton()->set_clipboard(text); } diff --git a/scene/gui/rich_text_label.h b/scene/gui/rich_text_label.h index 618ab4351b..179bb37b40 100644 --- a/scene/gui/rich_text_label.h +++ b/scene/gui/rich_text_label.h @@ -473,6 +473,7 @@ public: void set_selection_enabled(bool p_enabled); bool is_selection_enabled() const; + String get_selected_text(); void selection_copy(); Error parse_bbcode(const String &p_bbcode); From 15c56de21239f70c41b6e4252d8689b7c7ac8b9d Mon Sep 17 00:00:00 2001 From: Leleat Date: Sat, 12 Sep 2020 23:59:46 +0200 Subject: [PATCH 07/36] striped edges on node rename in SceneTreeDock (cherry picked from commit 32e52217ff71195818c270c5203245b99a8beeaf) --- editor/scene_tree_editor.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index 49c2f2b8b5..d71f837851 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -794,6 +794,9 @@ void SceneTreeEditor::_renamed() { if (new_name == n->get_name()) return; + // Trim leading/trailing whitespace to prevent node names from containing accidental whitespace, which would make it more difficult to get the node via `get_node()`. + new_name = new_name.strip_edges(); + if (!undo_redo) { n->set_name(new_name); which->set_metadata(0, n->get_path()); From 4de606d78f571b12bcd990a2617400f895b7ec88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 24 Sep 2020 16:46:07 +0200 Subject: [PATCH 08/36] i18n: Rename pt_PT to pt We originally used `pt_PT` (i.e. Portuguese (Portugal)) to distinguish with the Brazilian Portuguese variant `pt_BR`, as both are significantly different and need separate translation files. But Portugal's Portuguese (or "European Portuguese") is close to the variant spoken and written in other Portuguese-speaking countries such as Angola and Mozambique, so it makes sense for users of these countries to also have access to the European Portuguese translation (at least until translators decide that adding e.g. `pt_AO` and `pt_MZ` variants would make sense, taking into account the translation effort that this duplication implies). Godot's locale matching checks first for the full locale (e.g. `pt_AO`), and if no translation is found, it checks for the non-regional language code (`pt`), so this change enables translations for Portuguese speakers outside Portugal and Brazil. (cherry picked from commit 1e2f55e27393ae61ed9585b48bb8d1f3987bed9b) --- editor/translations/{pt_PT.po => pt.po} | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename editor/translations/{pt_PT.po => pt.po} (99%) diff --git a/editor/translations/pt_PT.po b/editor/translations/pt.po similarity index 99% rename from editor/translations/pt_PT.po rename to editor/translations/pt.po index 66b7252aaf..6b6a15dda7 100644 --- a/editor/translations/pt_PT.po +++ b/editor/translations/pt.po @@ -1,4 +1,4 @@ -# Portuguese (Portugal) translation of the Godot Engine editor +# Portuguese translation of the Godot Engine editor # Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. # Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). # This file is distributed under the same license as the Godot source code. @@ -22,9 +22,9 @@ msgstr "" "POT-Creation-Date: \n" "PO-Revision-Date: 2020-09-24 12:43+0000\n" "Last-Translator: ssantos \n" -"Language-Team: Portuguese (Portugal) \n" -"Language: pt_PT\n" +"Language-Team: Portuguese \n" +"Language: pt\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" From a2c4564dc33808db9b2627e8d9eedcce018be503 Mon Sep 17 00:00:00 2001 From: skyace65 Date: Tue, 1 Sep 2020 13:40:42 -0400 Subject: [PATCH 09/36] Move note about using Resource in the File documentation (cherry picked from commit 75c5a8b3542a288d055b9d7ed73fba0596c0031f) --- doc/classes/File.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/classes/File.xml b/doc/classes/File.xml index ea1973bcc0..b972301fe3 100644 --- a/doc/classes/File.xml +++ b/doc/classes/File.xml @@ -21,6 +21,7 @@ return content [/codeblock] In the example above, the file will be saved in the user data folder as specified in the [url=https://docs.godotengine.org/en/latest/tutorials/io/data_paths.html]Data paths[/url] documentation. + [b]Note:[/b] To access project resources once exported, it is recommended to use [ResourceLoader] instead of the [File] API, as some files are converted to engine-specific formats and their original source files might not be present in the exported PCK package. https://docs.godotengine.org/en/latest/getting_started/step_by_step/filesystem.html @@ -48,7 +49,7 @@ Returns [code]true[/code] if the file exists in the given path. - [b]Note:[/b] Many resources types are imported (e.g. textures or sound files), and that their source asset will not be included in the exported game, as only the imported version is used (in the [code]res://.import[/code] folder). To check for the existence of such resources while taking into account the remapping to their imported location, use [method ResourceLoader.exists]. Typically, using [code]File.file_exists[/code] on an imported resource would work while you are developing in the editor (the source asset is present in [code]res://[/code], but fail when exported). + [b]Note:[/b] Many resources types are imported (e.g. textures or sound files), and their source asset will not be included in the exported game, as only the imported version is used. See [method ResourceLoader.exists] for an alternative approach that takes resource remapping into account. From 306ce02823777501a9848d10ab6b20e9c91776d1 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 25 Sep 2020 11:42:51 +0200 Subject: [PATCH 10/36] Replace AutoKey icon with a more universally understood "record" button See discussion in https://github.com/godotengine/godot-proposals/issues/169. (cherry picked from commit da906cade349548287f4beb8ac96c697cb2f719a) --- editor/icons/icon_auto_key.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/icons/icon_auto_key.svg b/editor/icons/icon_auto_key.svg index 9852d1360e..acc6665baf 100644 --- a/editor/icons/icon_auto_key.svg +++ b/editor/icons/icon_auto_key.svg @@ -1 +1 @@ - + From a4651b59fb5dc101f2cabb8f2efe2216800a7b28 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Thu, 24 Sep 2020 17:41:40 +0200 Subject: [PATCH 11/36] Add a property hint to StyleBoxFlat `shadow_size` for editor usability This adds a visible range to the slider so it can be dragged more easily. This closes #42309. (cherry picked from commit feb4002017b335ad5cb9f7508697a78b2503ea5c) --- scene/resources/style_box.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/resources/style_box.cpp b/scene/resources/style_box.cpp index ecf322914f..7595e13439 100644 --- a/scene/resources/style_box.cpp +++ b/scene/resources/style_box.cpp @@ -941,7 +941,7 @@ void StyleBoxFlat::_bind_methods() { ADD_GROUP("Shadow", "shadow_"); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "shadow_color"), "set_shadow_color", "get_shadow_color"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "shadow_size"), "set_shadow_size", "get_shadow_size"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "shadow_size", PROPERTY_HINT_RANGE, "0,100,1,or_greater"), "set_shadow_size", "get_shadow_size"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "shadow_offset"), "set_shadow_offset", "get_shadow_offset"); ADD_GROUP("Anti Aliasing", "anti_aliasing_"); From 7b3f9ebb947c5a1ba664b70685b898f211c1258e Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 25 Sep 2020 11:05:28 +0200 Subject: [PATCH 12/36] Enable the `copy_mono_root` SCons option by default This closes #41652. (cherry picked from commit cfd564b385f261d790d52c58be9344adf7d74f0e) --- modules/mono/build_scripts/mono_configure.py | 3 +-- modules/mono/config.py | 10 ++++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/modules/mono/build_scripts/mono_configure.py b/modules/mono/build_scripts/mono_configure.py index bb305c55c3..3b2395b631 100644 --- a/modules/mono/build_scripts/mono_configure.py +++ b/modules/mono/build_scripts/mono_configure.py @@ -392,9 +392,8 @@ def configure(env, env_mono): mono_root = subprocess.check_output(["pkg-config", "mono-2", "--variable=prefix"]).decode("utf8").strip() if tools_enabled: + # Only supported for editor builds. copy_mono_root_files(env, mono_root) - else: - print("Ignoring option: 'copy_mono_root'; only available for builds with 'tools' enabled.") def make_template_dir(env, mono_root): diff --git a/modules/mono/config.py b/modules/mono/config.py index bd0c129489..f990d9094b 100644 --- a/modules/mono/config.py +++ b/modules/mono/config.py @@ -23,18 +23,16 @@ def configure(env): envvars.Add( PathVariable( "mono_prefix", - "Path to the mono installation directory for the target platform and architecture", + "Path to the Mono installation directory for the target platform and architecture", "", PathVariable.PathAccept, ) ) - envvars.Add(BoolVariable("mono_static", "Statically link mono", default_mono_static)) - envvars.Add(BoolVariable("mono_glue", "Build with the mono glue sources", True)) + envvars.Add(BoolVariable("mono_static", "Statically link Mono", default_mono_static)) + envvars.Add(BoolVariable("mono_glue", "Build with the Mono glue sources", True)) envvars.Add(BoolVariable("build_cil", "Build C# solutions", True)) envvars.Add( - BoolVariable( - "copy_mono_root", "Make a copy of the mono installation directory to bundle with the editor", False - ) + BoolVariable("copy_mono_root", "Make a copy of the Mono installation directory to bundle with the editor", True) ) # TODO: It would be great if this could be detected automatically instead From d56112005f489525e6a4e557995597c1af7b18df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Sat, 26 Sep 2020 19:21:09 +0200 Subject: [PATCH 13/36] Avoid infinite loop in GDScript at shutdown (cherry picked from commit de4e54dd9150b0bc8bcb2ec643dd40eb4d3598d0) --- modules/gdscript/gdscript.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index 513ea42804..1cf301d4d7 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -2246,8 +2246,15 @@ GDScriptLanguage::~GDScriptLanguage() { } // Clear dependencies between scripts, to ensure cyclic references are broken (to avoid leaks at exit). - while (script_list.first()) { - GDScript *script = script_list.first()->self(); + SelfList *s = script_list.first(); + while (s) { + GDScript *script = s->self(); + // This ensures the current script is not released before we can check what's the next one + // in the list (we can't get the next upfront because we don't know if the reference breaking + // will cause it -or any other after it, for that matter- to be released so the next one + // is not the same as before). + script->reference(); + for (Map::Element *E = script->member_functions.front(); E; E = E->next()) { GDScriptFunction *func = E->get(); for (int i = 0; i < func->argument_types.size(); i++) { @@ -2258,6 +2265,9 @@ GDScriptLanguage::~GDScriptLanguage() { for (Map::Element *E = script->member_indices.front(); E; E = E->next()) { E->get().data_type.script_type_ref = Ref