diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2023-03-16 10:44:56 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-16 10:44:56 -0700 |
commit | 6970257cffc6790f4d7e847e87e5cab9e252874e (patch) | |
tree | 670c3d175851bf4d151a41d37121d834db3a7bf9 | |
parent | d23922ffebe48f29126c003411495737d07e5a9f (diff) | |
parent | c0e5879b41f99d690287bc4c696a8a217084e6ed (diff) |
Merge pull request #74987 from YuriSizov/4.0-cherrypicks
Cherry-picks for the 4.0 branch (future 4.0.1) - 4th batch
29 files changed, 153 insertions, 92 deletions
diff --git a/doc/classes/AABB.xml b/doc/classes/AABB.xml index b4bab2de67..2c018b12d0 100644 --- a/doc/classes/AABB.xml +++ b/doc/classes/AABB.xml @@ -237,7 +237,7 @@ <return type="bool" /> <param index="0" name="right" type="AABB" /> <description> - Returns [code]true[/code] if the vectors are not equal. + Returns [code]true[/code] if the AABBs are not equal. [b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable. </description> </operator> diff --git a/doc/classes/CPUParticles3D.xml b/doc/classes/CPUParticles3D.xml index df31fa9621..618e35d283 100644 --- a/doc/classes/CPUParticles3D.xml +++ b/doc/classes/CPUParticles3D.xml @@ -294,7 +294,7 @@ Particle system's running speed scaling ratio. A value of [code]0[/code] can be used to pause the particles. </member> <member name="split_scale" type="bool" setter="set_split_scale" getter="get_split_scale" default="false"> - If set to true, three different scale curves can be specified, one per scale axis. + If set to [code]true[/code], three different scale curves can be specified, one per scale axis. </member> <member name="spread" type="float" setter="set_spread" getter="get_spread" default="45.0"> Each particle's initial direction range from [code]+spread[/code] to [code]-spread[/code] degrees. Applied to X/Z plane and Y/Z planes. diff --git a/doc/classes/CharacterBody2D.xml b/doc/classes/CharacterBody2D.xml index 51cc752cae..ce7d1e18d7 100644 --- a/doc/classes/CharacterBody2D.xml +++ b/doc/classes/CharacterBody2D.xml @@ -67,8 +67,8 @@ [codeblocks] [gdscript] for i in get_slide_collision_count(): - var collision = get_slide_collision(i) - print("Collided with: ", collision.collider.name) + var collision = get_slide_collision(i) + print("Collided with: ", collision.get_collider().name) [/gdscript] [csharp] for (int i = 0; i < GetSlideCollisionCount(); i++) diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml index 18c11ec68d..7872c53af6 100644 --- a/doc/classes/DisplayServer.xml +++ b/doc/classes/DisplayServer.xml @@ -943,7 +943,7 @@ <return type="void" /> <param index="0" name="image" type="Image" /> <description> - Sets the window icon (usually displayed in the top-left corner) in the operating system's [i]native[/i] format. To use icons in the operating system's native format, use [method set_native_icon] instead. + Sets the window icon (usually displayed in the top-left corner) with an [Image]. To use icons in the operating system's native format, use [method set_native_icon] instead. </description> </method> <method name="set_native_icon"> @@ -1037,8 +1037,8 @@ <param index="1" name="callable" type="Callable" /> <description> Adds a callback, which is called when the utterance has started, finished, canceled or reached a text boundary. - - [constant TTS_UTTERANCE_STARTED], [constant TTS_UTTERANCE_ENDED], and [constant TTS_UTTERANCE_CANCELED] callable's method should take one [int] parameter, the utterance id. - - [constant TTS_UTTERANCE_BOUNDARY] callable's method should take two [int] parameters, the index of the character and the utterance id. + - [constant TTS_UTTERANCE_STARTED], [constant TTS_UTTERANCE_ENDED], and [constant TTS_UTTERANCE_CANCELED] callable's method should take one [int] parameter, the utterance ID. + - [constant TTS_UTTERANCE_BOUNDARY] callable's method should take two [int] parameters, the index of the character and the utterance ID. [b]Note:[/b] The granularity of the boundary callbacks is engine dependent. [b]Note:[/b] This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows. </description> diff --git a/doc/classes/EditorVCSInterface.xml b/doc/classes/EditorVCSInterface.xml index 85c10fefd9..7b85aa8d24 100644 --- a/doc/classes/EditorVCSInterface.xml +++ b/doc/classes/EditorVCSInterface.xml @@ -124,7 +124,7 @@ <param index="0" name="remote" type="String" /> <param index="1" name="force" type="bool" /> <description> - Pushes changes to the [code]remote[/code]. Optionally, if [code]force[/code] is set to true, a force push will override the change history already present on the remote. + Pushes changes to the [param remote]. If [param force] is [code]true[/code], a force push will override the change history already present on the remote. </description> </method> <method name="_remove_branch" qualifiers="virtual"> diff --git a/doc/classes/NavigationAgent2D.xml b/doc/classes/NavigationAgent2D.xml index c6d03fb6d8..06ce32597f 100644 --- a/doc/classes/NavigationAgent2D.xml +++ b/doc/classes/NavigationAgent2D.xml @@ -117,7 +117,7 @@ <member name="debug_path_custom_color" type="Color" setter="set_debug_path_custom_color" getter="get_debug_path_custom_color" default="Color(1, 1, 1, 1)"> If [member debug_use_custom] is [code]true[/code] uses this color for this agent instead of global color. </member> - <member name="debug_path_custom_line_width" type="float" setter="set_debug_path_custom_line_width" getter="get_debug_path_custom_line_width" default="1.0"> + <member name="debug_path_custom_line_width" type="float" setter="set_debug_path_custom_line_width" getter="get_debug_path_custom_line_width" default="-1.0"> If [member debug_use_custom] is [code]true[/code] uses this line width for rendering paths for this agent instead of global line width. </member> <member name="debug_path_custom_point_size" type="float" setter="set_debug_path_custom_point_size" getter="get_debug_path_custom_point_size" default="4.0"> diff --git a/doc/classes/Quaternion.xml b/doc/classes/Quaternion.xml index ac2eda9f28..161514bc03 100644 --- a/doc/classes/Quaternion.xml +++ b/doc/classes/Quaternion.xml @@ -31,6 +31,7 @@ <param index="0" name="arc_from" type="Vector3" /> <param index="1" name="arc_to" type="Vector3" /> <description> + Constructs a quaternion representing the shortest arc between two points on the surface of a sphere with a radius of [code]1.0[/code]. </description> </constructor> <constructor name="Quaternion"> diff --git a/doc/classes/SkeletonModification2DLookAt.xml b/doc/classes/SkeletonModification2DLookAt.xml index 136fed37de..dd9321a7ec 100644 --- a/doc/classes/SkeletonModification2DLookAt.xml +++ b/doc/classes/SkeletonModification2DLookAt.xml @@ -81,7 +81,7 @@ The [Bone2D] node that the modification will operate on. </member> <member name="bone_index" type="int" setter="set_bone_index" getter="get_bone_index" default="-1"> - The index of the [Bone2D] node that the modification will oeprate on. + The index of the [Bone2D] node that the modification will operate on. </member> <member name="target_nodepath" type="NodePath" setter="set_target_node" getter="get_target_node" default="NodePath("")"> The NodePath to the node that is the target for the LookAt modification. This node is what the modification will rotate the [Bone2D] to. diff --git a/doc/classes/TileSet.xml b/doc/classes/TileSet.xml index ec2c7860d8..c371fc3ca2 100644 --- a/doc/classes/TileSet.xml +++ b/doc/classes/TileSet.xml @@ -155,7 +155,7 @@ <return type="int" /> <param index="0" name="layer_index" type="int" /> <description> - Returns the navigation layers (as in the Navigation server) of the gives TileSet navigation layer. + Returns the navigation layers (as in the Navigation server) of the given TileSet navigation layer. </description> </method> <method name="get_navigation_layers_count" qualifiers="const"> @@ -522,7 +522,7 @@ <param index="0" name="layer_index" type="int" /> <param index="1" name="layers" type="int" /> <description> - Sets the navigation layers (as in the navigation server) for navigation regions is the given TileSet navigation layer. + Sets the navigation layers (as in the navigation server) for navigation regions in the given TileSet navigation layer. </description> </method> <method name="set_occlusion_layer_light_mask"> @@ -538,7 +538,7 @@ <param index="0" name="layer_index" type="int" /> <param index="1" name="sdf_collision" type="bool" /> <description> - Enables or disables sdf collision for occluders in the given TileSet occlusion layer. + Enables or disables SDF collision for occluders in the given TileSet occlusion layer. </description> </method> <method name="set_physics_layer_collision_layer"> diff --git a/doc/classes/Transform2D.xml b/doc/classes/Transform2D.xml index 7bb9bf85ef..410e2614bc 100644 --- a/doc/classes/Transform2D.xml +++ b/doc/classes/Transform2D.xml @@ -148,8 +148,7 @@ <param index="0" name="angle" type="float" /> <description> Returns a copy of the transform rotated by the given [param angle] (in radians). - This method is an optimized version of multiplying the given transform [code]X[/code] - with a corresponding rotation transform [code]R[/code] from the left, i.e., [code]R * X[/code]. + This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding rotation transform [code]R[/code] from the left, i.e., [code]R * X[/code]. This can be seen as transforming with respect to the global/parent frame. </description> </method> @@ -158,8 +157,7 @@ <param index="0" name="angle" type="float" /> <description> Returns a copy of the transform rotated by the given [param angle] (in radians). - This method is an optimized version of multiplying the given transform [code]X[/code] - with a corresponding rotation transform [code]R[/code] from the right, i.e., [code]X * R[/code]. + This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding rotation transform [code]R[/code] from the right, i.e., [code]X * R[/code]. This can be seen as transforming with respect to the local frame. </description> </method> @@ -168,8 +166,7 @@ <param index="0" name="scale" type="Vector2" /> <description> Returns a copy of the transform scaled by the given [param scale] factor. - This method is an optimized version of multiplying the given transform [code]X[/code] - with a corresponding scaling transform [code]S[/code] from the left, i.e., [code]S * X[/code]. + This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding scaling transform [code]S[/code] from the left, i.e., [code]S * X[/code]. This can be seen as transforming with respect to the global/parent frame. </description> </method> @@ -178,8 +175,7 @@ <param index="0" name="scale" type="Vector2" /> <description> Returns a copy of the transform scaled by the given [param scale] factor. - This method is an optimized version of multiplying the given transform [code]X[/code] - with a corresponding scaling transform [code]S[/code] from the right, i.e., [code]X * S[/code]. + This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding scaling transform [code]S[/code] from the right, i.e., [code]X * S[/code]. This can be seen as transforming with respect to the local frame. </description> </method> @@ -188,8 +184,7 @@ <param index="0" name="offset" type="Vector2" /> <description> Returns a copy of the transform translated by the given [param offset]. - This method is an optimized version of multiplying the given transform [code]X[/code] - with a corresponding translation transform [code]T[/code] from the left, i.e., [code]T * X[/code]. + This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding translation transform [code]T[/code] from the left, i.e., [code]T * X[/code]. This can be seen as transforming with respect to the global/parent frame. </description> </method> @@ -198,8 +193,7 @@ <param index="0" name="offset" type="Vector2" /> <description> Returns a copy of the transform translated by the given [param offset]. - This method is an optimized version of multiplying the given transform [code]X[/code] - with a corresponding translation transform [code]T[/code] from the right, i.e., [code]X * T[/code]. + This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding translation transform [code]T[/code] from the right, i.e., [code]X * T[/code]. This can be seen as transforming with respect to the local frame. </description> </method> diff --git a/doc/classes/Transform3D.xml b/doc/classes/Transform3D.xml index e0485c7756..06a1dd0535 100644 --- a/doc/classes/Transform3D.xml +++ b/doc/classes/Transform3D.xml @@ -111,8 +111,7 @@ <description> Returns a copy of the transform rotated around the given [param axis] by the given [param angle] (in radians). The [param axis] must be a normalized vector. - This method is an optimized version of multiplying the given transform [code]X[/code] - with a corresponding rotation transform [code]R[/code] from the left, i.e., [code]R * X[/code]. + This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding rotation transform [code]R[/code] from the left, i.e., [code]R * X[/code]. This can be seen as transforming with respect to the global/parent frame. </description> </method> @@ -123,8 +122,7 @@ <description> Returns a copy of the transform rotated around the given [param axis] by the given [param angle] (in radians). The [param axis] must be a normalized vector. - This method is an optimized version of multiplying the given transform [code]X[/code] - with a corresponding rotation transform [code]R[/code] from the right, i.e., [code]X * R[/code]. + This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding rotation transform [code]R[/code] from the right, i.e., [code]X * R[/code]. This can be seen as transforming with respect to the local frame. </description> </method> @@ -133,8 +131,7 @@ <param index="0" name="scale" type="Vector3" /> <description> Returns a copy of the transform scaled by the given [param scale] factor. - This method is an optimized version of multiplying the given transform [code]X[/code] - with a corresponding scaling transform [code]S[/code] from the left, i.e., [code]S * X[/code]. + This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding scaling transform [code]S[/code] from the left, i.e., [code]S * X[/code]. This can be seen as transforming with respect to the global/parent frame. </description> </method> @@ -143,8 +140,7 @@ <param index="0" name="scale" type="Vector3" /> <description> Returns a copy of the transform scaled by the given [param scale] factor. - This method is an optimized version of multiplying the given transform [code]X[/code] - with a corresponding scaling transform [code]S[/code] from the right, i.e., [code]X * S[/code]. + This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding scaling transform [code]S[/code] from the right, i.e., [code]X * S[/code]. This can be seen as transforming with respect to the local frame. </description> </method> @@ -153,8 +149,7 @@ <param index="0" name="offset" type="Vector3" /> <description> Returns a copy of the transform translated by the given [param offset]. - This method is an optimized version of multiplying the given transform [code]X[/code] - with a corresponding translation transform [code]T[/code] from the left, i.e., [code]T * X[/code]. + This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding translation transform [code]T[/code] from the left, i.e., [code]T * X[/code]. This can be seen as transforming with respect to the global/parent frame. </description> </method> @@ -163,8 +158,7 @@ <param index="0" name="offset" type="Vector3" /> <description> Returns a copy of the transform translated by the given [param offset]. - This method is an optimized version of multiplying the given transform [code]X[/code] - with a corresponding translation transform [code]T[/code] from the right, i.e., [code]X * T[/code]. + This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding translation transform [code]T[/code] from the right, i.e., [code]X * T[/code]. This can be seen as transforming with respect to the local frame. </description> </method> diff --git a/doc/classes/TranslationServer.xml b/doc/classes/TranslationServer.xml index 7b18d8ddb6..2febd4628e 100644 --- a/doc/classes/TranslationServer.xml +++ b/doc/classes/TranslationServer.xml @@ -156,7 +156,7 @@ <param index="2" name="n" type="int" /> <param index="3" name="context" type="StringName" default="""" /> <description> - Returns the current locale's translation for the given message (key), plural_message and context. + Returns the current locale's translation for the given message (key), plural message and context. The number [param n] is the number or quantity of the plural object. It will be used to guide the translation system to fetch the correct plural form for the selected language. </description> </method> diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml index c47933ccb7..8b48bd4c88 100644 --- a/doc/classes/Vector2.xml +++ b/doc/classes/Vector2.xml @@ -143,7 +143,7 @@ <param index="2" name="post_b" type="Vector2" /> <param index="3" name="weight" type="float" /> <description> - Cubically interpolates between this vector and [param b] using [param pre_a] and [param post_b] as handles, and returns the result at position [param weight]. [param weight] is on the range of 0.0 to 1.0, representing the amount of interpolation. + Performs a cubic interpolation between this vector and [param b] using [param pre_a] and [param post_b] as handles, and returns the result at position [param weight]. [param weight] is on the range of 0.0 to 1.0, representing the amount of interpolation. </description> </method> <method name="cubic_interpolate_in_time" qualifiers="const"> @@ -156,7 +156,7 @@ <param index="5" name="pre_a_t" type="float" /> <param index="6" name="post_b_t" type="float" /> <description> - Cubically interpolates between this vector and [param b] using [param pre_a] and [param post_b] as handles, and returns the result at position [param weight]. [param weight] is on the range of 0.0 to 1.0, representing the amount of interpolation. + Performs a cubic interpolation between this vector and [param b] using [param pre_a] and [param post_b] as handles, and returns the result at position [param weight]. [param weight] is on the range of 0.0 to 1.0, representing the amount of interpolation. It can perform smoother interpolation than [code]cubic_interpolate()[/code] by the time values. </description> </method> @@ -254,7 +254,7 @@ <param index="0" name="to" type="Vector2" /> <param index="1" name="weight" type="float" /> <description> - Returns the result of the linear interpolation between this vector and [param to] by amount [param weight]. [param weight] is on the range of 0.0 to 1.0, representing the amount of interpolation. + Returns the result of the linear interpolation between this vector and [param to] by amount [param weight]. [param weight] is on the range of [code]0.0[/code] to [code]1.0[/code], representing the amount of interpolation. </description> </method> <method name="limit_length" qualifiers="const"> @@ -287,7 +287,8 @@ <method name="normalized" qualifiers="const"> <return type="Vector2" /> <description> - Returns a new vector scaled to unit length. Equivalent to [code]v / v.length()[/code]. + Returns the result of scaling the vector to unit length. Equivalent to [code]v / v.length()[/code]. See also [method is_normalized]. + [b]Note:[/b] This function may return incorrect values if the initial vector length is near zero. </description> </method> <method name="orthogonal" qualifiers="const"> diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml index c961825ab3..91553c3acd 100644 --- a/doc/classes/Vector3.xml +++ b/doc/classes/Vector3.xml @@ -222,7 +222,7 @@ <param index="0" name="to" type="Vector3" /> <param index="1" name="weight" type="float" /> <description> - Returns the result of the linear interpolation between this vector and [param to] by amount [param weight]. [param weight] is on the range of 0.0 to 1.0, representing the amount of interpolation. + Returns the result of the linear interpolation between this vector and [param to] by amount [param weight]. [param weight] is on the range of [code]0.0[/code] to [code]1.0[/code], representing the amount of interpolation. </description> </method> <method name="limit_length" qualifiers="const"> @@ -255,7 +255,8 @@ <method name="normalized" qualifiers="const"> <return type="Vector3" /> <description> - Returns the vector scaled to unit length. Equivalent to [code]v / v.length()[/code]. See also [method is_normalized]. + Returns the result of scaling the vector to unit length. Equivalent to [code]v / v.length()[/code]. See also [method is_normalized]. + [b]Note:[/b] This function may return incorrect values if the input vector length is near zero. </description> </method> <method name="octahedron_decode" qualifiers="static"> diff --git a/doc/classes/Vector4.xml b/doc/classes/Vector4.xml index c811817bdc..880e6e4e19 100644 --- a/doc/classes/Vector4.xml +++ b/doc/classes/Vector4.xml @@ -190,7 +190,8 @@ <method name="normalized" qualifiers="const"> <return type="Vector4" /> <description> - Returns the result of scaling the vector to unit length. Equivalent to [code]v / v.length()[/code]. + Returns the result of scaling the vector to unit length. Equivalent to [code]v / v.length()[/code]. See also [method is_normalized]. + [b]Note:[/b] This function may return incorrect values if the input vector length is near zero. </description> </method> <method name="posmod" qualifiers="const"> diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 385806a3a7..b1c3c51a9c 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -2221,7 +2221,7 @@ void EditorNode::edit_item(Object *p_object, Object *p_editing_owner) { } void EditorNode::push_node_item(Node *p_node) { - if (p_node || Object::cast_to<Node>(InspectorDock::get_inspector_singleton()->get_edited_object())) { + if (p_node || Object::cast_to<Node>(InspectorDock::get_inspector_singleton()->get_edited_object()) || Object::cast_to<MultiNodeEdit>(InspectorDock::get_inspector_singleton()->get_edited_object())) { // Don't push null if the currently edited object is not a Node. push_item(p_node); } diff --git a/editor/editor_property_name_processor.cpp b/editor/editor_property_name_processor.cpp index b62615adcc..a93be506ee 100644 --- a/editor/editor_property_name_processor.cpp +++ b/editor/editor_property_name_processor.cpp @@ -129,6 +129,7 @@ EditorPropertyNameProcessor::EditorPropertyNameProcessor() { capitalize_string_remaps["armeabi-v7a"] = "armeabi-v7a"; capitalize_string_remaps["arvr"] = "ARVR"; capitalize_string_remaps["astc"] = "ASTC"; + capitalize_string_remaps["bbcode"] = "BBCode"; capitalize_string_remaps["bg"] = "BG"; capitalize_string_remaps["bidi"] = "BiDi"; capitalize_string_remaps["bp"] = "BP"; diff --git a/editor/input_event_configuration_dialog.cpp b/editor/input_event_configuration_dialog.cpp index c620858439..c2b8992b69 100644 --- a/editor/input_event_configuration_dialog.cpp +++ b/editor/input_event_configuration_dialog.cpp @@ -547,7 +547,7 @@ void InputEventConfigurationDialog::_notification(int p_what) { void InputEventConfigurationDialog::popup_and_configure(const Ref<InputEvent> &p_event) { if (p_event.is_valid()) { - _set_event(p_event, p_event->duplicate()); + _set_event(p_event->duplicate(), p_event); } else { // Clear Event _set_event(Ref<InputEvent>(), Ref<InputEvent>()); diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp index ab061c4d5c..b9efe7d2ea 100644 --- a/editor/inspector_dock.cpp +++ b/editor/inspector_dock.cpp @@ -298,8 +298,7 @@ void InspectorDock::_prepare_resource_extra_popup() { popup->set_item_disabled(popup->get_item_index(RESOURCE_EDIT_CLIPBOARD), r.is_null()); Ref<Resource> current_res = _get_current_resource(); - ERR_FAIL_COND(current_res.is_null()); - popup->set_item_disabled(popup->get_item_index(RESOURCE_SHOW_IN_FILESYSTEM), current_res->is_built_in()); + popup->set_item_disabled(popup->get_item_index(RESOURCE_SHOW_IN_FILESYSTEM), current_res.is_null() || current_res->is_built_in()); } Ref<Resource> InspectorDock::_get_current_resource() const { diff --git a/editor/project_converter_3_to_4.cpp b/editor/project_converter_3_to_4.cpp index 6abf0ccacc..e4b6ef23b5 100644 --- a/editor/project_converter_3_to_4.cpp +++ b/editor/project_converter_3_to_4.cpp @@ -165,6 +165,7 @@ public: LocalVector<RegEx *> gdscript_signals_regexes; LocalVector<RegEx *> shaders_regexes; LocalVector<RegEx *> builtin_types_regexes; + LocalVector<RegEx *> theme_override_regexes; LocalVector<RegEx *> csharp_function_regexes; LocalVector<RegEx *> csharp_properties_regexes; LocalVector<RegEx *> csharp_signal_regexes; @@ -208,6 +209,10 @@ public: for (unsigned int current_index = 0; RenamesMap3To4::builtin_types_renames[current_index][0]; current_index++) { builtin_types_regexes.push_back(memnew(RegEx(String("\\b") + RenamesMap3To4::builtin_types_renames[current_index][0] + "\\b"))); } + // Theme overrides. + for (unsigned int current_index = 0; RenamesMap3To4::theme_override_renames[current_index][0]; current_index++) { + theme_override_regexes.push_back(memnew(RegEx(String("\\b") + RenamesMap3To4::theme_override_renames[current_index][0] + "\\b"))); + } // CSharp function renames. for (unsigned int current_index = 0; RenamesMap3To4::csharp_function_renames[current_index][0]; current_index++) { csharp_function_regexes.push_back(memnew(RegEx(String("\\b") + RenamesMap3To4::csharp_function_renames[current_index][0] + "\\b"))); @@ -282,6 +287,9 @@ public: for (RegEx *regex : builtin_types_regexes) { memdelete(regex); } + for (RegEx *regex : theme_override_regexes) { + memdelete(regex); + } for (RegEx *regex : csharp_function_regexes) { memdelete(regex); } @@ -387,6 +395,7 @@ bool ProjectConverter3To4::convert() { rename_common(RenamesMap3To4::gdscript_signals_renames, reg_container.gdscript_signals_regexes, source_lines); rename_common(RenamesMap3To4::shaders_renames, reg_container.shaders_regexes, source_lines); rename_common(RenamesMap3To4::builtin_types_renames, reg_container.builtin_types_regexes, source_lines); + rename_common(RenamesMap3To4::theme_override_renames, reg_container.theme_override_regexes, source_lines); custom_rename(source_lines, "\\.shader", ".gdshader"); } else if (file_name.ends_with(".tscn")) { @@ -404,6 +413,7 @@ bool ProjectConverter3To4::convert() { rename_common(RenamesMap3To4::gdscript_signals_renames, reg_container.gdscript_signals_regexes, source_lines); rename_common(RenamesMap3To4::shaders_renames, reg_container.shaders_regexes, source_lines); rename_common(RenamesMap3To4::builtin_types_renames, reg_container.builtin_types_regexes, source_lines); + rename_common(RenamesMap3To4::theme_override_renames, reg_container.theme_override_regexes, source_lines); custom_rename(source_lines, "\\.shader", ".gdshader"); } else if (file_name.ends_with(".cs")) { // TODO, C# should use different methods. @@ -566,6 +576,7 @@ bool ProjectConverter3To4::validate_conversion() { changed_elements.append_array(check_for_rename_common(RenamesMap3To4::gdscript_signals_renames, reg_container.gdscript_signals_regexes, lines)); changed_elements.append_array(check_for_rename_common(RenamesMap3To4::shaders_renames, reg_container.shaders_regexes, lines)); changed_elements.append_array(check_for_rename_common(RenamesMap3To4::builtin_types_renames, reg_container.builtin_types_regexes, lines)); + changed_elements.append_array(check_for_rename_common(RenamesMap3To4::theme_override_renames, reg_container.theme_override_regexes, lines)); changed_elements.append_array(check_for_custom_rename(lines, "\\.shader", ".gdshader")); } else if (file_name.ends_with(".tscn")) { @@ -583,6 +594,7 @@ bool ProjectConverter3To4::validate_conversion() { changed_elements.append_array(check_for_rename_common(RenamesMap3To4::gdscript_signals_renames, reg_container.gdscript_signals_regexes, lines)); changed_elements.append_array(check_for_rename_common(RenamesMap3To4::shaders_renames, reg_container.shaders_regexes, lines)); changed_elements.append_array(check_for_rename_common(RenamesMap3To4::builtin_types_renames, reg_container.builtin_types_regexes, lines)); + changed_elements.append_array(check_for_rename_common(RenamesMap3To4::theme_override_renames, reg_container.theme_override_regexes, lines)); changed_elements.append_array(check_for_custom_rename(lines, "\\.shader", ".gdshader")); } else if (file_name.ends_with(".cs")) { @@ -768,6 +780,8 @@ bool ProjectConverter3To4::test_conversion(RegExContainer ®_container) { valid = valid && test_conversion_basic("Transform", "Transform3D", RenamesMap3To4::builtin_types_renames, reg_container.builtin_types_regexes, "builtin type"); + valid = valid && test_conversion_basic("custom_constants/margin_right", "theme_override_constants/margin_right", RenamesMap3To4::theme_override_renames, reg_container.theme_override_regexes, "theme overrides"); + // Custom Renames. valid = valid && test_conversion_with_regex("(Connect(A,B,C,D,E,F,G) != OK):", "(Connect(A, new Callable(B, C), D, E, F, G) != OK):", &ProjectConverter3To4::rename_csharp_functions, "custom rename csharp", reg_container); diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index b4dc235034..5ae90224a4 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -265,7 +265,7 @@ private: } } else { - // check if the specified folder is empty, even though this is not an error, it is good to check here + // Check if the specified folder is empty, even though this is not an error, it is good to check here. d->list_dir_begin(); is_folder_empty = true; String n = d->get_next(); @@ -283,6 +283,12 @@ private: d->list_dir_end(); if (!is_folder_empty) { + if (valid_path == OS::get_singleton()->get_environment("HOME") || valid_path == OS::get_singleton()->get_system_dir(OS::SYSTEM_DIR_DOCUMENTS) || valid_path == OS::get_singleton()->get_executable_path().get_base_dir()) { + set_message(TTR("You cannot save a project in the selected path. Please make a new folder or choose a new path."), MESSAGE_ERROR); + get_ok_button()->set_disabled(true); + return ""; + } + set_message(TTR("The selected path is not empty. Choosing an empty folder is highly recommended."), MESSAGE_WARNING); get_ok_button()->set_disabled(false); return valid_path; @@ -1828,9 +1834,11 @@ void ProjectList::erase_selected_projects(bool p_delete_project_contents) { if (_selected_project_paths.has(item.path) && item.control->is_visible()) { _config.erase_section(item.path); - if (p_delete_project_contents) { - OS::get_singleton()->move_to_trash(item.path); - } + // Comment out for now until we have a better warning system to + // ensure users delete their project only. + //if (p_delete_project_contents) { + // OS::get_singleton()->move_to_trash(item.path); + //} memdelete(item.control); _projects.remove_at(i); @@ -2466,7 +2474,7 @@ void ProjectManager::_rename_project() { } void ProjectManager::_erase_project_confirm() { - _project_list->erase_selected_projects(delete_project_contents->is_pressed()); + _project_list->erase_selected_projects(false); _update_project_buttons(); } @@ -2490,7 +2498,7 @@ void ProjectManager::_erase_project() { } erase_ask_label->set_text(confirm_message); - delete_project_contents->set_pressed(false); + //delete_project_contents->set_pressed(false); erase_ask->popup_centered(); } @@ -2954,9 +2962,11 @@ ProjectManager::ProjectManager() { erase_ask_label = memnew(Label); erase_ask_vb->add_child(erase_ask_label); - delete_project_contents = memnew(CheckBox); - delete_project_contents->set_text(TTR("Also delete project contents (no undo!)")); - erase_ask_vb->add_child(delete_project_contents); + // Comment out for now until we have a better warning system to + // ensure users delete their project only. + //delete_project_contents = memnew(CheckBox); + //delete_project_contents->set_text(TTR("Also delete project contents (no undo!)")); + //erase_ask_vb->add_child(delete_project_contents); multi_open_ask = memnew(ConfirmationDialog); multi_open_ask->set_ok_button_text(TTR("Edit")); diff --git a/editor/project_manager.h b/editor/project_manager.h index 60d9c1d45b..b277a35fcb 100644 --- a/editor/project_manager.h +++ b/editor/project_manager.h @@ -82,7 +82,9 @@ class ProjectManager : public Control { ConfirmationDialog *erase_ask = nullptr; Label *erase_ask_label = nullptr; - CheckBox *delete_project_contents = nullptr; + // Comment out for now until we have a better warning system to + // ensure users delete their project only. + //CheckBox *delete_project_contents = nullptr; ConfirmationDialog *erase_missing_ask = nullptr; ConfirmationDialog *multi_open_ask = nullptr; diff --git a/editor/renames_map_3_to_4.cpp b/editor/renames_map_3_to_4.cpp index 9e2ba1e1dc..617d4f8b13 100644 --- a/editor/renames_map_3_to_4.cpp +++ b/editor/renames_map_3_to_4.cpp @@ -1788,4 +1788,49 @@ const char *RenamesMap3To4::color_renames[][2] = { { nullptr, nullptr }, }; +const char *RenamesMap3To4::theme_override_renames[][2] = { + // First rename the generic prefixes. + { "custom_colors/", "theme_override_colors/" }, + { "custom_constants/", "theme_override_constants/" }, + { "custom_fonts/", "theme_override_fonts/" }, + { "custom_icons/", "theme_override_icons/" }, + { "custom_styles/", "theme_override_styles/" }, + + // MarginContainer + // The margin_* properties are renamed to offset_* in a previous conversion step. + // This is fine everywhere except for the MarginContainer theme_override_constants. + { "theme_override_constants/offset_right", "theme_override_constants/margin_right" }, + { "theme_override_constants/offset_top", "theme_override_constants/margin_top" }, + { "theme_override_constants/offset_left", "theme_override_constants/margin_left" }, + { "theme_override_constants/offset_bottom", "theme_override_constants/margin_bottom" }, + + // Panel/PanelContainer/TabContainer/PopupPanel/PopupMenu + { "theme_override_styles/panel", "theme_override_styles/panel" }, + + // TabContainer/Tabs(TabBar) + { "theme_override_styles/tab_bg", "theme_override_styles/tab_unselected" }, + { "theme_override_styles/tab_fg", "theme_override_styles/tab_selected" }, + + // { "theme_override_styles/bg", "theme_override_styles/bg" }, // GraphEdit + // { "theme_override_styles/bg", "theme_override_styles/panel" }, // ScrollContainer + // { "theme_override_styles/bg", "theme_override_styles/background" }, // ProgressBar + // { "theme_override_styles/fg", "theme_override_styles/fill" }, // ProgressBar + + { "theme_override_colors/font_color_hover", "theme_override_colors/font_hover_color" }, + { "theme_override_colors/font_color_pressed", "theme_override_colors/font_pressed_color" }, + { "theme_override_colors/font_color_disabled", "theme_override_colors/font_disabled_color" }, + { "theme_override_colors/font_color_focus", "theme_override_colors/font_focus_color" }, + { "theme_override_colors/font_color_hover_pressed", "theme_override_colors/font_hover_pressed_color" }, + + { "theme_override_colors/font_outline_modulate", "theme_override_colors/font_outline_color" }, + { "theme_override_colors/font_color_shadow", "theme_override_colors/font_shadow_color" }, + + { "theme_override_constants/shadow_as_outline", "theme_override_constants/shadow_outline_size" }, // 0 or 1 + + { "theme_override_constants/table_vseparation", "theme_override_constants/table_v_separation" }, + { "theme_override_constants/table_hseparation", "theme_override_constants/table_h_separation" }, + + { nullptr, nullptr }, +}; + #endif // DISABLE_DEPRECATED diff --git a/editor/renames_map_3_to_4.h b/editor/renames_map_3_to_4.h index 537e5f1db5..452a741ba2 100644 --- a/editor/renames_map_3_to_4.h +++ b/editor/renames_map_3_to_4.h @@ -48,6 +48,7 @@ struct RenamesMap3To4 { static const char *shaders_renames[][2]; static const char *class_renames[][2]; static const char *color_renames[][2]; + static const char *theme_override_renames[][2]; }; #endif // DISABLE_DEPRECATED diff --git a/modules/websocket/doc_classes/WebSocketMultiplayerPeer.xml b/modules/websocket/doc_classes/WebSocketMultiplayerPeer.xml index e0d17277ef..6f27611a81 100644 --- a/modules/websocket/doc_classes/WebSocketMultiplayerPeer.xml +++ b/modules/websocket/doc_classes/WebSocketMultiplayerPeer.xml @@ -25,7 +25,7 @@ <param index="1" name="bind_address" type="String" default=""*"" /> <param index="2" name="tls_server_options" type="TLSOptions" default="null" /> <description> - Starts a new multiplayer server listening on the given [param port]. You can optionally specify a [param bind_address], and provide valiid [param tls_server_options] to use TLS. See [method TLSOptions.server]. + Starts a new multiplayer server listening on the given [param port]. You can optionally specify a [param bind_address], and provide valid [param tls_server_options] to use TLS. See [method TLSOptions.server]. </description> </method> <method name="get_peer" qualifiers="const"> diff --git a/platform/macos/godot_main_macos.mm b/platform/macos/godot_main_macos.mm index 29125c29a9..e98ab08127 100644 --- a/platform/macos/godot_main_macos.mm +++ b/platform/macos/godot_main_macos.mm @@ -53,21 +53,12 @@ int main(int argc, char **argv) { int first_arg = 1; const char *dbg_arg = "-NSDocumentRevisionsDebugMode"; - printf("arguments\n"); for (int i = 0; i < argc; i++) { if (strcmp(dbg_arg, argv[i]) == 0) { first_arg = i + 2; } - printf("%i: %s\n", i, argv[i]); } -#ifdef DEBUG_ENABLED - // Lets report the path we made current after all that. - char cwd[4096]; - getcwd(cwd, 4096); - printf("Current path: %s\n", cwd); -#endif - OS_MacOS os; Error err; diff --git a/scene/2d/navigation_agent_2d.cpp b/scene/2d/navigation_agent_2d.cpp index bfe2f6252e..157318125b 100644 --- a/scene/2d/navigation_agent_2d.cpp +++ b/scene/2d/navigation_agent_2d.cpp @@ -124,8 +124,8 @@ void NavigationAgent2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "debug_enabled"), "set_debug_enabled", "get_debug_enabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "debug_use_custom"), "set_debug_use_custom", "get_debug_use_custom"); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "debug_path_custom_color"), "set_debug_path_custom_color", "get_debug_path_custom_color"); - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "debug_path_custom_point_size", PROPERTY_HINT_RANGE, "1,50,1,suffix:px"), "set_debug_path_custom_point_size", "get_debug_path_custom_point_size"); - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "debug_path_custom_line_width", PROPERTY_HINT_RANGE, "1,50,1,suffix:px"), "set_debug_path_custom_line_width", "get_debug_path_custom_line_width"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "debug_path_custom_point_size", PROPERTY_HINT_RANGE, "0,50,0.01,or_greater,suffix:px"), "set_debug_path_custom_point_size", "get_debug_path_custom_point_size"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "debug_path_custom_line_width", PROPERTY_HINT_RANGE, "-1,50,0.01,or_greater,suffix:px"), "set_debug_path_custom_line_width", "get_debug_path_custom_line_width"); ADD_SIGNAL(MethodInfo("path_changed")); ADD_SIGNAL(MethodInfo("target_reached")); @@ -734,7 +734,7 @@ void NavigationAgent2D::set_debug_path_custom_point_size(float p_point_size) { return; } - debug_path_custom_point_size = MAX(0.1, p_point_size); + debug_path_custom_point_size = MAX(0.0, p_point_size); debug_path_dirty = true; #endif // DEBUG_ENABLED } @@ -803,6 +803,10 @@ void NavigationAgent2D::_update_debug_path() { RenderingServer::get_singleton()->canvas_item_add_polyline(debug_path_instance, navigation_path, debug_path_colors, debug_path_custom_line_width, false); + if (debug_path_custom_point_size <= 0.0) { + return; + } + float point_size = NavigationServer2D::get_singleton()->get_debug_navigation_agent_path_point_size(); float half_point_size = point_size * 0.5; diff --git a/scene/2d/navigation_agent_2d.h b/scene/2d/navigation_agent_2d.h index 1614c70229..97c5d94483 100644 --- a/scene/2d/navigation_agent_2d.h +++ b/scene/2d/navigation_agent_2d.h @@ -76,7 +76,7 @@ class NavigationAgent2D : public Node { // Debug properties for exposed bindings bool debug_enabled = false; float debug_path_custom_point_size = 4.0; - float debug_path_custom_line_width = 1.0; + float debug_path_custom_line_width = -1.0; bool debug_use_custom = false; Color debug_path_custom_color = Color(1.0, 1.0, 1.0, 1.0); #ifdef DEBUG_ENABLED diff --git a/scene/3d/navigation_agent_3d.cpp b/scene/3d/navigation_agent_3d.cpp index 396e4b72af..3730070b16 100644 --- a/scene/3d/navigation_agent_3d.cpp +++ b/scene/3d/navigation_agent_3d.cpp @@ -135,7 +135,7 @@ void NavigationAgent3D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "debug_enabled"), "set_debug_enabled", "get_debug_enabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "debug_use_custom"), "set_debug_use_custom", "get_debug_use_custom"); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "debug_path_custom_color"), "set_debug_path_custom_color", "get_debug_path_custom_color"); - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "debug_path_custom_point_size", PROPERTY_HINT_RANGE, "1,50,1,suffix:px"), "set_debug_path_custom_point_size", "get_debug_path_custom_point_size"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "debug_path_custom_point_size", PROPERTY_HINT_RANGE, "0,50,0.01,or_greater,suffix:px"), "set_debug_path_custom_point_size", "get_debug_path_custom_point_size"); } void NavigationAgent3D::_notification(int p_what) { @@ -760,7 +760,7 @@ void NavigationAgent3D::set_debug_path_custom_point_size(float p_point_size) { return; } - debug_path_custom_point_size = p_point_size; + debug_path_custom_point_size = MAX(0.0, p_point_size); debug_path_dirty = true; #endif // DEBUG_ENABLED } @@ -828,28 +828,30 @@ void NavigationAgent3D::_update_debug_path() { debug_path_mesh->surface_set_material(0, debug_agent_path_line_material); } - Vector<Vector3> debug_path_points_vertex_array; + if (debug_path_custom_point_size > 0.0) { + Vector<Vector3> debug_path_points_vertex_array; - for (int i = 0; i < navigation_path.size(); i++) { - debug_path_points_vertex_array.push_back(navigation_path[i]); - } + for (int i = 0; i < navigation_path.size(); i++) { + debug_path_points_vertex_array.push_back(navigation_path[i]); + } - Array debug_path_points_mesh_array; - debug_path_points_mesh_array.resize(Mesh::ARRAY_MAX); - debug_path_points_mesh_array[Mesh::ARRAY_VERTEX] = debug_path_lines_vertex_array; + Array debug_path_points_mesh_array; + debug_path_points_mesh_array.resize(Mesh::ARRAY_MAX); + debug_path_points_mesh_array[Mesh::ARRAY_VERTEX] = debug_path_points_vertex_array; - debug_path_mesh->add_surface_from_arrays(Mesh::PRIMITIVE_POINTS, debug_path_points_mesh_array); + debug_path_mesh->add_surface_from_arrays(Mesh::PRIMITIVE_POINTS, debug_path_points_mesh_array); - Ref<StandardMaterial3D> debug_agent_path_point_material = NavigationServer3D::get_singleton()->get_debug_navigation_agent_path_point_material(); - if (debug_use_custom) { - if (!debug_agent_path_point_custom_material.is_valid()) { - debug_agent_path_point_custom_material = debug_agent_path_point_material->duplicate(); + Ref<StandardMaterial3D> debug_agent_path_point_material = NavigationServer3D::get_singleton()->get_debug_navigation_agent_path_point_material(); + if (debug_use_custom) { + if (!debug_agent_path_point_custom_material.is_valid()) { + debug_agent_path_point_custom_material = debug_agent_path_point_material->duplicate(); + } + debug_agent_path_point_custom_material->set_albedo(debug_path_custom_color); + debug_agent_path_point_custom_material->set_point_size(debug_path_custom_point_size); + debug_path_mesh->surface_set_material(1, debug_agent_path_point_custom_material); + } else { + debug_path_mesh->surface_set_material(1, debug_agent_path_point_material); } - debug_agent_path_point_custom_material->set_albedo(debug_path_custom_color); - debug_agent_path_point_custom_material->set_point_size(debug_path_custom_point_size); - debug_path_mesh->surface_set_material(1, debug_agent_path_point_custom_material); - } else { - debug_path_mesh->surface_set_material(1, debug_agent_path_point_material); } RS::get_singleton()->instance_set_base(debug_path_instance, debug_path_mesh->get_rid()); |