From 708184c4023e1238661fa5eb7d192d6518f2e90d Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sat, 2 Feb 2019 00:11:56 +0100 Subject: [PATCH 01/17] Add more extensions to the dummy texture loader This should make headless exporting work in projects using textures in any format. Error messages should no longer appear when running a project that used image formats that were previously not present in the list. (cherry picked from commit 3007c7e2a3bd2f693e2e5d3a9cee8b8cbd320580) --- drivers/dummy/texture_loader_dummy.cpp | 30 +++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/drivers/dummy/texture_loader_dummy.cpp b/drivers/dummy/texture_loader_dummy.cpp index 2dfc0afe78b..9c2faab7c13 100644 --- a/drivers/dummy/texture_loader_dummy.cpp +++ b/drivers/dummy/texture_loader_dummy.cpp @@ -67,10 +67,19 @@ RES ResourceFormatDummyTexture::load(const String &p_path, const String &p_origi } void ResourceFormatDummyTexture::get_recognized_extensions(List *p_extensions) const { - p_extensions->push_back("png"); - p_extensions->push_back("hdr"); + p_extensions->push_back("bmp"); + p_extensions->push_back("dds"); + p_extensions->push_back("exr"); + p_extensions->push_back("jpeg"); p_extensions->push_back("jpg"); + p_extensions->push_back("hdr"); + p_extensions->push_back("pkm"); + p_extensions->push_back("png"); + p_extensions->push_back("pvr"); + p_extensions->push_back("svg"); + p_extensions->push_back("svgz"); p_extensions->push_back("tga"); + p_extensions->push_back("webp"); } bool ResourceFormatDummyTexture::handles_type(const String &p_type) const { @@ -79,7 +88,22 @@ bool ResourceFormatDummyTexture::handles_type(const String &p_type) const { String ResourceFormatDummyTexture::get_resource_type(const String &p_path) const { String extension = p_path.get_extension().to_lower(); - if (extension == "png" || extension == "hdr" || extension == "jpg" || extension == "tga") + if ( + extension == "bmp" || + extension == "dds" || + extension == "exr" || + extension == "jpeg" || + extension == "jpg" || + extension == "hdr" || + extension == "pkm" || + extension == "png" || + extension == "pvr" || + extension == "svg" || + extension == "svgz" || + extension == "tga" || + extension == "webp") { return "ImageTexture"; + } + return ""; } From 94d0f34f7054775d28261b19052c7ff3ed2dd98c Mon Sep 17 00:00:00 2001 From: Umang Kalra Date: Fri, 20 Mar 2020 16:14:37 +0530 Subject: [PATCH 02/17] Fixed the bool _static logic (cherry picked from commit b192c7d1ac3dc06f169312f624eabbd45115ce2d) --- modules/gdscript/gdscript_editor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 075ec34e7e1..c617138fcd8 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -2150,7 +2150,7 @@ static void _find_identifiers(const GDScriptCompletionContext &p_context, bool p } const GDScriptParser::ClassNode *clss = p_context._class; - bool _static = !p_context.function || p_context.function->_static; + bool _static = p_context.function && p_context.function->_static; while (clss) { GDScriptCompletionContext c = p_context; From 3bd5fc2e5ece4708850e8fa7da3c0b8eb3fd669c Mon Sep 17 00:00:00 2001 From: Tom Evans Date: Mon, 23 Mar 2020 21:24:24 -0500 Subject: [PATCH 03/17] Mark assert lines as safe in gdscript Now calling _reduce_node_type with debugging enabled to determine if assert line is safe. Part of doing this required the assert line to be stored away. Now the AssertNode line is being correctly set. Newlines are now marked safe always (cherry picked from commit 8dc883378218f85c7d3080e6769fac7a957c5223) --- modules/gdscript/gdscript_parser.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index e9c9c66d87a..347aab06856 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -2787,6 +2787,7 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) { return; } + _mark_line_as_safe(line); NewLineNode *nl2 = alloc_node(); nl2->line = line; p_block->statements.push_back(nl2); @@ -3300,6 +3301,8 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) { return; } + int assert_line = tokenizer->get_token_line(); + tokenizer->advance(); Vector args; @@ -3313,8 +3316,14 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) { return; } +#ifdef DEBUG_ENABLED + // Mark as safe, let type check mark as unsafe if needed + _mark_line_as_safe(assert_line); + _reduce_node_type(args[0]); +#endif AssertNode *an = alloc_node(); an->condition = _reduce_expression(args[0], p_static); + an->line = assert_line; if (args.size() == 2) { an->message = _reduce_expression(args[1], p_static); From f3cd7e380826d14ff7fb12f9ae73c2cd44b53713 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Tue, 14 Apr 2020 22:09:21 +0200 Subject: [PATCH 04/17] Document how some editor classes should be accessed as singletons only This closes #37687. (cherry picked from commit a225265b0a7308f0856c953f57168c490d54995e) --- doc/classes/EditorFileSystem.xml | 1 + doc/classes/EditorInspector.xml | 3 ++- doc/classes/EditorInterface.xml | 1 + doc/classes/EditorResourcePreview.xml | 1 + doc/classes/EditorSelection.xml | 1 + doc/classes/EditorSettings.xml | 1 + doc/classes/ScriptEditor.xml | 1 + 7 files changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/classes/EditorFileSystem.xml b/doc/classes/EditorFileSystem.xml index 9f994e9c7ee..aa4128fea91 100644 --- a/doc/classes/EditorFileSystem.xml +++ b/doc/classes/EditorFileSystem.xml @@ -5,6 +5,7 @@ This object holds information of all resources in the filesystem, their types, etc. + [b]Note:[/b] This class shouldn't be instantiated directly. Instead, access the singleton using [method EditorInterface.get_resource_filesystem]. diff --git a/doc/classes/EditorInspector.xml b/doc/classes/EditorInspector.xml index 3ed642a6a65..f503cb6a075 100644 --- a/doc/classes/EditorInspector.xml +++ b/doc/classes/EditorInspector.xml @@ -4,7 +4,8 @@ A tab used to edit properties of the selected node. - The editor inspector is by default located on the right-hand side of the editor. It's used to edit the properties of the selected node. For example, you can select a node such as Sprite2D then edit its transform through the inspector tool. The editor inspector is an essential tool in the game development workflow. + The editor inspector is by default located on the right-hand side of the editor. It's used to edit the properties of the selected node. For example, you can select a node such as [Sprite] then edit its transform through the inspector tool. The editor inspector is an essential tool in the game development workflow. + [b]Note:[/b] This class shouldn't be instantiated directly. Instead, access the singleton using [method EditorInterface.get_inspector]. diff --git a/doc/classes/EditorInterface.xml b/doc/classes/EditorInterface.xml index 91e3339e43c..8a07b25245a 100644 --- a/doc/classes/EditorInterface.xml +++ b/doc/classes/EditorInterface.xml @@ -5,6 +5,7 @@ EditorInterface gives you control over Godot editor's window. It allows customizing the window, saving and (re-)loading scenes, rendering mesh previews, inspecting and editing resources and objects, and provides access to [EditorSettings], [EditorFileSystem], [EditorResourcePreview], [ScriptEditor], the editor viewport, and information about scenes. + [b]Note:[/b] This class shouldn't be instantiated directly. Instead, access the singleton using [method EditorPlugin.get_editor_interface]. diff --git a/doc/classes/EditorResourcePreview.xml b/doc/classes/EditorResourcePreview.xml index c3a52fbc78a..d1776dc2374 100644 --- a/doc/classes/EditorResourcePreview.xml +++ b/doc/classes/EditorResourcePreview.xml @@ -5,6 +5,7 @@ This object is used to generate previews for resources of files. + [b]Note:[/b] This class shouldn't be instantiated directly. Instead, access the singleton using [method EditorInterface.get_resource_previewer]. diff --git a/doc/classes/EditorSelection.xml b/doc/classes/EditorSelection.xml index c097bfe18c2..1938a3eb122 100644 --- a/doc/classes/EditorSelection.xml +++ b/doc/classes/EditorSelection.xml @@ -5,6 +5,7 @@ This object manages the SceneTree selection in the editor. + [b]Note:[/b] This class shouldn't be instantiated directly. Instead, access the singleton using [method EditorInterface.get_selection]. diff --git a/doc/classes/EditorSettings.xml b/doc/classes/EditorSettings.xml index 1d6e86b968a..5a2a301ba53 100644 --- a/doc/classes/EditorSettings.xml +++ b/doc/classes/EditorSettings.xml @@ -11,6 +11,7 @@ settings.get(prop) list_of_settings = settings.get_property_list() [/codeblock] + [b]Note:[/b] This class shouldn't be instantiated directly. Instead, access the singleton using [method EditorInterface.get_editor_settings]. diff --git a/doc/classes/ScriptEditor.xml b/doc/classes/ScriptEditor.xml index 62ba839ed72..8c1c69f7376 100644 --- a/doc/classes/ScriptEditor.xml +++ b/doc/classes/ScriptEditor.xml @@ -4,6 +4,7 @@ Godot editor's script editor. + [b]Note:[/b] This class shouldn't be instantiated directly. Instead, access the singleton using [method EditorInterface.get_script_editor]. From bbd381c9874339bed1338e014d5954b84e050f8b Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 17 Apr 2020 23:08:01 +0200 Subject: [PATCH 05/17] Add an easing/transition type cheatsheet to the Tween documentation Related to https://github.com/godotengine/godot-docs/pull/3403. (cherry picked from commit 5972a9138ebfd34401067b1f1b27efc923a21d2a) --- doc/classes/Tween.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/classes/Tween.xml b/doc/classes/Tween.xml index 97d436c7070..42dd86d66ff 100644 --- a/doc/classes/Tween.xml +++ b/doc/classes/Tween.xml @@ -6,7 +6,7 @@ Tweens are useful for animations requiring a numerical property to be interpolated over a range of values. The name [i]tween[/i] comes from [i]in-betweening[/i], an animation technique where you specify [i]keyframes[/i] and the computer interpolates the frames that appear between them. [Tween] is more suited than [AnimationPlayer] for animations where you don't know the final values in advance. For example, interpolating a dynamically-chosen camera zoom value is best done with a [Tween] node; it would be difficult to do the same thing with an [AnimationPlayer] node. - Here is a brief usage example that causes a 2D node to move smoothly between two positions: + Here is a brief usage example that makes a 2D node move smoothly between two positions: [codeblock] var tween = get_node("Tween") tween.interpolate_property($Node2D, "position", @@ -15,7 +15,8 @@ tween.start() [/codeblock] Many methods require a property name, such as [code]"position"[/code] above. You can find the correct property name by hovering over the property in the Inspector. You can also provide the components of a property directly by using [code]"property:component"[/code] (eg. [code]position:x[/code]), where it would only apply to that particular component. - Many of the methods accept [code]trans_type[/code] and [code]ease_type[/code]. The first accepts an [enum TransitionType] constant, and refers to the way the timing of the animation is handled (see [code]http://easings.net/[/code] for some examples). The second accepts an [enum EaseType] constant, and controls the where [code]trans_type[/code] is applied to the interpolation (in the beginning, the end, or both). If you don't know which transition and easing to pick, you can try different [enum TransitionType] constants with [constant EASE_IN_OUT], and use the one that looks best. + Many of the methods accept [code]trans_type[/code] and [code]ease_type[/code]. The first accepts an [enum TransitionType] constant, and refers to the way the timing of the animation is handled (see [url=https://easings.net/]easings.net[/url] for some examples). The second accepts an [enum EaseType] constant, and controls the where [code]trans_type[/code] is applied to the interpolation (in the beginning, the end, or both). If you don't know which transition and easing to pick, you can try different [enum TransitionType] constants with [constant EASE_IN_OUT], and use the one that looks best. + [b][url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/tween_cheatsheet.png]Tween easing and transition types cheatsheet[/url][/b] From 93555d9ccccbf06aae22141f430540f8f75e80f4 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sat, 18 Apr 2020 16:20:35 +0200 Subject: [PATCH 06/17] Add editor freelook navigation scheme settings Depending on what one is trying to achieve, a different freelook mode may be more desirable. This closes #34034. (cherry picked from commit 8a48fb3517c52a8501dd56be7bf72ee43210efd3) --- editor/editor_settings.cpp | 2 ++ editor/plugins/spatial_editor_plugin.cpp | 22 ++++++++++++++++++++-- editor/plugins/spatial_editor_plugin.h | 6 ++++++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 92e3f61ca58..4649bf0d189 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -554,6 +554,8 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { hints["editors/3d/navigation_feel/manipulation_translation_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/manipulation_translation_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); // 3D: Freelook + _initial_set("editors/3d/freelook/freelook_navigation_scheme", false); + hints["editors/3d/freelook/freelook_navigation_scheme"] = PropertyInfo(Variant::INT, "editors/3d/freelook/freelook_navigation_scheme", PROPERTY_HINT_ENUM, "Default,Partially Axis-Locked (id Tech),Fully Axis-Locked (Minecraft)"); _initial_set("editors/3d/freelook/freelook_inertia", 0.1); hints["editors/3d/freelook/freelook_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/freelook/freelook_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); _initial_set("editors/3d/freelook/freelook_base_speed", 5.0); diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index eeb52bb53e1..7c017453bc9 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -2259,9 +2259,27 @@ void SpatialEditorViewport::_update_freelook(real_t delta) { return; } - const Vector3 forward = camera->get_transform().basis.xform(Vector3(0, 0, -1)); + const FreelookNavigationScheme navigation_scheme = (FreelookNavigationScheme)EditorSettings::get_singleton()->get("editors/3d/freelook/freelook_navigation_scheme").operator int(); + + Vector3 forward; + if (navigation_scheme == FREELOOK_FULLY_AXIS_LOCKED) { + // Forward/backward keys will always go straight forward/backward, never moving on the Y axis. + forward = Vector3(0, 0, -1).rotated(Vector3(0, 1, 0), camera->get_rotation().y); + } else { + // Forward/backward keys will be relative to the camera pitch. + forward = camera->get_transform().basis.xform(Vector3(0, 0, -1)); + } + const Vector3 right = camera->get_transform().basis.xform(Vector3(1, 0, 0)); - const Vector3 up = camera->get_transform().basis.xform(Vector3(0, 1, 0)); + + Vector3 up; + if (navigation_scheme == FREELOOK_PARTIALLY_AXIS_LOCKED || navigation_scheme == FREELOOK_FULLY_AXIS_LOCKED) { + // Up/down keys will always go up/down regardless of camera pitch. + up = Vector3(0, 1, 0); + } else { + // Up/down keys will be relative to the camera pitch. + up = camera->get_transform().basis.xform(Vector3(0, 1, 0)); + } Vector3 direction; diff --git a/editor/plugins/spatial_editor_plugin.h b/editor/plugins/spatial_editor_plugin.h index a4089327a5c..3cf6633fb6b 100644 --- a/editor/plugins/spatial_editor_plugin.h +++ b/editor/plugins/spatial_editor_plugin.h @@ -225,6 +225,12 @@ public: NAVIGATION_MODO, }; + enum FreelookNavigationScheme { + FREELOOK_DEFAULT, + FREELOOK_PARTIALLY_AXIS_LOCKED, + FREELOOK_FULLY_AXIS_LOCKED, + }; + private: int index; String name; From 24265c498b617ab6c2cbd271af543c719d45b6fb Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sun, 19 Apr 2020 23:21:42 +0200 Subject: [PATCH 07/17] Improve the procedural geometry class documentations This references Godot's winding order at the top of every procedural geometry class, as well as referencing other classes within a given geometry class. A warning about ImmediateGeometry3D performance was also added. (cherry picked from commit ed7347d73dbf42c0a58c743151503523148537d6) --- doc/classes/ArrayMesh.xml | 3 ++- doc/classes/ImmediateGeometry.xml | 3 +++ doc/classes/MeshDataTool.xml | 2 ++ doc/classes/SurfaceTool.xml | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/classes/ArrayMesh.xml b/doc/classes/ArrayMesh.xml index 20f8b2ab608..d7789ee53d1 100644 --- a/doc/classes/ArrayMesh.xml +++ b/doc/classes/ArrayMesh.xml @@ -22,6 +22,8 @@ m.mesh = arr_mesh [/codeblock] The [MeshInstance] is ready to be added to the [SceneTree] to be shown. + See also [ImmediateGeometry], [MeshDataTool] and [SurfaceTool] for procedural geometry generation. + [b]Note:[/b] Godot uses clockwise [url=https://learnopengl.com/Advanced-OpenGL/Face-culling]winding order[/url] for front faces of triangle primitive modes. https://docs.godotengine.org/en/latest/tutorials/content/procedural_geometry/arraymesh.html @@ -52,7 +54,6 @@ Surfaces are created to be rendered using a [code]primitive[/code], which may be any of the types defined in [enum Mesh.PrimitiveType]. (As a note, when using indices, it is recommended to only use points, lines or triangles.) [method Mesh.get_surface_count] will become the [code]surf_idx[/code] for this new surface. The [code]arrays[/code] argument is an array of arrays. See [enum ArrayType] for the values used in this array. For example, [code]arrays[0][/code] is the array of vertices. That first vertex sub-array is always required; the others are optional. Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data and the index array defines the vertex order. All sub-arrays must have the same length as the vertex array or be empty, except for [constant ARRAY_INDEX] if it is used. Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data, and the index array defines the order of the vertices. - Godot uses clockwise winding order for front faces of triangle primitive modes. diff --git a/doc/classes/ImmediateGeometry.xml b/doc/classes/ImmediateGeometry.xml index e937271bb46..3e1f062ae74 100644 --- a/doc/classes/ImmediateGeometry.xml +++ b/doc/classes/ImmediateGeometry.xml @@ -5,6 +5,9 @@ Draws simple geometry from code. Uses a drawing mode similar to OpenGL 1.x. + See also [ArrayMesh], [MeshDataTool] and [SurfaceTool] for procedural geometry generation. + [b]Note:[/b] ImmediateGeometry3D is best suited to small amounts of mesh data that change every frame. It will be slow when handling large amounts of mesh data. If mesh data doesn't change often, use [ArrayMesh], [MeshDataTool] or [SurfaceTool] instead. + [b]Note:[/b] Godot uses clockwise [url=https://learnopengl.com/Advanced-OpenGL/Face-culling]winding order[/url] for front faces of triangle primitive modes. diff --git a/doc/classes/MeshDataTool.xml b/doc/classes/MeshDataTool.xml index 1468d900b51..379b50c9046 100644 --- a/doc/classes/MeshDataTool.xml +++ b/doc/classes/MeshDataTool.xml @@ -17,6 +17,8 @@ mesh.surface_remove(0) mdt.commit_to_surface(mesh) [/codeblock] + See also [ArrayMesh], [ImmediateGeometry] and [SurfaceTool] for procedural geometry generation. + [b]Note:[/b] Godot uses clockwise [url=https://learnopengl.com/Advanced-OpenGL/Face-culling]winding order[/url] for front faces of triangle primitive modes. diff --git a/doc/classes/SurfaceTool.xml b/doc/classes/SurfaceTool.xml index 0126be25c3f..ae347b7e94e 100644 --- a/doc/classes/SurfaceTool.xml +++ b/doc/classes/SurfaceTool.xml @@ -15,6 +15,8 @@ The above [SurfaceTool] now contains one vertex of a triangle which has a UV coordinate and a specified [Color]. If another vertex were added without calling [method add_uv] or [method add_color], then the last values would be used. Vertex attributes must be passed [b]before[/b] calling [method add_vertex]. Failure to do so will result in an error when committing the vertex information to a mesh. Additionally, the attributes used before the first vertex is added determine the format of the mesh. For example, if you only add UVs to the first vertex, you cannot add color to any of the subsequent vertices. + See also [ArrayMesh], [ImmediateGeometry] and [MeshDataTool] for procedural geometry generation. + [b]Note:[/b] Godot uses clockwise [url=https://learnopengl.com/Advanced-OpenGL/Face-culling]winding order[/url] for front faces of triangle primitive modes. From a98d44f654121db5c8fdcf5667ad198f7bdcd106 Mon Sep 17 00:00:00 2001 From: Ignacio Etcheverry Date: Thu, 23 Apr 2020 16:12:22 +0200 Subject: [PATCH 08/17] C#: Fix always saving copy of csproj even with no changes This was a regression from 93d7ec88360a467a3041c0aa08390daa1f75892b (#38110). Mono's old implementation of Microsoft.Build hardcodes HasUnsavedChanges to always return true. This workaround can be reverted once we switch to official Microsoft.Build. (cherry picked from commit 81f13f61719a2c1c5451cdb7f8b2dd003db8c56d) --- .../GodotTools.ProjectEditor/ProjectUtils.cs | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs index a875e1c14f8..f2ebef1a7d6 100644 --- a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs +++ b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs @@ -13,7 +13,7 @@ namespace GodotTools.ProjectEditor { public ProjectRootElement Root { get; } - public bool HasUnsavedChanges => Root.HasUnsavedChanges; + public bool HasUnsavedChanges { get; set; } public void Save() => Root.Save(); @@ -78,6 +78,8 @@ namespace GodotTools.ProjectEditor var root = ProjectRootElement.Open(projectPath); Debug.Assert(root != null); + bool dirty = false; + var oldFolderNormalized = oldFolder.NormalizePath(); var newFolderNormalized = newFolder.NormalizePath(); string absOldFolderNormalized = Path.GetFullPath(oldFolderNormalized).NormalizePath(); @@ -88,9 +90,10 @@ namespace GodotTools.ProjectEditor string absPathNormalized = Path.GetFullPath(item.Include).NormalizePath(); string absNewIncludeNormalized = absNewFolderNormalized + absPathNormalized.Substring(absOldFolderNormalized.Length); item.Include = absNewIncludeNormalized.RelativeToPath(dir).Replace("/", "\\"); + dirty = true; } - if (root.HasUnsavedChanges) + if (dirty) root.Save(); } @@ -183,6 +186,7 @@ namespace GodotTools.ProjectEditor } root.AddProperty(name, value).Condition = " " + condition + " "; + project.HasUnsavedChanges = true; } AddPropertyIfNotPresent(name: "ApiConfiguration", @@ -224,6 +228,7 @@ namespace GodotTools.ProjectEditor } referenceWithHintPath.AddMetadata("HintPath", hintPath); + project.HasUnsavedChanges = true; return; } @@ -232,12 +237,14 @@ namespace GodotTools.ProjectEditor { // Found a Reference item without a HintPath referenceWithoutHintPath.AddMetadata("HintPath", hintPath); + project.HasUnsavedChanges = true; return; } } // Found no Reference item at all. Add it. root.AddItem("Reference", referenceName).Condition = " " + condition + " "; + project.HasUnsavedChanges = true; } const string coreProjectName = "GodotSharp"; @@ -270,6 +277,7 @@ namespace GodotTools.ProjectEditor { configItem.Value = "Debug"; foundOldConfiguration = true; + project.HasUnsavedChanges = true; } } @@ -277,6 +285,7 @@ namespace GodotTools.ProjectEditor { root.PropertyGroups.First(g => g.Condition == string.Empty)? .AddProperty("GodotProjectGeneratorVersion", Assembly.GetExecutingAssembly().GetName().Version.ToString()); + project.HasUnsavedChanges = true; } if (!foundOldConfiguration) @@ -300,21 +309,33 @@ namespace GodotTools.ProjectEditor void MigrateConditions(string oldCondition, string newCondition) { foreach (var propertyGroup in root.PropertyGroups.Where(g => g.Condition.Trim() == oldCondition)) + { propertyGroup.Condition = " " + newCondition + " "; + project.HasUnsavedChanges = true; + } foreach (var propertyGroup in root.PropertyGroups) { foreach (var prop in propertyGroup.Properties.Where(p => p.Condition.Trim() == oldCondition)) + { prop.Condition = " " + newCondition + " "; + project.HasUnsavedChanges = true; + } } foreach (var itemGroup in root.ItemGroups.Where(g => g.Condition.Trim() == oldCondition)) + { itemGroup.Condition = " " + newCondition + " "; + project.HasUnsavedChanges = true; + } foreach (var itemGroup in root.ItemGroups) { foreach (var item in itemGroup.Items.Where(item => item.Condition.Trim() == oldCondition)) + { item.Condition = " " + newCondition + " "; + project.HasUnsavedChanges = true; + } } } From 8cdcb410e085048226ea76f4eb7b21a33f94c4bc Mon Sep 17 00:00:00 2001 From: Ignacio Etcheverry Date: Thu, 23 Apr 2020 18:55:44 +0200 Subject: [PATCH 09/17] Mono/C#: Fix load hook not called for some assemblies on domain reload (cherry picked from commit f5510262bcfee430cab7cebf25d48f8367465750) --- modules/mono/mono_gd/gd_mono_assembly.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/mono/mono_gd/gd_mono_assembly.cpp b/modules/mono/mono_gd/gd_mono_assembly.cpp index a6a44fe8ebc..fafa7ab3cd8 100644 --- a/modules/mono/mono_gd/gd_mono_assembly.cpp +++ b/modules/mono/mono_gd/gd_mono_assembly.cpp @@ -277,12 +277,25 @@ no_pdb: #endif + bool need_manual_load_hook = mono_image_get_assembly(image) != nullptr; // Re-using an existing image with an assembly loaded + status = MONO_IMAGE_OK; MonoAssembly *assembly = mono_assembly_load_from_full(image, image_filename.utf8().get_data(), &status, p_refonly); ERR_FAIL_COND_V_MSG(status != MONO_IMAGE_OK || !assembly, NULL, "Failed to load assembly for image"); + if (need_manual_load_hook) { + // For some reason if an assembly survived domain reloading (maybe because it's referenced somewhere else), + // the mono internal search hook don't detect it, yet mono_image_open_from_data_with_name re-uses the image + // and assembly, and mono_assembly_load_from_full doesn't call the load hook. We need to call it manually. + String name = String::utf8(mono_assembly_name_get_name(mono_assembly_get_name(assembly))); + bool has_extension = name.ends_with(".dll") || name.ends_with(".exe"); + GDMonoAssembly *loaded_asm = GDMono::get_singleton()->get_loaded_assembly(has_extension ? name.get_basename() : name); + if (!loaded_asm) + assembly_load_hook(assembly, nullptr); + } + // Decrement refcount which was previously incremented by mono_image_open_from_data_with_name mono_image_close(image); From de4c75af10c803fcb06307c1037be012ae949c95 Mon Sep 17 00:00:00 2001 From: Michael Alexsander Date: Thu, 23 Apr 2020 21:45:50 -0300 Subject: [PATCH 10/17] Fix crash when changing time value of multiple animation keys at once via inspector (cherry picked from commit b081e954cc70ef08f3ea833bfe4698b0e80a0f5b) --- editor/animation_track_editor.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 5b3553d65e3..10abde7a905 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -754,14 +754,17 @@ public: for (Map >::Element *E = key_ofs_map.front(); E; E = E->next()) { + int key = 0; for (List::Element *F = E->value().front(); F; F = F->next()) { float key_ofs = F->get(); - if (from != key_ofs) + if (from != key_ofs) { + key++; continue; + } int track = E->key(); - key_ofs_map[track][key_ofs] = to; + key_ofs_map[track][key] = to; if (setting) return; From 2d9725b89d0e2a62561e717876e24b141dc0731f Mon Sep 17 00:00:00 2001 From: Fredia Huya-Kouadio Date: Fri, 24 Apr 2020 04:21:36 -0700 Subject: [PATCH 11/17] Fix detection logic for the Android sdk path The previous logic used the 'tools' directory within the Android sdk to validate it. That directory was recently deprecated and removed from the Android sdk folder (https://developer.android.com/studio/releases/sdk-tools) (cherry picked from commit 328354f87874ece0ee3b0e6cd35e82b007e51b3c) --- platform/android/export/export.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 78f282d2f5c..a08f87ecd42 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -1717,7 +1717,7 @@ public: valid = false; } else { Error errn; - DirAccessRef da = DirAccess::open(sdk_path.plus_file("tools"), &errn); + DirAccessRef da = DirAccess::open(sdk_path.plus_file("platform-tools"), &errn); if (errn != OK) { err += TTR("Invalid Android SDK path for custom build in Editor Settings.") + "\n"; valid = false; From 8b33b08c29307ea3a333f25180f33d75e976166d Mon Sep 17 00:00:00 2001 From: Tobias Mansfield-Williams Date: Sat, 25 Apr 2020 13:25:00 +0200 Subject: [PATCH 12/17] Add const to InputEventMouseButton::get_factor (cherry picked from commit 982efb186404c35ac954ac5e14a83231ade8f13c) --- core/os/input_event.cpp | 2 +- core/os/input_event.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp index 9878dd41c4e..36dbca3a3fd 100644 --- a/core/os/input_event.cpp +++ b/core/os/input_event.cpp @@ -416,7 +416,7 @@ void InputEventMouseButton::set_factor(float p_factor) { factor = p_factor; } -float InputEventMouseButton::get_factor() { +float InputEventMouseButton::get_factor() const { return factor; } diff --git a/core/os/input_event.h b/core/os/input_event.h index c6b04bcfa5c..0d228d9fe5d 100644 --- a/core/os/input_event.h +++ b/core/os/input_event.h @@ -328,7 +328,7 @@ protected: public: void set_factor(float p_factor); - float get_factor(); + float get_factor() const; void set_button_index(int p_index); int get_button_index() const; From 93ba25cfcb46c19cbed9a2ea953df99e7dd30274 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sat, 25 Apr 2020 21:59:22 +0200 Subject: [PATCH 13/17] Improve path search behavior discoverability in the project manager This closes #38185. (cherry picked from commit 72da1667e040e8c58a0e5cf1983cd94d56ac4e7d) --- editor/project_manager.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index ee434aaac2b..4651650577f 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -2758,6 +2758,8 @@ void ProjectListFilter::add_filter_option() { void ProjectListFilter::add_search_box() { search_box = memnew(LineEdit); search_box->set_placeholder(TTR("Search")); + search_box->set_tooltip( + TTR("The search box filters projects by name and last path component.\nTo filter projects by name and full path, the query must contain at least one `/` character.")); search_box->connect("text_changed", this, "_search_text_changed"); search_box->set_h_size_flags(SIZE_EXPAND_FILL); add_child(search_box); From ae0bc06ebaceeed2a384164470f4f73a10b2e586 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sun, 26 Apr 2020 16:37:22 +0200 Subject: [PATCH 14/17] Improve `pitch_scale` descriptions in AudioStreamPlayer documentation This closes #29439. Co-authored-by: Cheeseness (cherry picked from commit 4751dee7f414181201e10a0b82e0e3477c740a21) --- doc/classes/AudioStreamPlayer.xml | 2 +- doc/classes/AudioStreamPlayer2D.xml | 2 +- doc/classes/AudioStreamPlayer3D.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/classes/AudioStreamPlayer.xml b/doc/classes/AudioStreamPlayer.xml index f57dbf7a50e..e153b5667dc 100644 --- a/doc/classes/AudioStreamPlayer.xml +++ b/doc/classes/AudioStreamPlayer.xml @@ -61,7 +61,7 @@ If the audio configuration has more than two speakers, this sets the target channels. See [enum MixTarget] constants. - Changes the pitch and the tempo of the audio. + The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate. If [code]true[/code], audio is playing. diff --git a/doc/classes/AudioStreamPlayer2D.xml b/doc/classes/AudioStreamPlayer2D.xml index 0f30a3188dd..6733148edc0 100644 --- a/doc/classes/AudioStreamPlayer2D.xml +++ b/doc/classes/AudioStreamPlayer2D.xml @@ -67,7 +67,7 @@ Maximum distance from which audio is still hearable. - Changes the pitch and the tempo of the audio. + The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate. If [code]true[/code], audio is playing. diff --git a/doc/classes/AudioStreamPlayer3D.xml b/doc/classes/AudioStreamPlayer3D.xml index 72d6d0dfe4d..c6b23b380b0 100644 --- a/doc/classes/AudioStreamPlayer3D.xml +++ b/doc/classes/AudioStreamPlayer3D.xml @@ -91,7 +91,7 @@ Decides if audio should pause when source is outside of [member max_distance] range. - Changes the pitch and the tempo of the audio. + The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate. If [code]true[/code], audio is playing. From aecba58e920a2c777f2a6dc83105fd5bbdfd60c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sun, 26 Apr 2020 22:27:04 +0200 Subject: [PATCH 15/17] Windows: Appease capricious MSVC versions with moody headers Fixes #37799. Fixes #37986. (cherry picked from commit 4d3a18d9ff7db4570fedcc2f89354c41c31b9513) --- platform/windows/crash_handler_windows.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/windows/crash_handler_windows.cpp b/platform/windows/crash_handler_windows.cpp index 6145751e002..6579e6501a7 100644 --- a/platform/windows/crash_handler_windows.cpp +++ b/platform/windows/crash_handler_windows.cpp @@ -38,11 +38,13 @@ // Backtrace code code based on: https://stackoverflow.com/questions/6205981/windows-c-stack-trace-from-a-running-app -#include #include #include +#include #include +#include + #pragma comment(lib, "psapi.lib") #pragma comment(lib, "dbghelp.lib") From 9b6df1ed00b36adf5bf660ae37cfff3f13bbcfcf Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Mon, 20 Jan 2020 22:35:36 +0100 Subject: [PATCH 16/17] Set the `title` tag in the HTML5 export immediately This makes the project title display without having to wait for the project to finish loading. (cherry picked from commit eecce139eaa15b3c4d7944dd586b11e150d5e5b6) --- misc/dist/html/fixed-size.html | 2 +- misc/dist/html/full-size.html | 2 +- platform/javascript/export/export.cpp | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/misc/dist/html/fixed-size.html b/misc/dist/html/fixed-size.html index 6c6a3a5d2d4..e7a23b3f296 100644 --- a/misc/dist/html/fixed-size.html +++ b/misc/dist/html/fixed-size.html @@ -3,7 +3,7 @@ - + $GODOT_PROJECT_NAME