summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/classes/AABB.xml2
-rw-r--r--doc/classes/Animation.xml2
-rw-r--r--doc/classes/AnimationNode.xml14
-rw-r--r--doc/classes/AudioEffectChorus.xml2
-rw-r--r--doc/classes/AudioServer.xml2
-rw-r--r--doc/classes/BitMap.xml2
-rw-r--r--doc/classes/Camera3D.xml2
-rw-r--r--doc/classes/CanvasItem.xml4
-rw-r--r--doc/classes/CodeEdit.xml2
-rw-r--r--doc/classes/Curve2D.xml6
-rw-r--r--doc/classes/Curve3D.xml6
-rw-r--r--doc/classes/DisplayServer.xml2
-rw-r--r--doc/classes/EditorPlugin.xml2
-rw-r--r--doc/classes/HTTPRequest.xml2
-rw-r--r--doc/classes/ImporterMesh.xml4
-rw-r--r--doc/classes/Label.xml4
-rw-r--r--doc/classes/Line2D.xml20
-rw-r--r--doc/classes/LineEdit.xml4
-rw-r--r--doc/classes/Mesh.xml4
-rw-r--r--doc/classes/MeshInstance3D.xml2
-rw-r--r--doc/classes/MultiMeshInstance3D.xml2
-rw-r--r--doc/classes/NavigationMeshGenerator.xml2
-rw-r--r--doc/classes/NavigationServer2D.xml2
-rw-r--r--doc/classes/NavigationServer3D.xml2
-rw-r--r--doc/classes/PhysicsServer2D.xml4
-rw-r--r--doc/classes/PhysicsServer3D.xml4
-rw-r--r--doc/classes/PopupPanel.xml1
-rw-r--r--doc/classes/ProjectSettings.xml14
-rw-r--r--doc/classes/Quaternion.xml2
-rw-r--r--doc/classes/ReflectionProbe.xml2
-rw-r--r--doc/classes/RenderingServer.xml2
-rw-r--r--doc/classes/SceneTree.xml3
-rw-r--r--doc/classes/Skeleton3D.xml2
-rw-r--r--doc/classes/SkeletonModification2DCCDIK.xml2
-rw-r--r--doc/classes/SkeletonModification2DFABRIK.xml2
-rw-r--r--doc/classes/SkeletonModification2DPhysicalBones.xml2
-rw-r--r--doc/classes/SkeletonModification3DCCDIK.xml2
-rw-r--r--doc/classes/SkeletonModificationStack3D.xml2
-rw-r--r--doc/classes/StreamPeer.xml6
-rw-r--r--doc/classes/String.xml4
-rw-r--r--doc/classes/TextEdit.xml10
-rw-r--r--doc/classes/TextServer.xml6
-rw-r--r--doc/classes/TextServerExtension.xml2
-rw-r--r--doc/classes/TileMap.xml2
-rw-r--r--doc/classes/VisualShaderNodeCustom.xml4
-rw-r--r--doc/classes/VisualShaderNodeExpression.xml2
-rw-r--r--doc/classes/VisualShaderNodeGroupBase.xml2
-rw-r--r--doc/classes/VisualShaderNodeUVFunc.xml2
-rw-r--r--doc/classes/XMLParser.xml2
-rwxr-xr-xdoc/tools/doc_status.py69
-rwxr-xr-xdoc/tools/make_rst.py1091
-rw-r--r--drivers/gles3/storage/mesh_storage.cpp5
-rw-r--r--editor/editor_node.cpp31
-rw-r--r--editor/editor_node.h1
-rw-r--r--editor/editor_plugin.cpp6
-rw-r--r--editor/editor_plugin.h2
-rw-r--r--editor/icons/DefaultProjectIcon.svg2
-rw-r--r--editor/import/resource_importer_layered_texture.cpp7
-rw-r--r--editor/project_manager.cpp6
-rw-r--r--editor/shader_create_dialog.cpp7
-rw-r--r--editor/shader_create_dialog.h7
-rw-r--r--modules/openxr/doc_classes/OpenXRAction.xml2
-rw-r--r--platform/android/export/export_plugin.cpp10
-rw-r--r--platform/android/export/export_plugin.h2
-rw-r--r--platform/android/file_access_filesystem_jandroid.cpp13
-rw-r--r--platform/android/file_access_filesystem_jandroid.h2
-rw-r--r--platform/android/java/lib/src/org/godotengine/godot/io/file/DataAccess.kt8
-rw-r--r--platform/android/java/lib/src/org/godotengine/godot/io/file/FileAccessHandler.kt5
-rw-r--r--platform/ios/export/export_plugin.cpp4
-rw-r--r--platform/ios/export/export_plugin.h4
-rw-r--r--scene/2d/line_2d.cpp8
-rw-r--r--scene/resources/curve.cpp4
-rw-r--r--scene/resources/font.cpp2
-rw-r--r--servers/navigation_server_2d.cpp2
-rw-r--r--servers/navigation_server_3d.cpp2
-rw-r--r--servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp5
76 files changed, 868 insertions, 621 deletions
diff --git a/doc/classes/AABB.xml b/doc/classes/AABB.xml
index 2fa191faa6..e2e4e7c61d 100644
--- a/doc/classes/AABB.xml
+++ b/doc/classes/AABB.xml
@@ -139,7 +139,7 @@
<return type="AABB" />
<param index="0" name="by" type="float" />
<description>
- Returns a copy of the [AABB] grown a given amount of units towards all the sides.
+ Returns a copy of the [AABB] grown a given number of units towards all the sides.
</description>
</method>
<method name="has_no_surface" qualifiers="const">
diff --git a/doc/classes/Animation.xml b/doc/classes/Animation.xml
index ac956eacba..859b4a8a5f 100644
--- a/doc/classes/Animation.xml
+++ b/doc/classes/Animation.xml
@@ -349,7 +349,7 @@
<return type="int" />
<param index="0" name="track_idx" type="int" />
<description>
- Returns the amount of keys in a given track.
+ Returns the number of keys in a given track.
</description>
</method>
<method name="track_get_key_time" qualifiers="const">
diff --git a/doc/classes/AnimationNode.xml b/doc/classes/AnimationNode.xml
index fefcc929cc..b856b5f208 100644
--- a/doc/classes/AnimationNode.xml
+++ b/doc/classes/AnimationNode.xml
@@ -14,39 +14,39 @@
<method name="_get_caption" qualifiers="virtual const">
<return type="String" />
<description>
- Gets the text caption for this node (used by some editors).
+ When inheriting from [AnimationRootNode], implement this virtual method to override the text caption for this node.
</description>
</method>
<method name="_get_child_by_name" qualifiers="virtual const">
<return type="AnimationNode" />
<param index="0" name="name" type="StringName" />
<description>
- Gets a child node by index (used by editors inheriting from [AnimationRootNode]).
+ When inheriting from [AnimationRootNode], implement this virtual method to return a child node by its [param name].
</description>
</method>
<method name="_get_child_nodes" qualifiers="virtual const">
<return type="Dictionary" />
<description>
- Gets all children nodes in order as a [code]name: node[/code] dictionary. Only useful when inheriting [AnimationRootNode].
+ When inheriting from [AnimationRootNode], implement this virtual method to return all children nodes in order as a [code]name: node[/code] dictionary.
</description>
</method>
<method name="_get_parameter_default_value" qualifiers="virtual const">
<return type="Variant" />
<param index="0" name="parameter" type="StringName" />
<description>
- Gets the default value of a parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees.
+ When inheriting from [AnimationRootNode], implement this virtual method to return the default value of a [param parameter]. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees.
</description>
</method>
<method name="_get_parameter_list" qualifiers="virtual const">
<return type="Array" />
<description>
- Gets the property information for parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. Format is similar to [method Object.get_property_list].
+ When inheriting from [AnimationRootNode], implement this virtual method to return a list of the properties on this node. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. Format is similar to [method Object.get_property_list].
</description>
</method>
<method name="_has_filter" qualifiers="virtual const">
<return type="bool" />
<description>
- Returns whether you want the blend tree editor to display filter editing on this node.
+ When inheriting from [AnimationRootNode], implement this virtual method to return whether the blend tree editor should display filter editing on this node.
</description>
</method>
<method name="_process" qualifiers="virtual const">
@@ -55,7 +55,7 @@
<param index="1" name="seek" type="bool" />
<param index="2" name="seek_root" type="bool" />
<description>
- User-defined callback called when a custom node is processed. The [param time] parameter is a relative delta, unless [param seek] is [code]true[/code], in which case it is absolute.
+ When inheriting from [AnimationRootNode], implement this virtual method to run some code when this node is processed. The [param time] parameter is a relative delta, unless [param seek] is [code]true[/code], in which case it is absolute.
Here, call the [method blend_input], [method blend_node] or [method blend_animation] functions. You can also use [method get_parameter] and [method set_parameter] to modify local memory.
This function should return the time left for the current animation to finish (if unsure, pass the value from the main blend being called).
</description>
diff --git a/doc/classes/AudioEffectChorus.xml b/doc/classes/AudioEffectChorus.xml
index 83cbcff70c..de168cdfb0 100644
--- a/doc/classes/AudioEffectChorus.xml
+++ b/doc/classes/AudioEffectChorus.xml
@@ -166,7 +166,7 @@
The voice's filter rate.
</member>
<member name="voice_count" type="int" setter="set_voice_count" getter="get_voice_count" default="2">
- The amount of voices in the effect.
+ The number of voices in the effect.
</member>
<member name="wet" type="float" setter="set_wet" getter="get_wet" default="0.5">
The effect's processed signal.
diff --git a/doc/classes/AudioServer.xml b/doc/classes/AudioServer.xml
index 4ded906dc1..5bd1c82641 100644
--- a/doc/classes/AudioServer.xml
+++ b/doc/classes/AudioServer.xml
@@ -45,7 +45,7 @@
<return type="int" />
<param index="0" name="bus_idx" type="int" />
<description>
- Returns the amount of channels of the bus at index [param bus_idx].
+ Returns the number of channels of the bus at index [param bus_idx].
</description>
</method>
<method name="get_bus_effect">
diff --git a/doc/classes/BitMap.xml b/doc/classes/BitMap.xml
index b286a66f34..53fd9a7b67 100644
--- a/doc/classes/BitMap.xml
+++ b/doc/classes/BitMap.xml
@@ -46,7 +46,7 @@
<method name="get_true_bit_count" qualifiers="const">
<return type="int" />
<description>
- Returns the amount of bitmap elements that are set to [code]true[/code].
+ Returns the number of bitmap elements that are set to [code]true[/code].
</description>
</method>
<method name="grow_mask">
diff --git a/doc/classes/Camera3D.xml b/doc/classes/Camera3D.xml
index 984ad85ff1..6b379e0509 100644
--- a/doc/classes/Camera3D.xml
+++ b/doc/classes/Camera3D.xml
@@ -194,7 +194,7 @@
The camera's projection mode. In [constant PROJECTION_PERSPECTIVE] mode, objects' Z distance from the camera's local space scales their perceived size.
</member>
<member name="size" type="float" setter="set_size" getter="get_size" default="1.0">
- The camera's size measured as 1/2 the width or height. Only applicable in orthogonal and frustum modes. Since [member keep_aspect] locks on axis, [code]size[/code] sets the other axis' size length.
+ The camera's size in meters measured as the diameter of the width or height, depending on [member keep_aspect]. Only applicable in orthogonal and frustum modes.
</member>
<member name="v_offset" type="float" setter="set_v_offset" getter="get_v_offset" default="0.0">
The vertical (Y) offset of the camera viewport.
diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml
index 1423b39e4a..bada113a7a 100644
--- a/doc/classes/CanvasItem.xml
+++ b/doc/classes/CanvasItem.xml
@@ -86,7 +86,7 @@
<param index="2" name="uvs" type="PackedVector2Array" default="PackedVector2Array()" />
<param index="3" name="texture" type="Texture2D" default="null" />
<description>
- Draws a colored polygon of any amount of points, convex or concave. Unlike [method draw_polygon], a single color must be specified for the whole polygon.
+ Draws a colored polygon of any number of points, convex or concave. Unlike [method draw_polygon], a single color must be specified for the whole polygon.
</description>
</method>
<method name="draw_dashed_line">
@@ -211,7 +211,7 @@
<param index="2" name="uvs" type="PackedVector2Array" default="PackedVector2Array()" />
<param index="3" name="texture" type="Texture2D" default="null" />
<description>
- Draws a solid polygon of any amount of points, convex or concave. Unlike [method draw_colored_polygon], each point's color can be changed individually. See also [method draw_polyline] and [method draw_polyline_colors].
+ Draws a solid polygon of any number of points, convex or concave. Unlike [method draw_colored_polygon], each point's color can be changed individually. See also [method draw_polyline] and [method draw_polyline_colors].
</description>
</method>
<method name="draw_polyline">
diff --git a/doc/classes/CodeEdit.xml b/doc/classes/CodeEdit.xml
index 5277df399e..6513b1ee13 100644
--- a/doc/classes/CodeEdit.xml
+++ b/doc/classes/CodeEdit.xml
@@ -482,7 +482,7 @@
Prefixes to trigger an automatic indent.
</member>
<member name="indent_size" type="int" setter="set_indent_size" getter="get_indent_size" default="4">
- Size of tabs, if [code]indent_use_spaces[/code] is enabled the amount of spaces to use.
+ Size of tabs, if [code]indent_use_spaces[/code] is enabled the number of spaces to use.
</member>
<member name="indent_use_spaces" type="bool" setter="set_indent_using_spaces" getter="is_indent_using_spaces" default="false">
Use spaces instead of tabs for indentation.
diff --git a/doc/classes/Curve2D.xml b/doc/classes/Curve2D.xml
index 01a011021f..f15c0d74ca 100644
--- a/doc/classes/Curve2D.xml
+++ b/doc/classes/Curve2D.xml
@@ -15,10 +15,10 @@
<param index="0" name="position" type="Vector2" />
<param index="1" name="in" type="Vector2" default="Vector2(0, 0)" />
<param index="2" name="out" type="Vector2" default="Vector2(0, 0)" />
- <param index="3" name="at_position" type="int" default="-1" />
+ <param index="3" name="index" type="int" default="-1" />
<description>
- Adds a point to a curve at [param position] relative to the [Curve2D]'s position, with control points [param in] and [param out].
- If [param at_position] is given, the point is inserted before the point number [param at_position], moving that point (and every point after) after the inserted point. If [param at_position] is not given, or is an illegal value ([code]at_position &lt;0[/code] or [code]at_position &gt;= [method get_point_count][/code]), the point will be appended at the end of the point list.
+ Adds a point with the specified [param position] relative to the curve's own position, with control points [param in] and [param out]. Appends the new point at the end of the point list.
+ If [param index] is given, the new point is inserted before the existing point identified by index [param index]. Every existing point starting from [param index] is shifted further down the list of points. The index must be greater than or equal to [code]0[/code] and must not exceed the number of existing points in the line. See [member point_count].
</description>
</method>
<method name="clear_points">
diff --git a/doc/classes/Curve3D.xml b/doc/classes/Curve3D.xml
index ca3ce1cb64..0843453820 100644
--- a/doc/classes/Curve3D.xml
+++ b/doc/classes/Curve3D.xml
@@ -15,10 +15,10 @@
<param index="0" name="position" type="Vector3" />
<param index="1" name="in" type="Vector3" default="Vector3(0, 0, 0)" />
<param index="2" name="out" type="Vector3" default="Vector3(0, 0, 0)" />
- <param index="3" name="at_position" type="int" default="-1" />
+ <param index="3" name="index" type="int" default="-1" />
<description>
- Adds a point to a curve at [param position] relative to the [Curve3D]'s position, with control points [param in] and [param out].
- If [param at_position] is given, the point is inserted before the point number [param at_position], moving that point (and every point after) after the inserted point. If [param at_position] is not given, or is an illegal value ([code]at_position &lt;0[/code] or [code]at_position &gt;= [method get_point_count][/code]), the point will be appended at the end of the point list.
+ Adds a point with the specified [param position] relative to the curve's own position, with control points [param in] and [param out]. Appends the new point at the end of the point list.
+ If [param index] is given, the new point is inserted before the existing point identified by index [param index]. Every existing point starting from [param index] is shifted further down the list of points. The index must be greater than or equal to [code]0[/code] and must not exceed the number of existing points in the line. See [member point_count].
</description>
</method>
<method name="clear_points">
diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml
index 1a811011eb..cb2474384a 100644
--- a/doc/classes/DisplayServer.xml
+++ b/doc/classes/DisplayServer.xml
@@ -692,7 +692,7 @@
<return type="int" />
<param index="0" name="screen" type="int" default="-1" />
<description>
- Returns the dots per inch density of the specified screen. If [param screen] is [/code]SCREEN_OF_MAIN_WINDOW[/code] (the default value), a screen with the main window will be used.
+ Returns the dots per inch density of the specified screen. If [param screen] is [constant SCREEN_OF_MAIN_WINDOW] (the default value), a screen with the main window will be used.
[b]Note:[/b] On macOS, returned value is inaccurate if fractional display scaling mode is used.
[b]Note:[/b] On Android devices, the actual screen densities are grouped into six generalized densities:
[codeblock]
diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml
index a961068b7b..5a1037aebe 100644
--- a/doc/classes/EditorPlugin.xml
+++ b/doc/classes/EditorPlugin.xml
@@ -729,7 +729,7 @@
</constant>
<constant name="CONTAINER_CANVAS_EDITOR_BOTTOM" value="8" enum="CustomControlContainer">
</constant>
- <constant name="CONTAINER_PROPERTY_EDITOR_BOTTOM" value="9" enum="CustomControlContainer">
+ <constant name="CONTAINER_INSPECTOR_BOTTOM" value="9" enum="CustomControlContainer">
</constant>
<constant name="CONTAINER_PROJECT_SETTING_TAB_LEFT" value="10" enum="CustomControlContainer">
</constant>
diff --git a/doc/classes/HTTPRequest.xml b/doc/classes/HTTPRequest.xml
index 490b918f40..4b098bf585 100644
--- a/doc/classes/HTTPRequest.xml
+++ b/doc/classes/HTTPRequest.xml
@@ -176,7 +176,7 @@
<method name="get_downloaded_bytes" qualifiers="const">
<return type="int" />
<description>
- Returns the amount of bytes this HTTPRequest downloaded.
+ Returns the number of bytes this HTTPRequest downloaded.
</description>
</method>
<method name="get_http_client_status" qualifiers="const">
diff --git a/doc/classes/ImporterMesh.xml b/doc/classes/ImporterMesh.xml
index 7a658cb52a..e15cfcd2c0 100644
--- a/doc/classes/ImporterMesh.xml
+++ b/doc/classes/ImporterMesh.xml
@@ -101,7 +101,7 @@
<method name="get_surface_count" qualifiers="const">
<return type="int" />
<description>
- Returns the amount of surfaces that the mesh holds.
+ Returns the number of surfaces that the mesh holds.
</description>
</method>
<method name="get_surface_format" qualifiers="const">
@@ -115,7 +115,7 @@
<return type="int" />
<param index="0" name="surface_idx" type="int" />
<description>
- Returns the amount of lods that the mesh holds on a given surface.
+ Returns the number of lods that the mesh holds on a given surface.
</description>
</method>
<method name="get_surface_lod_indices" qualifiers="const">
diff --git a/doc/classes/Label.xml b/doc/classes/Label.xml
index 7353e4df9c..239eea099b 100644
--- a/doc/classes/Label.xml
+++ b/doc/classes/Label.xml
@@ -14,7 +14,7 @@
<method name="get_line_count" qualifiers="const">
<return type="int" />
<description>
- Returns the amount of lines of text the Label has.
+ Returns the number of lines of text the Label has.
</description>
</method>
<method name="get_line_height" qualifiers="const">
@@ -62,7 +62,7 @@
</member>
<member name="mouse_filter" type="int" setter="set_mouse_filter" getter="get_mouse_filter" overrides="Control" enum="Control.MouseFilter" default="2" />
<member name="percent_visible" type="float" setter="set_percent_visible" getter="get_percent_visible" default="1.0">
- Limits the amount of visible characters. If you set [code]percent_visible[/code] to 0.5, only up to half of the text's characters will display on screen. Useful to animate the text in a dialog box.
+ Limits the number of visible characters. If you set [code]percent_visible[/code] to 0.5, only up to half of the text's characters will display on screen. Useful to animate the text in a dialog box.
[b]Note:[/b] Setting this property updates [member visible_characters] based on current [method get_total_character_count].
</member>
<member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" overrides="Control" default="4" />
diff --git a/doc/classes/Line2D.xml b/doc/classes/Line2D.xml
index f6aea83b7f..4547c3589f 100644
--- a/doc/classes/Line2D.xml
+++ b/doc/classes/Line2D.xml
@@ -14,10 +14,10 @@
<method name="add_point">
<return type="void" />
<param index="0" name="position" type="Vector2" />
- <param index="1" name="at_position" type="int" default="-1" />
+ <param index="1" name="index" type="int" default="-1" />
<description>
- Adds a point at the [param position]. Appends the point at the end of the line.
- If [param at_position] is given, the point is inserted before the point number [param at_position], moving that point (and every point after) after the inserted point. If [param at_position] is not given, or is an illegal value ([code]at_position &lt; 0[/code] or [code]at_position &gt;= [method get_point_count][/code]), the point will be appended at the end of the point list.
+ Adds a point with the specified [param position] relative to the line's own position. Appends the new point at the end of the point list.
+ If [param index] is given, the new point is inserted before the existing point identified by index [param index]. Every existing point starting from [param index] is shifted further down the list of points. The index must be greater than or equal to [code]0[/code] and must not exceed the number of existing points in the line. See [method get_point_count].
</description>
</method>
<method name="clear_points">
@@ -29,29 +29,29 @@
<method name="get_point_count" qualifiers="const">
<return type="int" />
<description>
- Returns the Line2D's amount of points.
+ Returns the number of points in the line.
</description>
</method>
<method name="get_point_position" qualifiers="const">
<return type="Vector2" />
- <param index="0" name="i" type="int" />
+ <param index="0" name="index" type="int" />
<description>
- Returns point [param i]'s position.
+ Returns the position of the point at index [param index].
</description>
</method>
<method name="remove_point">
<return type="void" />
- <param index="0" name="i" type="int" />
+ <param index="0" name="index" type="int" />
<description>
- Removes the point at index [param i] from the line.
+ Removes the point at index [param index] from the line.
</description>
</method>
<method name="set_point_position">
<return type="void" />
- <param index="0" name="i" type="int" />
+ <param index="0" name="index" type="int" />
<param index="1" name="position" type="Vector2" />
<description>
- Overwrites the position in point [param i] with the supplied [param position].
+ Overwrites the position of the point at index [param index] with the supplied [param position].
</description>
</method>
</methods>
diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml
index 9caaed8377..20703f680c 100644
--- a/doc/classes/LineEdit.xml
+++ b/doc/classes/LineEdit.xml
@@ -183,7 +183,7 @@
Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
</member>
<member name="max_length" type="int" setter="set_max_length" getter="get_max_length" default="0">
- Maximum amount of characters that can be entered inside the [LineEdit]. If [code]0[/code], there is no limit.
+ Maximum number of characters that can be entered inside the [LineEdit]. If [code]0[/code], there is no limit.
When a limit is defined, characters that would exceed [member max_length] are truncated. This happens both for existing [member text] contents when setting the max length, or for new text inserted in the [LineEdit], including pasting. If any input text is truncated, the [signal text_change_rejected] signal is emitted with the truncated substring as parameter.
[b]Example:[/b]
[codeblocks]
@@ -417,7 +417,7 @@
The caret's width in pixels. Greater values can be used to improve accessibility by ensuring the caret is easily visible, or to ensure consistency with a large font size.
</theme_item>
<theme_item name="minimum_character_width" data_type="constant" type="int" default="4">
- Minimum horizontal space for the text (not counting the clear button and content margins). This value is measured in count of 'M' characters (i.e. this amount of 'M' characters can be displayed without scrolling).
+ Minimum horizontal space for the text (not counting the clear button and content margins). This value is measured in count of 'M' characters (i.e. this number of 'M' characters can be displayed without scrolling).
</theme_item>
<theme_item name="outline_size" data_type="constant" type="int" default="0">
The size of the text outline.
diff --git a/doc/classes/Mesh.xml b/doc/classes/Mesh.xml
index 0de42b64af..8e98efa6fc 100644
--- a/doc/classes/Mesh.xml
+++ b/doc/classes/Mesh.xml
@@ -103,7 +103,7 @@
<description>
Calculate a [ConvexPolygonShape3D] from the mesh.
If [param clean] is [code]true[/code] (default), duplicate and interior vertices are removed automatically. You can set it to [code]false[/code] to make the process faster if not needed.
- If [param simplify] is [code]true[/code], the geometry can be further simplified to reduce the amount of vertices. Disabled by default.
+ If [param simplify] is [code]true[/code], the geometry can be further simplified to reduce the number of vertices. Disabled by default.
</description>
</method>
<method name="create_outline" qualifiers="const">
@@ -142,7 +142,7 @@
<method name="get_surface_count" qualifiers="const">
<return type="int" />
<description>
- Returns the amount of surfaces that the [Mesh] holds.
+ Returns the number of surfaces that the [Mesh] holds.
</description>
</method>
<method name="surface_get_arrays" qualifiers="const">
diff --git a/doc/classes/MeshInstance3D.xml b/doc/classes/MeshInstance3D.xml
index 7dfee420d4..618503c8df 100644
--- a/doc/classes/MeshInstance3D.xml
+++ b/doc/classes/MeshInstance3D.xml
@@ -20,7 +20,7 @@
<description>
This helper creates a [StaticBody3D] child node with a [ConvexPolygonShape3D] collision shape calculated from the mesh geometry. It's mainly used for testing.
If [param clean] is [code]true[/code] (default), duplicate and interior vertices are removed automatically. You can set it to [code]false[/code] to make the process faster if not needed.
- If [param simplify] is [code]true[/code], the geometry can be further simplified to reduce the amount of vertices. Disabled by default.
+ If [param simplify] is [code]true[/code], the geometry can be further simplified to reduce the number of vertices. Disabled by default.
</description>
</method>
<method name="create_debug_tangents">
diff --git a/doc/classes/MultiMeshInstance3D.xml b/doc/classes/MultiMeshInstance3D.xml
index 52cc9cb65f..70fbf235e2 100644
--- a/doc/classes/MultiMeshInstance3D.xml
+++ b/doc/classes/MultiMeshInstance3D.xml
@@ -5,7 +5,7 @@
</brief_description>
<description>
[MultiMeshInstance3D] is a specialized node to instance [GeometryInstance3D]s based on a [MultiMesh] resource.
- This is useful to optimize the rendering of a high amount of instances of a given mesh (for example trees in a forest or grass strands).
+ This is useful to optimize the rendering of a high number of instances of a given mesh (for example trees in a forest or grass strands).
</description>
<tutorials>
<link title="Animating thousands of fish with MultiMeshInstance">$DOCS_URL/tutorials/performance/vertex_animation/animating_thousands_of_fish.html</link>
diff --git a/doc/classes/NavigationMeshGenerator.xml b/doc/classes/NavigationMeshGenerator.xml
index faf777bbc9..4c337db90f 100644
--- a/doc/classes/NavigationMeshGenerator.xml
+++ b/doc/classes/NavigationMeshGenerator.xml
@@ -6,7 +6,7 @@
<description>
This class is responsible for creating and clearing 3D navigation meshes used as [NavigationMesh] resources inside [NavigationRegion3D]. The [NavigationMeshGenerator] has very limited to no use for 2D as the navigation mesh baking process expects 3D node types and 3D source geometry to parse.
The entire navigation mesh baking is best done in a separate thread as the voxelization, collision tests and mesh optimization steps involved are very performance and time hungry operations.
- Navigation mesh baking happens in multiple steps and the result depends on 3D source geometry and properties of the [NavigationMesh] resource. In the first step, starting from a root node and depending on [NavigationMesh] properties all valid 3D source geometry nodes are collected from the [SceneTree]. Second, all collected nodes are parsed for their relevant 3D geometry data and a combined 3D mesh is build. Due to the many different types of parsable objects, from normal [MeshInstance3D]s to [CSGShape3D]s or various [CollisionObject3D]s, some operations to collect geometry data can trigger [RenderingServer] and [PhysicsServer3D] synchronizations. Server synchronization can have a negative effect on baking time or framerate as it often involves [Mutex] locking for thread security. Many parsable objects and the continuous synchronization with other threaded Servers can increase the baking time significantly. On the other hand only a few but very large and complex objects will take some time to prepare for the Servers which can noticeably stall the next frame render. As a general rule the total amount of parsable objects and their individual size and complexity should be balanced to avoid framerate issues or very long baking times. The combined mesh is then passed to the Recast Navigation Object to test the source geometry for walkable terrain suitable to [NavigationMesh] agent properties by creating a voxel world around the meshes bounding area.
+ Navigation mesh baking happens in multiple steps and the result depends on 3D source geometry and properties of the [NavigationMesh] resource. In the first step, starting from a root node and depending on [NavigationMesh] properties all valid 3D source geometry nodes are collected from the [SceneTree]. Second, all collected nodes are parsed for their relevant 3D geometry data and a combined 3D mesh is build. Due to the many different types of parsable objects, from normal [MeshInstance3D]s to [CSGShape3D]s or various [CollisionObject3D]s, some operations to collect geometry data can trigger [RenderingServer] and [PhysicsServer3D] synchronizations. Server synchronization can have a negative effect on baking time or framerate as it often involves [Mutex] locking for thread security. Many parsable objects and the continuous synchronization with other threaded Servers can increase the baking time significantly. On the other hand only a few but very large and complex objects will take some time to prepare for the Servers which can noticeably stall the next frame render. As a general rule the total number of parsable objects and their individual size and complexity should be balanced to avoid framerate issues or very long baking times. The combined mesh is then passed to the Recast Navigation Object to test the source geometry for walkable terrain suitable to [NavigationMesh] agent properties by creating a voxel world around the meshes bounding area.
The finalized navigation mesh is then returned and stored inside the [NavigationMesh] for use as a resource inside [NavigationRegion3D] nodes.
[b]Note:[/b] Using meshes to not only define walkable surfaces but also obstruct navigation baking does not always work. The navigation baking has no concept of what is a geometry "inside" when dealing with mesh source geometry and this is intentional. Depending on current baking parameters, as soon as the obstructing mesh is large enough to fit a navigation mesh area inside, the baking will generate navigation mesh areas that are inside the obstructing source geometry mesh.
</description>
diff --git a/doc/classes/NavigationServer2D.xml b/doc/classes/NavigationServer2D.xml
index 43457e7d24..e4e9a7fea9 100644
--- a/doc/classes/NavigationServer2D.xml
+++ b/doc/classes/NavigationServer2D.xml
@@ -206,7 +206,7 @@
</method>
<method name="map_is_active" qualifiers="const">
<return type="bool" />
- <param index="0" name="nap" type="RID" />
+ <param index="0" name="map" type="RID" />
<description>
Returns true if the map is active.
</description>
diff --git a/doc/classes/NavigationServer3D.xml b/doc/classes/NavigationServer3D.xml
index e5eee4827b..7c6b828aa9 100644
--- a/doc/classes/NavigationServer3D.xml
+++ b/doc/classes/NavigationServer3D.xml
@@ -231,7 +231,7 @@
</method>
<method name="map_is_active" qualifiers="const">
<return type="bool" />
- <param index="0" name="nap" type="RID" />
+ <param index="0" name="map" type="RID" />
<description>
Returns true if the map is active.
</description>
diff --git a/doc/classes/PhysicsServer2D.xml b/doc/classes/PhysicsServer2D.xml
index d7b5f24f4a..920b56c8c6 100644
--- a/doc/classes/PhysicsServer2D.xml
+++ b/doc/classes/PhysicsServer2D.xml
@@ -553,7 +553,7 @@
<param index="0" name="body" type="RID" />
<param index="1" name="amount" type="int" />
<description>
- Sets the maximum contacts to report. Bodies can keep a log of the contacts with other bodies, this is enabled by setting the maximum amount of contacts reported to a number greater than 0.
+ Sets the maximum contacts to report. Bodies can keep a log of the contacts with other bodies. This is enabled by setting the maximum number of contacts reported to a number greater than 0.
</description>
</method>
<method name="body_set_mode">
@@ -882,7 +882,7 @@
Constant to set/get the default solver bias for all physics constraints. A solver bias is a factor controlling how much two objects "rebound", after violating a constraint, to avoid leaving them in that state because of numerical imprecision.
</constant>
<constant name="SPACE_PARAM_SOLVER_ITERATIONS" value="8" enum="SpaceParameter">
- Constant to set/get the number of solver iterations for all contacts and constraints. The greater the amount of iterations, the more accurate the collisions will be. However, a greater amount of iterations requires more CPU power, which can decrease performance.
+ Constant to set/get the number of solver iterations for all contacts and constraints. The greater the number of iterations, the more accurate the collisions will be. However, a greater number of iterations requires more CPU power, which can decrease performance.
</constant>
<constant name="SHAPE_WORLD_BOUNDARY" value="0" enum="ShapeType">
This is the constant for creating world boundary shapes. A world boundary shape is an [i]infinite[/i] line with an origin point, and a normal. Thus, it can be used for front/behind checks.
diff --git a/doc/classes/PhysicsServer3D.xml b/doc/classes/PhysicsServer3D.xml
index c5456f7536..b2456c69ec 100644
--- a/doc/classes/PhysicsServer3D.xml
+++ b/doc/classes/PhysicsServer3D.xml
@@ -549,7 +549,7 @@
<param index="0" name="body" type="RID" />
<param index="1" name="amount" type="int" />
<description>
- Sets the maximum contacts to report. Bodies can keep a log of the contacts with other bodies, this is enabled by setting the maximum amount of contacts reported to a number greater than 0.
+ Sets the maximum contacts to report. Bodies can keep a log of the contacts with other bodies. This is enabled by setting the maximum number of contacts reported to a number greater than 0.
</description>
</method>
<method name="body_set_mode">
@@ -1422,7 +1422,7 @@
Constant to set/get the maximum time of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after this time.
</constant>
<constant name="SPACE_PARAM_SOLVER_ITERATIONS" value="7" enum="SpaceParameter">
- Constant to set/get the number of solver iterations for contacts and constraints. The greater the amount of iterations, the more accurate the collisions and constraints will be. However, a greater amount of iterations requires more CPU power, which can decrease performance.
+ Constant to set/get the number of solver iterations for contacts and constraints. The greater the number of iterations, the more accurate the collisions and constraints will be. However, a greater number of iterations requires more CPU power, which can decrease performance.
</constant>
<constant name="BODY_AXIS_LINEAR_X" value="1" enum="BodyAxis">
</constant>
diff --git a/doc/classes/PopupPanel.xml b/doc/classes/PopupPanel.xml
index d850cf20b8..0c6c342f5b 100644
--- a/doc/classes/PopupPanel.xml
+++ b/doc/classes/PopupPanel.xml
@@ -5,6 +5,7 @@
</brief_description>
<description>
Class for displaying popups with a panel background. In some cases it might be simpler to use than [Popup], since it provides a configurable background. If you are making windows, better check [Window].
+ If any [Control] node is added as a child of this [PopupPanel], it will be stretched to fit the panel's size (similar to how [PanelContainer] works).
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index 9dd41d270e..b0df71dced 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -344,7 +344,7 @@
Path to logs within the project. Using an [code]user://[/code] path is recommended.
</member>
<member name="debug/file_logging/max_log_files" type="int" setter="" getter="" default="5">
- Specifies the maximum amount of log files allowed (used for rotation).
+ Specifies the maximum number of log files allowed (used for rotation).
</member>
<member name="debug/gdscript/warnings/assert_always_false" type="int" setter="" getter="" default="1">
If [code]enabled[/code], prints a warning or an error when an [code]assert[/code] call always returns false.
@@ -466,7 +466,7 @@
Maximum call stack allowed for debugging GDScript.
</member>
<member name="debug/settings/profiler/max_functions" type="int" setter="" getter="" default="16384">
- Maximum amount of functions per frame allowed when profiling.
+ Maximum number of functions per frame allowed when profiling.
</member>
<member name="debug/settings/stdout/print_fps" type="bool" setter="" getter="" default="false">
Print frames per second to standard output every second.
@@ -1468,13 +1468,13 @@
Default edge connection margin for 3D navigation maps. See [method NavigationServer3D.map_set_edge_connection_margin].
</member>
<member name="network/limits/debugger/max_chars_per_second" type="int" setter="" getter="" default="32768">
- Maximum amount of characters allowed to send as output from the debugger. Over this value, content is dropped. This helps not to stall the debugger connection.
+ Maximum number of characters allowed to send as output from the debugger. Over this value, content is dropped. This helps not to stall the debugger connection.
</member>
<member name="network/limits/debugger/max_errors_per_second" type="int" setter="" getter="" default="400">
Maximum number of errors allowed to be sent from the debugger. Over this value, content is dropped. This helps not to stall the debugger connection.
</member>
<member name="network/limits/debugger/max_queued_messages" type="int" setter="" getter="" default="2048">
- Maximum amount of messages in the debugger queue. Over this value, content is dropped. This helps to limit the debugger memory usage.
+ Maximum number of messages in the debugger queue. Over this value, content is dropped. This helps to limit the debugger memory usage.
</member>
<member name="network/limits/debugger/max_warnings_per_second" type="int" setter="" getter="" default="400">
Maximum number of warnings allowed to be sent from the debugger. Over this value, content is dropped. This helps not to stall the debugger connection.
@@ -1565,7 +1565,7 @@
Individual shapes can have a specific bias value (see [member Shape2D.custom_solver_bias]).
</member>
<member name="physics/2d/solver/solver_iterations" type="int" setter="" getter="" default="16">
- Number of solver iterations for all contacts and constraints. The greater the amount of iterations, the more accurate the collisions will be. However, a greater amount of iterations requires more CPU power, which can decrease performance. See [constant PhysicsServer2D.SPACE_PARAM_SOLVER_ITERATIONS].
+ Number of solver iterations for all contacts and constraints. The greater the number of iterations, the more accurate the collisions will be. However, a greater number of iterations requires more CPU power, which can decrease performance. See [constant PhysicsServer2D.SPACE_PARAM_SOLVER_ITERATIONS].
</member>
<member name="physics/2d/time_before_sleep" type="float" setter="" getter="" default="0.5">
Time (in seconds) of inactivity before which a 2D physics body will put to sleep. See [constant PhysicsServer2D.SPACE_PARAM_BODY_TIME_TO_SLEEP].
@@ -1633,7 +1633,7 @@
Individual shapes can have a specific bias value (see [member Shape3D.custom_solver_bias]).
</member>
<member name="physics/3d/solver/solver_iterations" type="int" setter="" getter="" default="16">
- Number of solver iterations for all contacts and constraints. The greater the amount of iterations, the more accurate the collisions will be. However, a greater amount of iterations requires more CPU power, which can decrease performance. See [constant PhysicsServer3D.SPACE_PARAM_SOLVER_ITERATIONS].
+ Number of solver iterations for all contacts and constraints. The greater the number of iterations, the more accurate the collisions will be. However, a greater number of iterations requires more CPU power, which can decrease performance. See [constant PhysicsServer3D.SPACE_PARAM_SOLVER_ITERATIONS].
</member>
<member name="physics/3d/time_before_sleep" type="float" setter="" getter="" default="0.5">
Time (in seconds) of inactivity before which a 3D physics body will put to sleep. See [constant PhysicsServer3D.SPACE_PARAM_BODY_TIME_TO_SLEEP].
@@ -1836,7 +1836,7 @@
Max number of omnilights and spotlights renderable per object. At the default value of 8, this means that each surface can be affected by up to 8 omnilights and 8 spotlights. This is further limited by hardware support and [member rendering/limits/opengl/max_renderable_lights]. Setting this low will slightly reduce memory usage, may decrease shader compile times, and may result in faster rendering on low-end, mobile, or web devices.
</member>
<member name="rendering/limits/opengl/max_renderable_elements" type="int" setter="" getter="" default="65536">
- Max amount of elements renderable in a frame. If more elements than this are visible per frame, they will not be drawn. Keep in mind elements refer to mesh surfaces and not meshes themselves. Setting this low will slightly reduce memory usage and may decrease shader compile times, particularly on web. For most uses, the default value is suitable, but consider lowering as much as possible on web export.
+ Max number of elements renderable in a frame. If more elements than this are visible per frame, they will not be drawn. Keep in mind elements refer to mesh surfaces and not meshes themselves. Setting this low will slightly reduce memory usage and may decrease shader compile times, particularly on web. For most uses, the default value is suitable, but consider lowering as much as possible on web export.
</member>
<member name="rendering/limits/opengl/max_renderable_lights" type="int" setter="" getter="" default="32">
Max number of positional lights renderable in a frame. If more lights than this number are used, they will be ignored. Setting this low will slightly reduce memory usage and may decrease shader compile times, particularly on web. For most uses, the default value is suitable, but consider lowering as much as possible on web export.
diff --git a/doc/classes/Quaternion.xml b/doc/classes/Quaternion.xml
index 6fb5b6d181..bc0ffbefe2 100644
--- a/doc/classes/Quaternion.xml
+++ b/doc/classes/Quaternion.xml
@@ -71,7 +71,7 @@
<param index="0" name="to" type="Quaternion" />
<description>
Returns the angle between this quaternion and [param to]. This is the magnitude of the angle you would need to rotate by to get from one to the other.
- [b]Note:[/b] This method has an abnormally high amount of floating-point error, so methods such as [code]is_zero_approx[/code] will not work reliably.
+ [b]Note:[/b] This method has an abnormally high number of floating-point errors, so methods such as [code]is_zero_approx[/code] will not work reliably.
</description>
</method>
<method name="dot" qualifiers="const">
diff --git a/doc/classes/ReflectionProbe.xml b/doc/classes/ReflectionProbe.xml
index ff66a89cb7..fee48dd246 100644
--- a/doc/classes/ReflectionProbe.xml
+++ b/doc/classes/ReflectionProbe.xml
@@ -50,7 +50,7 @@
[b]Note:[/b] [member mesh_lod_threshold] does not affect [GeometryInstance3D] visibility ranges (also known as "manual" LOD or hierarchical LOD).
</member>
<member name="origin_offset" type="Vector3" setter="set_origin_offset" getter="get_origin_offset" default="Vector3(0, 0, 0)">
- Sets the origin offset to be used when this [ReflectionProbe] is in [member box_projection] mode. This can be set to a non-zero value to ensure a reflection fits a rectangle-shaped room, while reducing the amount of objects that "get in the way" of the reflection.
+ Sets the origin offset to be used when this [ReflectionProbe] is in [member box_projection] mode. This can be set to a non-zero value to ensure a reflection fits a rectangle-shaped room, while reducing the number of objects that "get in the way" of the reflection.
</member>
<member name="update_mode" type="int" setter="set_update_mode" getter="get_update_mode" enum="ReflectionProbe.UpdateMode" default="0">
Sets how frequently the [ReflectionProbe] is updated. Can be [constant UPDATE_ONCE] or [constant UPDATE_ALWAYS].
diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml
index bd930bf93f..62351ea9ec 100644
--- a/doc/classes/RenderingServer.xml
+++ b/doc/classes/RenderingServer.xml
@@ -1801,7 +1801,7 @@
<param index="1" name="longitudes" type="int" />
<param index="2" name="radius" type="float" />
<description>
- Returns a mesh of a sphere with the given amount of horizontal and vertical subdivisions.
+ Returns a mesh of a sphere with the given number of horizontal and vertical subdivisions.
</description>
</method>
<method name="material_create">
diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml
index 0496b8f34b..0b358bd06f 100644
--- a/doc/classes/SceneTree.xml
+++ b/doc/classes/SceneTree.xml
@@ -215,12 +215,15 @@
</member>
<member name="debug_collisions_hint" type="bool" setter="set_debug_collisions_hint" getter="is_debugging_collisions_hint" default="false">
If [code]true[/code], collision shapes will be visible when running the game from the editor for debugging purposes.
+ [b]Note:[/b] This property is not designed to be changed at run-time. Changing the value of [member debug_collisions_hint] while the project is running will not have the desired effect.
</member>
<member name="debug_navigation_hint" type="bool" setter="set_debug_navigation_hint" getter="is_debugging_navigation_hint" default="false">
If [code]true[/code], navigation polygons will be visible when running the game from the editor for debugging purposes.
+ [b]Note:[/b] This property is not designed to be changed at run-time. Changing the value of [member debug_navigation_hint] while the project is running will not have the desired effect.
</member>
<member name="debug_paths_hint" type="bool" setter="set_debug_paths_hint" getter="is_debugging_paths_hint" default="false">
If [code]true[/code], curves from [Path2D] and [Path3D] nodes will be visible when running the game from the editor for debugging purposes.
+ [b]Note:[/b] This property is not designed to be changed at run-time. Changing the value of [member debug_paths_hint] while the project is running will not have the desired effect.
</member>
<member name="edited_scene_root" type="Node" setter="set_edited_scene_root" getter="get_edited_scene_root">
The root of the edited scene.
diff --git a/doc/classes/Skeleton3D.xml b/doc/classes/Skeleton3D.xml
index 7f2a41e00c..e332618e9f 100644
--- a/doc/classes/Skeleton3D.xml
+++ b/doc/classes/Skeleton3D.xml
@@ -90,7 +90,7 @@
<method name="get_bone_count" qualifiers="const">
<return type="int" />
<description>
- Returns the amount of bones in the skeleton.
+ Returns the number of bones in the skeleton.
</description>
</method>
<method name="get_bone_global_pose" qualifiers="const">
diff --git a/doc/classes/SkeletonModification2DCCDIK.xml b/doc/classes/SkeletonModification2DCCDIK.xml
index e37dc62131..c8fee3f94d 100644
--- a/doc/classes/SkeletonModification2DCCDIK.xml
+++ b/doc/classes/SkeletonModification2DCCDIK.xml
@@ -121,7 +121,7 @@
</methods>
<members>
<member name="ccdik_data_chain_length" type="int" setter="set_ccdik_data_chain_length" getter="get_ccdik_data_chain_length" default="0">
- The amount of CCDIK joints in the CCDIK modification.
+ The number of CCDIK joints in the CCDIK modification.
</member>
<member name="target_nodepath" type="NodePath" setter="set_target_node" getter="get_target_node" default="NodePath(&quot;&quot;)">
The NodePath to the node that is the target for the CCDIK modification. This node is what the CCDIK chain will attempt to rotate the bone chain to.
diff --git a/doc/classes/SkeletonModification2DFABRIK.xml b/doc/classes/SkeletonModification2DFABRIK.xml
index 1240174946..ff3a65fe1a 100644
--- a/doc/classes/SkeletonModification2DFABRIK.xml
+++ b/doc/classes/SkeletonModification2DFABRIK.xml
@@ -77,7 +77,7 @@
</methods>
<members>
<member name="fabrik_data_chain_length" type="int" setter="set_fabrik_data_chain_length" getter="get_fabrik_data_chain_length" default="0">
- The amount of FABRIK joints in the FABRIK modification.
+ The number of FABRIK joints in the FABRIK modification.
</member>
<member name="target_nodepath" type="NodePath" setter="set_target_node" getter="get_target_node" default="NodePath(&quot;&quot;)">
The NodePath to the node that is the target for the FABRIK modification. This node is what the FABRIK chain will attempt to rotate the bone chain to.
diff --git a/doc/classes/SkeletonModification2DPhysicalBones.xml b/doc/classes/SkeletonModification2DPhysicalBones.xml
index 66ff160ab1..d5f46b2ea0 100644
--- a/doc/classes/SkeletonModification2DPhysicalBones.xml
+++ b/doc/classes/SkeletonModification2DPhysicalBones.xml
@@ -50,7 +50,7 @@
</methods>
<members>
<member name="physical_bone_chain_length" type="int" setter="set_physical_bone_chain_length" getter="get_physical_bone_chain_length" default="0">
- The amount of [PhysicalBone2D] nodes linked in this modification.
+ The number of [PhysicalBone2D] nodes linked in this modification.
</member>
</members>
</class>
diff --git a/doc/classes/SkeletonModification3DCCDIK.xml b/doc/classes/SkeletonModification3DCCDIK.xml
index 207896776f..dec0fbe99f 100644
--- a/doc/classes/SkeletonModification3DCCDIK.xml
+++ b/doc/classes/SkeletonModification3DCCDIK.xml
@@ -121,7 +121,7 @@
</methods>
<members>
<member name="ccdik_data_chain_length" type="int" setter="set_ccdik_data_chain_length" getter="get_ccdik_data_chain_length" default="0">
- The amount of CCDIK joints in the CCDIK modification.
+ The number of CCDIK joints in the CCDIK modification.
</member>
<member name="high_quality_solve" type="bool" setter="set_use_high_quality_solve" getter="get_use_high_quality_solve" default="true">
When true, the CCDIK algorithm will perform a higher quality solve that returns more natural results. A high quality solve requires more computation power to solve though, and therefore can be disabled to save performance.
diff --git a/doc/classes/SkeletonModificationStack3D.xml b/doc/classes/SkeletonModificationStack3D.xml
index fd4a8d462a..34c7099bca 100644
--- a/doc/classes/SkeletonModificationStack3D.xml
+++ b/doc/classes/SkeletonModificationStack3D.xml
@@ -79,7 +79,7 @@
When true, the modification's in the stack will be called. This is handled automatically through the [Skeleton3D] node.
</member>
<member name="modification_count" type="int" setter="set_modification_count" getter="get_modification_count" default="0">
- The amount of modifications in the stack.
+ The number of modifications in the stack.
</member>
<member name="strength" type="float" setter="set_strength" getter="get_strength" default="1.0">
The interpolation strength of the modifications in stack. A value of [code]0[/code] will make it where the modifications are not applied, a strength of [code]0.5[/code] will be half applied, and a strength of [code]1[/code] will allow the modifications to be fully applied and override the skeleton bone poses.
diff --git a/doc/classes/StreamPeer.xml b/doc/classes/StreamPeer.xml
index 5bad9796b4..4188563695 100644
--- a/doc/classes/StreamPeer.xml
+++ b/doc/classes/StreamPeer.xml
@@ -37,14 +37,14 @@
<method name="get_available_bytes" qualifiers="const">
<return type="int" />
<description>
- Returns the amount of bytes this [StreamPeer] has available.
+ Returns the number of bytes this [StreamPeer] has available.
</description>
</method>
<method name="get_data">
<return type="Array" />
<param index="0" name="bytes" type="int" />
<description>
- Returns a chunk data with the received bytes. The amount of bytes to be received can be requested in the [param bytes] argument. If not enough bytes are available, the function will block until the desired amount is received. This function returns two values, an [enum @GlobalScope.Error] code and a data array.
+ Returns a chunk data with the received bytes. The number of bytes to be received can be requested in the [param bytes] argument. If not enough bytes are available, the function will block until the desired amount is received. This function returns two values, an [enum @GlobalScope.Error] code and a data array.
</description>
</method>
<method name="get_double">
@@ -63,7 +63,7 @@
<return type="Array" />
<param index="0" name="bytes" type="int" />
<description>
- Returns a chunk data with the received bytes. The amount of bytes to be received can be requested in the "bytes" argument. If not enough bytes are available, the function will return how many were actually received. This function returns two values, an [enum @GlobalScope.Error] code, and a data array.
+ Returns a chunk data with the received bytes. The number of bytes to be received can be requested in the "bytes" argument. If not enough bytes are available, the function will return how many were actually received. This function returns two values, an [enum @GlobalScope.Error] code, and a data array.
</description>
</method>
<method name="get_string">
diff --git a/doc/classes/String.xml b/doc/classes/String.xml
index ee508cf70a..f1cd4d72f7 100644
--- a/doc/classes/String.xml
+++ b/doc/classes/String.xml
@@ -440,7 +440,7 @@
<method name="length" qualifiers="const">
<return type="int" />
<description>
- Returns the string's amount of characters.
+ Returns the number of characters in the string.
</description>
</method>
<method name="lpad" qualifiers="const">
@@ -522,7 +522,7 @@
# Last digit will be rounded up here, which reduces total digit count since
# trailing zeros are removed:
String.num(42.129999, 5) # "42.13"
- # If `decimals` is not specified, the total amount of significant digits is 14:
+ # If `decimals` is not specified, the total number of significant digits is 14:
String.num(-0.0000012345432123454321) # "-0.00000123454321"
String.num(-10000.0000012345432123454321) # "-10000.0000012345"
[/codeblock]
diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml
index 40d6d67f4c..aa7ce85f3a 100644
--- a/doc/classes/TextEdit.xml
+++ b/doc/classes/TextEdit.xml
@@ -161,7 +161,7 @@
<method name="get_gutter_count" qualifiers="const">
<return type="int" />
<description>
- Returns the total amount of gutters registered.
+ Returns the number of gutters registered.
</description>
</method>
<method name="get_gutter_name" qualifiers="const">
@@ -189,7 +189,7 @@
<return type="int" />
<param index="0" name="line" type="int" />
<description>
- Returns the amount of spaces and [code]tab * tab_size[/code] before the first char.
+ Returns the number of spaces and [code]tab * tab_size[/code] before the first char.
</description>
</method>
<method name="get_last_full_visible_line" qualifiers="const">
@@ -235,7 +235,7 @@
<method name="get_line_count" qualifiers="const">
<return type="int" />
<description>
- Returns the amount of total lines in the text.
+ Returns the number of lines in the text.
</description>
</method>
<method name="get_line_gutter_icon" qualifiers="const">
@@ -329,7 +329,7 @@
<method name="get_minimap_visible_lines" qualifiers="const">
<return type="int" />
<description>
- Returns the total amount of lines that can be draw on the minimap.
+ Returns the number of lines that may be drawn on the minimap.
</description>
</method>
<method name="get_next_visible_line_index_offset_from" qualifiers="const">
@@ -444,7 +444,7 @@
<method name="get_total_visible_line_count" qualifiers="const">
<return type="int" />
<description>
- Returns the total amount of lines that could be draw.
+ Returns the number of lines that may be drawn.
</description>
</method>
<method name="get_version" qualifiers="const">
diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml
index c18291914f..ee3c87b8e6 100644
--- a/doc/classes/TextServer.xml
+++ b/doc/classes/TextServer.xml
@@ -942,7 +942,7 @@
<param index="0" name="string" type="String" />
<param index="1" name="dict" type="PackedStringArray" />
<description>
- Returns index of the first string in [code]dict[/dict] which is visually confusable with the [code]string[/string], or [code]-1[/code] if none is found.
+ Returns index of the first string in [param dict] which is visually confusable with the [param string], or [code]-1[/code] if none is found.
[b]Note:[/b] This method doesn't detect invisible characters, for spoof detection use it in combination with [method spoof_check].
[b]Note:[/b] Always returns [code]-1[/code] if the server does not support the [constant FEATURE_UNICODE_SECURITY] feature.
</description>
@@ -1707,10 +1707,10 @@
Glyph horizontal position is rounded to one quarter of the pixel size, each glyph is rasterized up to four times.
</constant>
<constant name="SUBPIXEL_POSITIONING_ONE_HALF_MAX_SIZE" value="20" enum="SubpixelPositioning">
- Maximum font size which will use one half of the pixel subpixel positioning in [constants SUBPIXEL_POSITIONING_AUTO] mode.
+ Maximum font size which will use one half of the pixel subpixel positioning in [constant SUBPIXEL_POSITIONING_AUTO] mode.
</constant>
<constant name="SUBPIXEL_POSITIONING_ONE_QUARTER_MAX_SIZE" value="16" enum="SubpixelPositioning">
- Maximum font size which will use one quarter of the pixel subpixel positioning in [constants SUBPIXEL_POSITIONING_AUTO] mode.
+ Maximum font size which will use one quarter of the pixel subpixel positioning in [constant SUBPIXEL_POSITIONING_AUTO] mode.
</constant>
<constant name="FEATURE_SIMPLE_LAYOUT" value="1" enum="Feature">
TextServer supports simple text layouts.
diff --git a/doc/classes/TextServerExtension.xml b/doc/classes/TextServerExtension.xml
index b288dc5416..219052d3d5 100644
--- a/doc/classes/TextServerExtension.xml
+++ b/doc/classes/TextServerExtension.xml
@@ -939,7 +939,7 @@
<param index="0" name="string" type="String" />
<param index="1" name="dict" type="PackedStringArray" />
<description>
- Returns index of the first string in [code]dict[/dict] which is visually confusable with the [code]string[/string], or [code]-1[/code] if none is found.
+ Returns index of the first string in [param dict] which is visually confusable with the [param string], or [code]-1[/code] if none is found.
</description>
</method>
<method name="is_locale_right_to_left" qualifiers="virtual const">
diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml
index 4266a414ce..ae57a08ef8 100644
--- a/doc/classes/TileMap.xml
+++ b/doc/classes/TileMap.xml
@@ -77,7 +77,7 @@
<description>
Triggers an update of the TileMap. If [param layer] is provided, only updates the given layer.
[b]Note:[/b] The TileMap node updates automatically when one of its properties is modified. A manual update is only needed if runtime modifications (implemented in [method _tile_data_runtime_update]) need to be applied.
- [b]Warning:[/b] Updating the TileMap is a performance demanding task. Limit occurrences of those updates to the minimum and limit the amount tiles they impact (by segregating tiles updated often to a dedicated layer for example).
+ [b]Warning:[/b] Updating the TileMap is computationally expensive and may impact performance. Try to limit the number of updates and the tiles they impact (by placing frequently updated tiles in a dedicated layer for example).
</description>
</method>
<method name="get_cell_alternative_tile" qualifiers="const">
diff --git a/doc/classes/VisualShaderNodeCustom.xml b/doc/classes/VisualShaderNodeCustom.xml
index 9813b4778d..d96969b383 100644
--- a/doc/classes/VisualShaderNodeCustom.xml
+++ b/doc/classes/VisualShaderNodeCustom.xml
@@ -68,7 +68,7 @@
<method name="_get_input_port_count" qualifiers="virtual const">
<return type="int" />
<description>
- Override this method to define the amount of input ports of the associated custom node.
+ Override this method to define the number of input ports of the associated custom node.
Defining this method is [b]required[/b]. If not overridden, the node has no input ports.
</description>
</method>
@@ -98,7 +98,7 @@
<method name="_get_output_port_count" qualifiers="virtual const">
<return type="int" />
<description>
- Override this method to define the amount of output ports of the associated custom node.
+ Override this method to define the number of output ports of the associated custom node.
Defining this method is [b]required[/b]. If not overridden, the node has no output ports.
</description>
</method>
diff --git a/doc/classes/VisualShaderNodeExpression.xml b/doc/classes/VisualShaderNodeExpression.xml
index c4f010f3c0..6b2dc2f2cb 100644
--- a/doc/classes/VisualShaderNodeExpression.xml
+++ b/doc/classes/VisualShaderNodeExpression.xml
@@ -4,7 +4,7 @@
A custom visual shader graph expression written in Godot Shading Language.
</brief_description>
<description>
- Custom Godot Shading Language expression, with a custom amount of input and output ports.
+ Custom Godot Shading Language expression, with a custom number of input and output ports.
The provided code is directly injected into the graph's matching shader function ([code]vertex[/code], [code]fragment[/code], or [code]light[/code]), so it cannot be used to declare functions, varyings, uniforms, or global constants. See [VisualShaderNodeGlobalExpression] for such global definitions.
</description>
<tutorials>
diff --git a/doc/classes/VisualShaderNodeGroupBase.xml b/doc/classes/VisualShaderNodeGroupBase.xml
index 450629a73f..dcc94f0b24 100644
--- a/doc/classes/VisualShaderNodeGroupBase.xml
+++ b/doc/classes/VisualShaderNodeGroupBase.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeGroupBase" inherits="VisualShaderNodeResizableBase" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
- Base class for a family of nodes with variable amount of input and output ports within the visual shader graph.
+ Base class for a family of nodes with variable number of input and output ports within the visual shader graph.
</brief_description>
<description>
Currently, has no direct usage, use the derived classes instead.
diff --git a/doc/classes/VisualShaderNodeUVFunc.xml b/doc/classes/VisualShaderNodeUVFunc.xml
index 37a9769a10..541991b790 100644
--- a/doc/classes/VisualShaderNodeUVFunc.xml
+++ b/doc/classes/VisualShaderNodeUVFunc.xml
@@ -17,7 +17,7 @@
Translates [code]uv[/code] by using [code]scale[/code] and [code]offset[/code] values using the following formula: [code]uv = uv + offset * scale[/code]. [code]uv[/code] port is connected to [code]UV[/code] built-in by default.
</constant>
<constant name="FUNC_SCALING" value="1" enum="Function">
- Scales [code]uv[/uv] by using [code]scale[/code] and [code]pivot[/code] values using the following formula: [code]uv = (uv - pivot) * scale + pivot[/code]. [code]uv[/code] port is connected to [code]UV[/code] built-in by default.
+ Scales [code]uv[/code] by using [code]scale[/code] and [code]pivot[/code] values using the following formula: [code]uv = (uv - pivot) * scale + pivot[/code]. [code]uv[/code] port is connected to [code]UV[/code] built-in by default.
</constant>
<constant name="FUNC_MAX" value="2" enum="Function">
Represents the size of the [enum Function] enum.
diff --git a/doc/classes/XMLParser.xml b/doc/classes/XMLParser.xml
index 69544f4895..26480f0c18 100644
--- a/doc/classes/XMLParser.xml
+++ b/doc/classes/XMLParser.xml
@@ -12,7 +12,7 @@
<method name="get_attribute_count" qualifiers="const">
<return type="int" />
<description>
- Gets the amount of attributes in the current element.
+ Gets the number of attributes in the current element.
</description>
</method>
<method name="get_attribute_name" qualifiers="const">
diff --git a/doc/tools/doc_status.py b/doc/tools/doc_status.py
index cc0733cab2..376addcff0 100755
--- a/doc/tools/doc_status.py
+++ b/doc/tools/doc_status.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import fnmatch
import os
@@ -7,6 +7,7 @@ import re
import math
import platform
import xml.etree.ElementTree as ET
+from typing import Dict, List, Set
################################################################################
# Config #
@@ -103,13 +104,13 @@ overall_progress_description_weight = 10
################################################################################
-def validate_tag(elem, tag):
+def validate_tag(elem: ET.Element, tag: str) -> None:
if elem.tag != tag:
print('Tag mismatch, expected "' + tag + '", got ' + elem.tag)
sys.exit(255)
-def color(color, string):
+def color(color: str, string: str) -> str:
if flags["c"] and terminal_supports_color():
color_format = ""
for code in colors[color]:
@@ -122,7 +123,7 @@ def color(color, string):
ansi_escape = re.compile(r"\x1b[^m]*m")
-def nonescape_len(s):
+def nonescape_len(s: str) -> int:
return len(ansi_escape.sub("", s))
@@ -142,14 +143,14 @@ def terminal_supports_color():
class ClassStatusProgress:
- def __init__(self, described=0, total=0):
- self.described = described
- self.total = total
+ def __init__(self, described: int = 0, total: int = 0):
+ self.described: int = described
+ self.total: int = total
- def __add__(self, other):
+ def __add__(self, other: "ClassStatusProgress"):
return ClassStatusProgress(self.described + other.described, self.total + other.total)
- def increment(self, described):
+ def increment(self, described: bool):
if described:
self.described += 1
self.total += 1
@@ -163,7 +164,7 @@ class ClassStatusProgress:
else:
return self.to_colored_string()
- def to_colored_string(self, format="{has}/{total}", pad_format="{pad_described}{s}{pad_total}"):
+ def to_colored_string(self, format: str = "{has}/{total}", pad_format: str = "{pad_described}{s}{pad_total}"):
ratio = float(self.described) / float(self.total) if self.total != 0 else 1
percent = int(round(100 * ratio))
s = format.format(has=str(self.described), total=str(self.total), percent=str(percent))
@@ -183,11 +184,11 @@ class ClassStatusProgress:
class ClassStatus:
- def __init__(self, name=""):
- self.name = name
- self.has_brief_description = True
- self.has_description = True
- self.progresses = {
+ def __init__(self, name: str = ""):
+ self.name: str = name
+ self.has_brief_description: bool = True
+ self.has_description: bool = True
+ self.progresses: Dict[str, ClassStatusProgress] = {
"methods": ClassStatusProgress(),
"constants": ClassStatusProgress(),
"members": ClassStatusProgress(),
@@ -197,7 +198,7 @@ class ClassStatus:
"constructors": ClassStatusProgress(),
}
- def __add__(self, other):
+ def __add__(self, other: "ClassStatus"):
new_status = ClassStatus()
new_status.name = self.name
new_status.has_brief_description = self.has_brief_description and other.has_brief_description
@@ -222,8 +223,8 @@ class ClassStatus:
sum += self.progresses[k].total
return sum < 1
- def make_output(self):
- output = {}
+ def make_output(self) -> Dict[str, str]:
+ output: Dict[str, str] = {}
output["name"] = color("name", self.name)
ok_string = color("part_good", "OK")
@@ -263,22 +264,24 @@ class ClassStatus:
return output
@staticmethod
- def generate_for_class(c):
+ def generate_for_class(c: ET.Element):
status = ClassStatus()
status.name = c.attrib["name"]
for tag in list(c):
+ len_tag_text = 0 if (tag.text is None) else len(tag.text.strip())
if tag.tag == "brief_description":
- status.has_brief_description = len(tag.text.strip()) > 0
+ status.has_brief_description = len_tag_text > 0
elif tag.tag == "description":
- status.has_description = len(tag.text.strip()) > 0
+ status.has_description = len_tag_text > 0
elif tag.tag in ["methods", "signals", "operators", "constructors"]:
for sub_tag in list(tag):
descr = sub_tag.find("description")
- status.progresses[tag.tag].increment(len(descr.text.strip()) > 0)
+ increment = (descr is not None) and (descr.text is not None) and len(descr.text.strip()) > 0
+ status.progresses[tag.tag].increment(increment)
elif tag.tag in ["constants", "members", "theme_items"]:
for sub_tag in list(tag):
if not sub_tag.text is None:
@@ -297,9 +300,9 @@ class ClassStatus:
# Arguments #
################################################################################
-input_file_list = []
-input_class_list = []
-merged_file = ""
+input_file_list: List[str] = []
+input_class_list: List[str] = []
+merged_file: str = ""
for arg in sys.argv[1:]:
try:
@@ -373,8 +376,8 @@ if len(input_file_list) < 1 or flags["h"]:
# Parse class list #
################################################################################
-class_names = []
-classes = {}
+class_names: List[str] = []
+classes: Dict[str, ET.Element] = {}
for file in input_file_list:
tree = ET.parse(file)
@@ -396,10 +399,10 @@ class_names.sort()
if len(input_class_list) < 1:
input_class_list = ["*"]
-filtered_classes = set()
+filtered_classes_set: Set[str] = set()
for pattern in input_class_list:
- filtered_classes |= set(fnmatch.filter(class_names, pattern))
-filtered_classes = list(filtered_classes)
+ filtered_classes_set |= set(fnmatch.filter(class_names, pattern))
+filtered_classes = list(filtered_classes_set)
filtered_classes.sort()
################################################################################
@@ -413,7 +416,6 @@ table_column_chars = "|"
total_status = ClassStatus("Total")
for cn in filtered_classes:
-
c = classes[cn]
validate_tag(c, "class")
status = ClassStatus.generate_for_class(c)
@@ -427,7 +429,7 @@ for cn in filtered_classes:
continue
out = status.make_output()
- row = []
+ row: List[str] = []
for column in table_columns:
if column in out:
row.append(out[column])
@@ -464,7 +466,7 @@ if flags["a"]:
# without having to scroll back to the top.
table.append(table_column_names)
-table_column_sizes = []
+table_column_sizes: List[int] = []
for row in table:
for cell_i, cell in enumerate(row):
if cell_i >= len(table_column_sizes):
@@ -477,7 +479,6 @@ for cell_i in range(len(table[0])):
divider_string += (
table_row_chars[1] + table_row_chars[2] * (table_column_sizes[cell_i]) + table_row_chars[1] + table_row_chars[0]
)
-print(divider_string)
for row_i, row in enumerate(table):
row_string = table_column_chars
diff --git a/doc/tools/make_rst.py b/doc/tools/make_rst.py
index 207eb7fabd..519554e026 100755
--- a/doc/tools/make_rst.py
+++ b/doc/tools/make_rst.py
@@ -67,6 +67,7 @@ STYLES: Dict[str, str] = {}
class State:
def __init__(self) -> None:
self.num_errors = 0
+ self.num_warnings = 0
self.classes: OrderedDict[str, ClassDef] = OrderedDict()
self.current_class: str = ""
@@ -353,7 +354,17 @@ class TypeName:
return cls(element.attrib["type"], element.get("enum"))
-class PropertyDef:
+class DefinitionBase:
+ def __init__(
+ self,
+ definition_name: str,
+ name: str,
+ ) -> None:
+ self.definition_name = definition_name
+ self.name = name
+
+
+class PropertyDef(DefinitionBase):
def __init__(
self,
name: str,
@@ -364,9 +375,8 @@ class PropertyDef:
default_value: Optional[str],
overrides: Optional[str],
) -> None:
- self.definition_name = "property"
+ super().__init__("property", name)
- self.name = name
self.type_name = type_name
self.setter = setter
self.getter = getter
@@ -375,25 +385,23 @@ class PropertyDef:
self.overrides = overrides
-class ParameterDef:
+class ParameterDef(DefinitionBase):
def __init__(self, name: str, type_name: TypeName, default_value: Optional[str]) -> None:
- self.definition_name = "parameter"
+ super().__init__("parameter", name)
- self.name = name
self.type_name = type_name
self.default_value = default_value
-class SignalDef:
+class SignalDef(DefinitionBase):
def __init__(self, name: str, parameters: List[ParameterDef], description: Optional[str]) -> None:
- self.definition_name = "signal"
+ super().__init__("signal", name)
- self.name = name
self.parameters = parameters
self.description = description
-class AnnotationDef:
+class AnnotationDef(DefinitionBase):
def __init__(
self,
name: str,
@@ -401,15 +409,14 @@ class AnnotationDef:
description: Optional[str],
qualifiers: Optional[str],
) -> None:
- self.definition_name = "annotation"
+ super().__init__("annotation", name)
- self.name = name
self.parameters = parameters
self.description = description
self.qualifiers = qualifiers
-class MethodDef:
+class MethodDef(DefinitionBase):
def __init__(
self,
name: str,
@@ -418,52 +425,47 @@ class MethodDef:
description: Optional[str],
qualifiers: Optional[str],
) -> None:
- self.definition_name = "method"
+ super().__init__("method", name)
- self.name = name
self.return_type = return_type
self.parameters = parameters
self.description = description
self.qualifiers = qualifiers
-class ConstantDef:
+class ConstantDef(DefinitionBase):
def __init__(self, name: str, value: str, text: Optional[str], bitfield: bool) -> None:
- self.definition_name = "constant"
+ super().__init__("constant", name)
- self.name = name
self.value = value
self.text = text
self.is_bitfield = bitfield
-class EnumDef:
+class EnumDef(DefinitionBase):
def __init__(self, name: str, bitfield: bool) -> None:
- self.definition_name = "enum"
+ super().__init__("enum", name)
- self.name = name
self.values: OrderedDict[str, ConstantDef] = OrderedDict()
self.is_bitfield = bitfield
-class ThemeItemDef:
+class ThemeItemDef(DefinitionBase):
def __init__(
self, name: str, type_name: TypeName, data_name: str, text: Optional[str], default_value: Optional[str]
) -> None:
- self.definition_name = "theme item"
+ super().__init__("theme item", name)
- self.name = name
self.type_name = type_name
self.data_name = data_name
self.text = text
self.default_value = default_value
-class ClassDef:
+class ClassDef(DefinitionBase):
def __init__(self, name: str) -> None:
- self.definition_name = "class"
+ super().__init__("class", name)
- self.name = name
self.constants: OrderedDict[str, ConstantDef] = OrderedDict()
self.enums: OrderedDict[str, EnumDef] = OrderedDict()
self.properties: OrderedDict[str, PropertyDef] = OrderedDict()
@@ -482,11 +484,7 @@ class ClassDef:
self.filepath: str = ""
-def print_error(error: str, state: State) -> None:
- print("{}{}ERROR:{} {}{}".format(STYLES["red"], STYLES["bold"], STYLES["regular"], error, STYLES["reset"]))
- state.num_errors += 1
-
-
+# Entry point for the RST generator.
def main() -> None:
# Enable ANSI escape code support on Windows 10 and later (for colored console output).
# <https://bugs.python.org/issue29059>
@@ -520,6 +518,7 @@ def main() -> None:
should_color = args.color or (hasattr(sys.stdout, "isatty") and sys.stdout.isatty())
STYLES["red"] = "\x1b[91m" if should_color else ""
STYLES["green"] = "\x1b[92m" if should_color else ""
+ STYLES["yellow"] = "\x1b[93m" if should_color else ""
STYLES["bold"] = "\x1b[1m" if should_color else ""
STYLES["regular"] = "\x1b[22m" if should_color else ""
STYLES["reset"] = "\x1b[0m" if should_color else ""
@@ -604,12 +603,29 @@ def main() -> None:
# Create the output folder recursively if it doesn't already exist.
os.makedirs(args.output, exist_ok=True)
+ print("Generating the RST class reference...")
+
for class_name, class_def in state.classes.items():
if args.filter and not pattern.search(class_def.filepath):
continue
state.current_class = class_name
make_rst_class(class_def, state, args.dry_run, args.output)
+ print("")
+
+ if state.num_warnings >= 2:
+ print(
+ "{}{} warnings were found in the class reference XML. Please check the messages above.{}".format(
+ STYLES["yellow"], state.num_warnings, STYLES["reset"]
+ )
+ )
+ elif state.num_warnings == 1:
+ print(
+ "{}1 warning was found in the class reference XML. Please check the messages above.{}".format(
+ STYLES["yellow"], STYLES["reset"]
+ )
+ )
+
if state.num_errors == 0:
print("{}No errors found in the class reference XML.{}".format(STYLES["green"], STYLES["reset"]))
if not args.dry_run:
@@ -630,6 +646,19 @@ def main() -> None:
exit(1)
+# Common helpers.
+
+
+def print_error(error: str, state: State) -> None:
+ print("{}{}ERROR:{} {}{}".format(STYLES["red"], STYLES["bold"], STYLES["regular"], error, STYLES["reset"]))
+ state.num_errors += 1
+
+
+def print_warning(error: str, state: State) -> None:
+ print("{}{}WARNING:{} {}{}".format(STYLES["yellow"], STYLES["bold"], STYLES["regular"], error, STYLES["reset"]))
+ state.num_warnings += 1
+
+
def translate(string: str) -> str:
"""Translate a string based on translations sourced from `doc/translations/*.po`
for a language if defined via the --lang command line argument.
@@ -638,6 +667,9 @@ def translate(string: str) -> str:
return strings_l10n.get(string, string)
+# Generator methods.
+
+
def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: str) -> None:
class_name = class_def.name
@@ -705,12 +737,12 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir:
# Brief description
if class_def.brief_description is not None:
- f.write(rstize_text(class_def.brief_description.strip(), class_def, state) + "\n\n")
+ f.write(format_text_block(class_def.brief_description.strip(), class_def, state) + "\n\n")
# Class description
if class_def.description is not None and class_def.description.strip() != "":
f.write(make_heading("Description", "-"))
- f.write(rstize_text(class_def.description.strip(), class_def, state) + "\n\n")
+ f.write(format_text_block(class_def.description.strip(), class_def, state) + "\n\n")
# Online tutorials
if len(class_def.tutorials) > 0:
@@ -784,7 +816,7 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir:
f.write("- {}\n\n".format(signature))
if signal.description is not None and signal.description.strip() != "":
- f.write(rstize_text(signal.description.strip(), signal, state) + "\n\n")
+ f.write(format_text_block(signal.description.strip(), signal, state) + "\n\n")
index += 1
@@ -814,7 +846,7 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir:
f.write("- **{}** = **{}**".format(value.name, value.value))
if value.text is not None and value.text.strip() != "":
# If value.text contains a bullet point list, each entry needs additional indentation
- f.write(" --- " + indent_bullets(rstize_text(value.text.strip(), value, state)))
+ f.write(" --- " + indent_bullets(format_text_block(value.text.strip(), value, state)))
f.write("\n\n")
@@ -831,7 +863,7 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir:
for constant in class_def.constants.values():
f.write("- **{}** = **{}**".format(constant.name, constant.value))
if constant.text is not None and constant.text.strip() != "":
- f.write(" --- " + rstize_text(constant.text.strip(), constant, state))
+ f.write(" --- " + format_text_block(constant.text.strip(), constant, state))
f.write("\n\n")
@@ -852,7 +884,7 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir:
f.write("- {}\n\n".format(signature))
if m.description is not None and m.description.strip() != "":
- f.write(rstize_text(m.description.strip(), m, state) + "\n\n")
+ f.write(format_text_block(m.description.strip(), m, state) + "\n\n")
index += 1
@@ -884,7 +916,7 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir:
format_table(f, info)
if property_def.text is not None and property_def.text.strip() != "":
- f.write(rstize_text(property_def.text.strip(), property_def, state) + "\n\n")
+ f.write(format_text_block(property_def.text.strip(), property_def, state) + "\n\n")
index += 1
@@ -905,7 +937,7 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir:
f.write("- {} {}\n\n".format(ret_type, signature))
if m.description is not None and m.description.strip() != "":
- f.write(rstize_text(m.description.strip(), m, state) + "\n\n")
+ f.write(format_text_block(m.description.strip(), m, state) + "\n\n")
index += 1
@@ -925,7 +957,7 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir:
f.write("- {} {}\n\n".format(ret_type, signature))
if m.description is not None and m.description.strip() != "":
- f.write(rstize_text(m.description.strip(), m, state) + "\n\n")
+ f.write(format_text_block(m.description.strip(), m, state) + "\n\n")
index += 1
@@ -949,7 +981,7 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir:
f.write("- {} {}\n\n".format(ret_type, signature))
if m.description is not None and m.description.strip() != "":
- f.write(rstize_text(m.description.strip(), m, state) + "\n\n")
+ f.write(format_text_block(m.description.strip(), m, state) + "\n\n")
index += 1
@@ -974,87 +1006,183 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir:
format_table(f, info)
if theme_item_def.text is not None and theme_item_def.text.strip() != "":
- f.write(rstize_text(theme_item_def.text.strip(), theme_item_def, state) + "\n\n")
+ f.write(format_text_block(theme_item_def.text.strip(), theme_item_def, state) + "\n\n")
index += 1
f.write(make_footer())
-def escape_rst(text: str, until_pos: int = -1) -> str:
- # Escape \ character, otherwise it ends up as an escape character in rst
- pos = 0
- while True:
- pos = text.find("\\", pos, until_pos)
- if pos == -1:
- break
- text = text[:pos] + "\\\\" + text[pos + 1 :]
- pos += 2
+def make_type(klass: str, state: State) -> str:
+ if klass.find("*") != -1: # Pointer, ignore
+ return klass
+ link_type = klass
+ if link_type.endswith("[]"): # Typed array, strip [] to link to contained type.
+ link_type = link_type[:-2]
+ if link_type in state.classes:
+ return ":ref:`{}<class_{}>`".format(klass, link_type)
+ print_error('{}.xml: Unresolved type "{}".'.format(state.current_class, klass), state)
+ return klass
- # Escape * character to avoid interpreting it as emphasis
- pos = 0
- while True:
- pos = text.find("*", pos, until_pos)
- if pos == -1:
- break
- text = text[:pos] + "\*" + text[pos + 1 :]
- pos += 2
- # Escape _ character at the end of a word to avoid interpreting it as an inline hyperlink
- pos = 0
- while True:
- pos = text.find("_", pos, until_pos)
- if pos == -1:
- break
- if not text[pos + 1].isalnum(): # don't escape within a snake_case word
- text = text[:pos] + "\_" + text[pos + 1 :]
- pos += 2
- else:
- pos += 1
+def make_enum(t: str, state: State) -> str:
+ p = t.find(".")
+ if p >= 0:
+ c = t[0:p]
+ e = t[p + 1 :]
+ # Variant enums live in GlobalScope but still use periods.
+ if c == "Variant":
+ c = "@GlobalScope"
+ e = "Variant." + e
+ else:
+ c = state.current_class
+ e = t
+ if c in state.classes and e not in state.classes[c].enums:
+ c = "@GlobalScope"
- return text
+ if c in state.classes and e in state.classes[c].enums:
+ return ":ref:`{0}<enum_{1}_{0}>`".format(e, c)
+ # Don't fail for `Vector3.Axis`, as this enum is a special case which is expected not to be resolved.
+ if "{}.{}".format(c, e) != "Vector3.Axis":
+ print_error('{}.xml: Unresolved enum "{}".'.format(state.current_class, t), state)
-def format_codeblock(code_type: str, post_text: str, indent_level: int, state: State) -> Union[Tuple[str, int], None]:
- end_pos = post_text.find("[/" + code_type + "]")
- if end_pos == -1:
- print_error("{}.xml: [" + code_type + "] without a closing tag.".format(state.current_class), state)
- return None
+ return t
- code_text = post_text[len("[" + code_type + "]") : end_pos]
- post_text = post_text[end_pos:]
- # Remove extraneous tabs
- code_pos = 0
- while True:
- code_pos = code_text.find("\n", code_pos)
- if code_pos == -1:
- break
+def make_method_signature(
+ class_def: ClassDef, definition: Union[AnnotationDef, MethodDef, SignalDef], ref_type: str, state: State
+) -> Tuple[str, str]:
+ ret_type = ""
- to_skip = 0
- while code_pos + to_skip + 1 < len(code_text) and code_text[code_pos + to_skip + 1] == "\t":
- to_skip += 1
+ is_method_def = isinstance(definition, MethodDef)
+ if is_method_def:
+ ret_type = definition.return_type.to_rst(state)
- if to_skip > indent_level:
- print_error(
- "{}.xml: Four spaces should be used for indentation within [{}].".format(
- state.current_class, code_type
- ),
- state,
+ qualifiers = None
+ if is_method_def or isinstance(definition, AnnotationDef):
+ qualifiers = definition.qualifiers
+
+ out = ""
+
+ if is_method_def and ref_type != "":
+ if ref_type == "operator":
+ out += ":ref:`{0}<class_{1}_{2}_{3}_{4}>` ".format(
+ definition.name.replace("<", "\\<"), # So operator "<" gets correctly displayed.
+ class_def.name,
+ ref_type,
+ sanitize_operator_name(definition.name, state),
+ definition.return_type.type_name,
)
+ else:
+ out += ":ref:`{0}<class_{1}_{2}_{0}>` ".format(definition.name, class_def.name, ref_type)
+ else:
+ out += "**{}** ".format(definition.name)
- if len(code_text[code_pos + to_skip + 1 :]) == 0:
- code_text = code_text[:code_pos] + "\n"
- code_pos += 1
+ out += "**(**"
+ for i, arg in enumerate(definition.parameters):
+ if i > 0:
+ out += ", "
else:
- code_text = code_text[:code_pos] + "\n " + code_text[code_pos + to_skip + 1 :]
- code_pos += 5 - to_skip
- return ("\n[" + code_type + "]" + code_text + post_text, len("\n[" + code_type + "]" + code_text))
+ out += " "
+
+ out += "{} {}".format(arg.type_name.to_rst(state), arg.name)
+
+ if arg.default_value is not None:
+ out += "=" + arg.default_value
+
+ if qualifiers is not None and "vararg" in qualifiers:
+ if len(definition.parameters) > 0:
+ out += ", ..."
+ else:
+ out += " ..."
+
+ out += " **)**"
+
+ if qualifiers is not None:
+ # Use substitutions for abbreviations. This is used to display tooltips on hover.
+ # See `make_footer()` for descriptions.
+ for qualifier in qualifiers.split():
+ out += " |" + qualifier + "|"
+
+ return ret_type, out
+
+
+def make_heading(title: str, underline: str, l10n: bool = True) -> str:
+ if l10n:
+ new_title = translate(title)
+ if new_title != title:
+ title = new_title
+ underline *= 2 # Double length to handle wide chars.
+ return title + "\n" + (underline * len(title)) + "\n\n"
+
+
+def make_footer() -> str:
+ # Generate reusable abbreviation substitutions.
+ # This way, we avoid bloating the generated rST with duplicate abbreviations.
+ # fmt: off
+ return (
+ ".. |virtual| replace:: :abbr:`virtual (" + translate("This method should typically be overridden by the user to have any effect.") + ")`\n"
+ ".. |const| replace:: :abbr:`const (" + translate("This method has no side effects. It doesn't modify any of the instance's member variables.") + ")`\n"
+ ".. |vararg| replace:: :abbr:`vararg (" + translate("This method accepts any number of arguments after the ones described here.") + ")`\n"
+ ".. |constructor| replace:: :abbr:`constructor (" + translate("This method is used to construct a type.") + ")`\n"
+ ".. |static| replace:: :abbr:`static (" + translate("This method doesn't need an instance to be called, so it can be called directly using the class name.") + ")`\n"
+ ".. |operator| replace:: :abbr:`operator (" + translate("This method describes a valid operator to use with this type as left-hand operand.") + ")`\n"
+ )
+ # fmt: on
+
+
+def make_link(url: str, title: str) -> str:
+ match = GODOT_DOCS_PATTERN.search(url)
+ if match:
+ groups = match.groups()
+ if match.lastindex == 2:
+ # Doc reference with fragment identifier: emit direct link to section with reference to page, for example:
+ # `#calling-javascript-from-script in Exporting For Web`
+ # Or use the title if provided.
+ if title != "":
+ return "`" + title + " <../" + groups[0] + ".html" + groups[1] + ">`__"
+ return "`" + groups[1] + " <../" + groups[0] + ".html" + groups[1] + ">`__ in :doc:`../" + groups[0] + "`"
+ elif match.lastindex == 1:
+ # Doc reference, for example:
+ # `Math`
+ if title != "":
+ return ":doc:`" + title + " <../" + groups[0] + ">`"
+ return ":doc:`../" + groups[0] + "`"
+
+ # External link, for example:
+ # `http://enet.bespin.org/usergroup0.html`
+ if title != "":
+ return "`" + title + " <" + url + ">`__"
+ return "`" + url + " <" + url + ">`__"
+
+
+# Formatting helpers.
+
+
+RESERVED_FORMATTING_TAGS = ["i", "b", "u", "code", "kbd", "center", "url", "br"]
+RESERVED_CODEBLOCK_TAGS = ["codeblocks", "codeblock", "gdscript", "csharp"]
+RESERVED_CROSSLINK_TAGS = ["method", "member", "signal", "constant", "enum", "annotation", "theme_item", "param"]
-def rstize_text(
+def is_in_tagset(tag_text: str, tagset: List[str]) -> bool:
+ for tag in tagset:
+ # Complete match.
+ if tag_text == tag:
+ return True
+ # Tag with arguments.
+ if tag_text.startswith(tag + " "):
+ return True
+ # Tag with arguments, special case for [url].
+ if tag_text.startswith(tag + "="):
+ return True
+
+ return False
+
+
+def format_text_block(
text: str,
- context: Union[ClassDef, SignalDef, ConstantDef, AnnotationDef, PropertyDef, MethodDef, ThemeItemDef, None],
+ context: Union[DefinitionBase, None],
state: State,
) -> str:
# Linebreak + tabs in the XML should become two line breaks unless in a "codeblock"
@@ -1092,8 +1220,12 @@ def rstize_text(
next_brac_pos = text.find("[")
text = escape_rst(text, next_brac_pos)
+ context_name = format_context_name(context)
+
# Handle [tags]
inside_code = False
+ inside_code_tag = ""
+ inside_code_tabs = False
pos = 0
tag_depth = 0
while True:
@@ -1112,240 +1244,337 @@ def rstize_text(
escape_pre = False
escape_post = False
+ # Tag is a reference to a class.
if tag_text in state.classes:
if tag_text == state.current_class:
- # We don't want references to the same class
+ # Don't create a link to the same class, format it as inline code.
tag_text = "``{}``".format(tag_text)
else:
tag_text = make_type(tag_text, state)
escape_pre = True
escape_post = True
- else: # command
+
+ # Tag is a cross-reference or a formating directive.
+ else:
cmd = tag_text
space_pos = tag_text.find(" ")
- if cmd == "/codeblock" or cmd == "/gdscript" or cmd == "/csharp":
- tag_text = ""
- tag_depth -= 1
- inside_code = False
- # Strip newline if the tag was alone on one
- if pre_text[-1] == "\n":
- pre_text = pre_text[:-1]
- elif cmd == "/code":
- tag_text = "``"
- tag_depth -= 1
- inside_code = False
- escape_post = True
- elif inside_code:
- tag_text = "[" + tag_text + "]"
- elif cmd.find("html") == 0:
- param = tag_text[space_pos + 1 :]
- tag_text = param
- elif (
- cmd.startswith("method")
- or cmd.startswith("member")
- or cmd.startswith("signal")
- or cmd.startswith("constant")
- or cmd.startswith("theme_item")
- ):
- param = tag_text[space_pos + 1 :]
-
- if param.find(".") != -1:
- ss = param.split(".")
- if len(ss) > 2:
- print_error('{}.xml: Bad reference: "{}".'.format(state.current_class, param), state)
- class_param, method_param = ss
+ # Anything identified as a tag inside of a code block is valid,
+ # unless it's a matching closing tag.
+ if inside_code:
+ # Exiting codeblocks and inline code tags.
+
+ if inside_code_tag == cmd[1:]:
+ if cmd == "/codeblock" or cmd == "/gdscript" or cmd == "/csharp":
+ tag_text = ""
+ tag_depth -= 1
+ inside_code = False
+ # Strip newline if the tag was alone on one
+ if pre_text[-1] == "\n":
+ pre_text = pre_text[:-1]
+
+ elif cmd == "/code":
+ tag_text = "``"
+ tag_depth -= 1
+ inside_code = False
+ escape_post = True
else:
- class_param = state.current_class
- method_param = param
-
- ref_type = ""
- if class_param in state.classes:
- class_def = state.classes[class_param]
- if cmd.startswith("constructor"):
- if method_param not in class_def.constructors:
- print_error(
- '{}.xml: Unresolved constructor "{}".'.format(state.current_class, param), state
- )
- ref_type = "_constructor"
-
- elif cmd.startswith("method"):
- if method_param not in class_def.methods:
- print_error('{}.xml: Unresolved method "{}".'.format(state.current_class, param), state)
- ref_type = "_method"
-
- elif cmd.startswith("operator"):
- if method_param not in class_def.operators:
- print_error('{}.xml: Unresolved operator "{}".'.format(state.current_class, param), state)
- ref_type = "_operator"
-
- elif cmd.startswith("member"):
- if method_param not in class_def.properties:
- print_error('{}.xml: Unresolved member "{}".'.format(state.current_class, param), state)
- ref_type = "_property"
-
- elif cmd.startswith("theme_item"):
- if method_param not in class_def.theme_items:
- print_error('{}.xml: Unresolved theme item "{}".'.format(state.current_class, param), state)
- ref_type = "_theme_{}".format(class_def.theme_items[method_param].data_name)
-
- elif cmd.startswith("signal"):
- if method_param not in class_def.signals:
- print_error('{}.xml: Unresolved signal "{}".'.format(state.current_class, param), state)
- ref_type = "_signal"
-
- elif cmd.startswith("annotation"):
- if method_param not in class_def.annotations:
- print_error('{}.xml: Unresolved annotation "{}".'.format(state.current_class, param), state)
- ref_type = "_annotation"
-
- elif cmd.startswith("constant"):
- found = False
-
- # Search in the current class
- search_class_defs = [class_def]
-
- if param.find(".") == -1:
- # Also search in @GlobalScope as a last resort if no class was specified
- search_class_defs.append(state.classes["@GlobalScope"])
-
- for search_class_def in search_class_defs:
- if method_param in search_class_def.constants:
- class_param = search_class_def.name
- found = True
-
- else:
- for enum in search_class_def.enums.values():
- if method_param in enum.values:
- class_param = search_class_def.name
- found = True
- break
+ if cmd.startswith("/"):
+ print_warning(
+ '{}.xml: Potential error inside of a code tag, found a string that looks like a closing tag "[{}]" in {}.'.format(
+ state.current_class, cmd, context_name
+ ),
+ state,
+ )
+
+ tag_text = "[" + tag_text + "]"
+
+ # Entering codeblocks and inline code tags.
+
+ elif cmd == "codeblocks":
+ tag_depth += 1
+ tag_text = "\n.. tabs::"
+ inside_code_tabs = True
+ elif cmd == "/codeblocks":
+ tag_depth -= 1
+ tag_text = ""
+ inside_code_tabs = False
- if not found:
- print_error('{}.xml: Unresolved constant "{}".'.format(state.current_class, param), state)
- ref_type = "_constant"
+ elif cmd == "codeblock" or cmd == "gdscript" or cmd == "csharp":
+ tag_depth += 1
+ if cmd == "gdscript":
+ if not inside_code_tabs:
+ print_error(
+ "{}.xml: GDScript code block is used outside of [codeblocks] in {}.".format(
+ state.current_class, cmd, context_name
+ ),
+ state,
+ )
+ tag_text = "\n .. code-tab:: gdscript\n"
+ elif cmd == "csharp":
+ if not inside_code_tabs:
+ print_error(
+ "{}.xml: C# code block is used outside of [codeblocks] in {}.".format(
+ state.current_class, cmd, context_name
+ ),
+ state,
+ )
+ tag_text = "\n .. code-tab:: csharp\n"
else:
- print_error(
- '{}.xml: Unresolved type reference "{}" in method reference "{}".'.format(
- state.current_class, class_param, param
- ),
- state,
- )
+ tag_text = "\n::\n"
+
+ inside_code = True
+ inside_code_tag = cmd
- repl_text = method_param
- if class_param != state.current_class:
- repl_text = "{}.{}".format(class_param, method_param)
- tag_text = ":ref:`{}<class_{}{}_{}>`".format(repl_text, class_param, ref_type, method_param)
+ elif cmd == "code":
+ tag_text = "``"
+ tag_depth += 1
+ inside_code = True
+ inside_code_tag = cmd
escape_pre = True
- escape_post = True
- elif cmd.startswith("param"):
- param_name: str = ""
- if space_pos >= 0:
- param_name = tag_text[space_pos + 1 :].strip()
- if param_name == "":
- context_name: str = "unknown context"
- if context is not None:
- context_name = '{} "{}" description'.format(context.definition_name, context.name)
+ # Cross-references to items in this or other class documentation pages.
+ elif is_in_tagset(cmd, RESERVED_CROSSLINK_TAGS):
+ link_target: str = ""
+ if space_pos >= 0:
+ link_target = tag_text[space_pos + 1 :].strip()
+ if link_target == "":
print_error(
- "{}.xml: Empty argument reference in {}.".format(state.current_class, context_name),
+ '{}.xml: Empty cross-reference link "{}" in {}.'.format(state.current_class, cmd, context_name),
state,
)
+ tag_text = ""
else:
- valid_context = (
- isinstance(context, MethodDef)
- or isinstance(context, SignalDef)
- or isinstance(context, AnnotationDef)
- )
- if not valid_context:
- context_name: str = "unknown context"
- if context is not None:
- context_name = '{} "{}" description'.format(context.definition_name, context.name)
+ if (
+ cmd.startswith("method")
+ or cmd.startswith("member")
+ or cmd.startswith("signal")
+ or cmd.startswith("constant")
+ or cmd.startswith("annotation")
+ or cmd.startswith("theme_item")
+ ):
+ if link_target.find(".") != -1:
+ ss = link_target.split(".")
+ if len(ss) > 2:
+ print_error(
+ '{}.xml: Bad reference "{}" in {}.'.format(
+ state.current_class, link_target, context_name
+ ),
+ state,
+ )
+ class_param, method_param = ss
+
+ else:
+ class_param = state.current_class
+ method_param = link_target
+
+ ref_type = ""
+ if class_param in state.classes:
+ class_def = state.classes[class_param]
+ if cmd.startswith("constructor"):
+ if method_param not in class_def.constructors:
+ print_error(
+ '{}.xml: Unresolved constructor reference "{}" in {}.'.format(
+ state.current_class, link_target, context_name
+ ),
+ state,
+ )
+ ref_type = "_constructor"
+
+ elif cmd.startswith("method"):
+ if method_param not in class_def.methods:
+ print_error(
+ '{}.xml: Unresolved method reference "{}" in {}.'.format(
+ state.current_class, link_target, context_name
+ ),
+ state,
+ )
+ ref_type = "_method"
+
+ elif cmd.startswith("operator"):
+ if method_param not in class_def.operators:
+ print_error(
+ '{}.xml: Unresolved operator reference "{}" in {}.'.format(
+ state.current_class, link_target, context_name
+ ),
+ state,
+ )
+ ref_type = "_operator"
+
+ elif cmd.startswith("member"):
+ if method_param not in class_def.properties:
+ print_error(
+ '{}.xml: Unresolved member reference "{}" in {}.'.format(
+ state.current_class, link_target, context_name
+ ),
+ state,
+ )
+ ref_type = "_property"
+
+ elif cmd.startswith("theme_item"):
+ if method_param not in class_def.theme_items:
+ print_error(
+ '{}.xml: Unresolved theme item reference "{}" in {}.'.format(
+ state.current_class, link_target, context_name
+ ),
+ state,
+ )
+ ref_type = "_theme_{}".format(class_def.theme_items[method_param].data_name)
+
+ elif cmd.startswith("signal"):
+ if method_param not in class_def.signals:
+ print_error(
+ '{}.xml: Unresolved signal reference "{}" in {}.'.format(
+ state.current_class, link_target, context_name
+ ),
+ state,
+ )
+ ref_type = "_signal"
+
+ elif cmd.startswith("annotation"):
+ if method_param not in class_def.annotations:
+ print_error(
+ '{}.xml: Unresolved annotation reference "{}" in {}.'.format(
+ state.current_class, link_target, context_name
+ ),
+ state,
+ )
+ ref_type = "_annotation"
+
+ elif cmd.startswith("constant"):
+ found = False
+
+ # Search in the current class
+ search_class_defs = [class_def]
+
+ if link_target.find(".") == -1:
+ # Also search in @GlobalScope as a last resort if no class was specified
+ search_class_defs.append(state.classes["@GlobalScope"])
+
+ for search_class_def in search_class_defs:
+ if method_param in search_class_def.constants:
+ class_param = search_class_def.name
+ found = True
- print_error(
- '{}.xml: Argument reference "{}" used outside of method, signal, or annotation context in {}.'.format(
- state.current_class, param_name, context_name
- ),
- state,
+ else:
+ for enum in search_class_def.enums.values():
+ if method_param in enum.values:
+ class_param = search_class_def.name
+ found = True
+ break
+
+ if not found:
+ print_error(
+ '{}.xml: Unresolved constant reference "{}" in {}.'.format(
+ state.current_class, link_target, context_name
+ ),
+ state,
+ )
+ ref_type = "_constant"
+
+ else:
+ print_error(
+ '{}.xml: Unresolved type reference "{}" in method reference "{}" in {}.'.format(
+ state.current_class, class_param, link_target, context_name
+ ),
+ state,
+ )
+
+ repl_text = method_param
+ if class_param != state.current_class:
+ repl_text = "{}.{}".format(class_param, method_param)
+ tag_text = ":ref:`{}<class_{}{}_{}>`".format(repl_text, class_param, ref_type, method_param)
+ escape_pre = True
+ escape_post = True
+
+ elif cmd.startswith("enum"):
+ tag_text = make_enum(link_target, state)
+ escape_pre = True
+ escape_post = True
+
+ elif cmd.startswith("param"):
+ valid_context = (
+ isinstance(context, MethodDef)
+ or isinstance(context, SignalDef)
+ or isinstance(context, AnnotationDef)
)
- else:
- context_params: List[ParameterDef] = context.parameters
- found = False
- for param_def in context_params:
- if param_def.name == param_name:
- found = True
- break
- if not found:
+ if not valid_context:
print_error(
- '{}.xml: Unresolved argument reference "{}" in {} "{}" description.'.format(
- state.current_class, param_name, context.definition_name, context.name
+ '{}.xml: Argument reference "{}" used outside of method, signal, or annotation context in {}.'.format(
+ state.current_class, link_target, context_name
),
state,
)
+ else:
+ context_params: List[ParameterDef] = context.parameters
+ found = False
+ for param_def in context_params:
+ if param_def.name == link_target:
+ found = True
+ break
+ if not found:
+ print_error(
+ '{}.xml: Unresolved argument reference "{}" in {}.'.format(
+ state.current_class, link_target, context_name
+ ),
+ state,
+ )
+
+ tag_text = "``{}``".format(link_target)
+
+ # Formatting directives.
+
+ elif is_in_tagset(cmd, ["url"]):
+ if cmd.startswith("url="):
+ # URLs are handled in full here as we need to extract the optional link
+ # title to use `make_link`.
+ link_url = cmd[4:]
+ endurl_pos = text.find("[/url]", endq_pos + 1)
+ if endurl_pos == -1:
+ print_error(
+ "{}.xml: Tag depth mismatch for [url]: no closing [/url] in {}.".format(
+ state.current_class, context_name
+ ),
+ state,
+ )
+ break
+ link_title = text[endq_pos + 1 : endurl_pos]
+ tag_text = make_link(link_url, link_title)
- if param_name == "":
- tag_text = ""
+ pre_text = text[:pos]
+ post_text = text[endurl_pos + 6 :]
+
+ if pre_text and pre_text[-1] not in MARKUP_ALLOWED_PRECEDENT:
+ pre_text += "\ "
+ if post_text and post_text[0] not in MARKUP_ALLOWED_SUBSEQUENT:
+ post_text = "\ " + post_text
+
+ text = pre_text + tag_text + post_text
+ pos = len(pre_text) + len(tag_text)
+ continue
else:
- tag_text = "``{}``".format(param_name)
- elif cmd.find("image=") == 0:
- tag_text = "" # '![](' + cmd[6:] + ')'
- elif cmd.find("url=") == 0:
- # URLs are handled in full here as we need to extract the optional link
- # title to use `make_link`.
- link_url = cmd[4:]
- endurl_pos = text.find("[/url]", endq_pos + 1)
- if endurl_pos == -1:
print_error(
- "{}.xml: Tag depth mismatch for [url]: no closing [/url]".format(state.current_class), state
+ '{}.xml: Misformatted [url] tag "{}" in {}.'.format(state.current_class, cmd, context_name),
+ state,
)
- break
- link_title = text[endq_pos + 1 : endurl_pos]
- tag_text = make_link(link_url, link_title)
- pre_text = text[:pos]
- post_text = text[endurl_pos + 6 :]
-
- if pre_text and pre_text[-1] not in MARKUP_ALLOWED_PRECEDENT:
- pre_text += "\ "
- if post_text and post_text[0] not in MARKUP_ALLOWED_SUBSEQUENT:
- post_text = "\ " + post_text
-
- text = pre_text + tag_text + post_text
- pos = len(pre_text) + len(tag_text)
- continue
- elif cmd == "center":
- tag_depth += 1
- tag_text = ""
- elif cmd == "/center":
- tag_depth -= 1
- tag_text = ""
- elif cmd == "codeblock":
- tag_depth += 1
- tag_text = "\n::\n"
- inside_code = True
- elif cmd == "gdscript":
- tag_depth += 1
- tag_text = "\n .. code-tab:: gdscript\n"
- inside_code = True
- elif cmd == "csharp":
- tag_depth += 1
- tag_text = "\n .. code-tab:: csharp\n"
- inside_code = True
- elif cmd == "codeblocks":
- tag_depth += 1
- tag_text = "\n.. tabs::"
- elif cmd == "/codeblocks":
- tag_depth -= 1
- tag_text = ""
elif cmd == "br":
# Make a new paragraph instead of a linebreak, rst is not so linebreak friendly
tag_text = "\n\n"
# Strip potential leading spaces
while post_text[0] == " ":
post_text = post_text[1:]
+
+ elif cmd == "center" or cmd == "/center":
+ if cmd == "/center":
+ tag_depth -= 1
+ else:
+ tag_depth += 1
+ tag_text = ""
+
elif cmd == "i" or cmd == "/i":
if cmd == "/i":
tag_depth -= 1
@@ -1354,6 +1583,7 @@ def rstize_text(
tag_depth += 1
escape_pre = True
tag_text = "*"
+
elif cmd == "b" or cmd == "/b":
if cmd == "/b":
tag_depth -= 1
@@ -1362,6 +1592,7 @@ def rstize_text(
tag_depth += 1
escape_pre = True
tag_text = "**"
+
elif cmd == "u" or cmd == "/u":
if cmd == "/u":
tag_depth -= 1
@@ -1370,25 +1601,31 @@ def rstize_text(
tag_depth += 1
escape_pre = True
tag_text = ""
- elif cmd == "code":
- tag_text = "``"
- tag_depth += 1
- inside_code = True
- escape_pre = True
- elif cmd == "kbd":
- tag_text = ":kbd:`"
- tag_depth += 1
- escape_pre = True
- elif cmd == "/kbd":
+
+ elif cmd == "kbd" or cmd == "/kbd":
tag_text = "`"
- tag_depth -= 1
- escape_post = True
- elif cmd.startswith("enum "):
- tag_text = make_enum(cmd[5:], state)
- escape_pre = True
- escape_post = True
+ if cmd == "/kbd":
+ tag_depth -= 1
+ escape_post = True
+ else:
+ tag_text = ":kbd:" + tag_text
+ tag_depth += 1
+ escape_pre = True
+
+ # Invalid syntax checks.
+ elif cmd.startswith("/"):
+ print_error(
+ '{}.xml: Unrecognized closing tag "{}" in {}.'.format(state.current_class, cmd, context_name), state
+ )
+
+ tag_text = "[" + tag_text + "]"
+
else:
- tag_text = make_type(tag_text, state)
+ print_error(
+ '{}.xml: Unrecognized opening tag "{}" in {}.'.format(state.current_class, cmd, context_name), state
+ )
+
+ tag_text = "``{}``".format(tag_text)
escape_pre = True
escape_post = True
@@ -1423,12 +1660,94 @@ def rstize_text(
if tag_depth > 0:
print_error(
- "{}.xml: Tag depth mismatch: too many (or too little) open/close tags.".format(state.current_class), state
+ "{}.xml: Tag depth mismatch: too many (or too little) open/close tags in {}.".format(
+ state.current_class, context_name
+ ),
+ state,
)
return text
+def format_context_name(context: Union[DefinitionBase, None]) -> str:
+ context_name: str = "unknown context"
+ if context is not None:
+ context_name = '{} "{}" description'.format(context.definition_name, context.name)
+
+ return context_name
+
+
+def escape_rst(text: str, until_pos: int = -1) -> str:
+ # Escape \ character, otherwise it ends up as an escape character in rst
+ pos = 0
+ while True:
+ pos = text.find("\\", pos, until_pos)
+ if pos == -1:
+ break
+ text = text[:pos] + "\\\\" + text[pos + 1 :]
+ pos += 2
+
+ # Escape * character to avoid interpreting it as emphasis
+ pos = 0
+ while True:
+ pos = text.find("*", pos, until_pos)
+ if pos == -1:
+ break
+ text = text[:pos] + "\*" + text[pos + 1 :]
+ pos += 2
+
+ # Escape _ character at the end of a word to avoid interpreting it as an inline hyperlink
+ pos = 0
+ while True:
+ pos = text.find("_", pos, until_pos)
+ if pos == -1:
+ break
+ if not text[pos + 1].isalnum(): # don't escape within a snake_case word
+ text = text[:pos] + "\_" + text[pos + 1 :]
+ pos += 2
+ else:
+ pos += 1
+
+ return text
+
+
+def format_codeblock(code_type: str, post_text: str, indent_level: int, state: State) -> Union[Tuple[str, int], None]:
+ end_pos = post_text.find("[/" + code_type + "]")
+ if end_pos == -1:
+ print_error("{}.xml: [" + code_type + "] without a closing tag.".format(state.current_class), state)
+ return None
+
+ code_text = post_text[len("[" + code_type + "]") : end_pos]
+ post_text = post_text[end_pos:]
+
+ # Remove extraneous tabs
+ code_pos = 0
+ while True:
+ code_pos = code_text.find("\n", code_pos)
+ if code_pos == -1:
+ break
+
+ to_skip = 0
+ while code_pos + to_skip + 1 < len(code_text) and code_text[code_pos + to_skip + 1] == "\t":
+ to_skip += 1
+
+ if to_skip > indent_level:
+ print_error(
+ "{}.xml: Four spaces should be used for indentation within [{}].".format(
+ state.current_class, code_type
+ ),
+ state,
+ )
+
+ if len(code_text[code_pos + to_skip + 1 :]) == 0:
+ code_text = code_text[:code_pos] + "\n"
+ code_pos += 1
+ else:
+ code_text = code_text[:code_pos] + "\n " + code_text[code_pos + to_skip + 1 :]
+ code_pos += 5 - to_skip
+ return ("\n[" + code_type + "]" + code_text + post_text, len("\n[" + code_type + "]" + code_text))
+
+
def format_table(f: TextIO, data: List[Tuple[Optional[str], ...]], remove_empty_columns: bool = False) -> None:
if len(data) == 0:
return
@@ -1460,150 +1779,6 @@ def format_table(f: TextIO, data: List[Tuple[Optional[str], ...]], remove_empty_
f.write("\n")
-def make_type(klass: str, state: State) -> str:
- if klass.find("*") != -1: # Pointer, ignore
- return klass
- link_type = klass
- if link_type.endswith("[]"): # Typed array, strip [] to link to contained type.
- link_type = link_type[:-2]
- if link_type in state.classes:
- return ":ref:`{}<class_{}>`".format(klass, link_type)
- print_error('{}.xml: Unresolved type "{}".'.format(state.current_class, klass), state)
- return klass
-
-
-def make_enum(t: str, state: State) -> str:
- p = t.find(".")
- if p >= 0:
- c = t[0:p]
- e = t[p + 1 :]
- # Variant enums live in GlobalScope but still use periods.
- if c == "Variant":
- c = "@GlobalScope"
- e = "Variant." + e
- else:
- c = state.current_class
- e = t
- if c in state.classes and e not in state.classes[c].enums:
- c = "@GlobalScope"
-
- if c in state.classes and e in state.classes[c].enums:
- return ":ref:`{0}<enum_{1}_{0}>`".format(e, c)
-
- # Don't fail for `Vector3.Axis`, as this enum is a special case which is expected not to be resolved.
- if "{}.{}".format(c, e) != "Vector3.Axis":
- print_error('{}.xml: Unresolved enum "{}".'.format(state.current_class, t), state)
-
- return t
-
-
-def make_method_signature(
- class_def: ClassDef, definition: Union[AnnotationDef, MethodDef, SignalDef], ref_type: str, state: State
-) -> Tuple[str, str]:
- ret_type = ""
-
- is_method_def = isinstance(definition, MethodDef)
- if is_method_def:
- ret_type = definition.return_type.to_rst(state)
-
- qualifiers = None
- if is_method_def or isinstance(definition, AnnotationDef):
- qualifiers = definition.qualifiers
-
- out = ""
-
- if is_method_def and ref_type != "":
- if ref_type == "operator":
- out += ":ref:`{0}<class_{1}_{2}_{3}_{4}>` ".format(
- definition.name.replace("<", "\\<"), # So operator "<" gets correctly displayed.
- class_def.name,
- ref_type,
- sanitize_operator_name(definition.name, state),
- definition.return_type.type_name,
- )
- else:
- out += ":ref:`{0}<class_{1}_{2}_{0}>` ".format(definition.name, class_def.name, ref_type)
- else:
- out += "**{}** ".format(definition.name)
-
- out += "**(**"
- for i, arg in enumerate(definition.parameters):
- if i > 0:
- out += ", "
- else:
- out += " "
-
- out += "{} {}".format(arg.type_name.to_rst(state), arg.name)
-
- if arg.default_value is not None:
- out += "=" + arg.default_value
-
- if qualifiers is not None and "vararg" in qualifiers:
- if len(definition.parameters) > 0:
- out += ", ..."
- else:
- out += " ..."
-
- out += " **)**"
-
- if qualifiers is not None:
- # Use substitutions for abbreviations. This is used to display tooltips on hover.
- # See `make_footer()` for descriptions.
- for qualifier in qualifiers.split():
- out += " |" + qualifier + "|"
-
- return ret_type, out
-
-
-def make_heading(title: str, underline: str, l10n: bool = True) -> str:
- if l10n:
- new_title = translate(title)
- if new_title != title:
- title = new_title
- underline *= 2 # Double length to handle wide chars.
- return title + "\n" + (underline * len(title)) + "\n\n"
-
-
-def make_footer() -> str:
- # Generate reusable abbreviation substitutions.
- # This way, we avoid bloating the generated rST with duplicate abbreviations.
- # fmt: off
- return (
- ".. |virtual| replace:: :abbr:`virtual (" + translate("This method should typically be overridden by the user to have any effect.") + ")`\n"
- ".. |const| replace:: :abbr:`const (" + translate("This method has no side effects. It doesn't modify any of the instance's member variables.") + ")`\n"
- ".. |vararg| replace:: :abbr:`vararg (" + translate("This method accepts any number of arguments after the ones described here.") + ")`\n"
- ".. |constructor| replace:: :abbr:`constructor (" + translate("This method is used to construct a type.") + ")`\n"
- ".. |static| replace:: :abbr:`static (" + translate("This method doesn't need an instance to be called, so it can be called directly using the class name.") + ")`\n"
- ".. |operator| replace:: :abbr:`operator (" + translate("This method describes a valid operator to use with this type as left-hand operand.") + ")`\n"
- )
- # fmt: on
-
-
-def make_link(url: str, title: str) -> str:
- match = GODOT_DOCS_PATTERN.search(url)
- if match:
- groups = match.groups()
- if match.lastindex == 2:
- # Doc reference with fragment identifier: emit direct link to section with reference to page, for example:
- # `#calling-javascript-from-script in Exporting For Web`
- # Or use the title if provided.
- if title != "":
- return "`" + title + " <../" + groups[0] + ".html" + groups[1] + ">`__"
- return "`" + groups[1] + " <../" + groups[0] + ".html" + groups[1] + ">`__ in :doc:`../" + groups[0] + "`"
- elif match.lastindex == 1:
- # Doc reference, for example:
- # `Math`
- if title != "":
- return ":doc:`" + title + " <../" + groups[0] + ">`"
- return ":doc:`../" + groups[0] + "`"
-
- # External link, for example:
- # `http://enet.bespin.org/usergroup0.html`
- if title != "":
- return "`" + title + " <" + url + ">`__"
- return "`" + url + " <" + url + ">`__"
-
-
def sanitize_operator_name(dirty_name: str, state: State) -> str:
clear_name = dirty_name.replace("operator ", "")
diff --git a/drivers/gles3/storage/mesh_storage.cpp b/drivers/gles3/storage/mesh_storage.cpp
index 667ba4f5e6..dee715150b 100644
--- a/drivers/gles3/storage/mesh_storage.cpp
+++ b/drivers/gles3/storage/mesh_storage.cpp
@@ -255,7 +255,10 @@ void MeshStorage::mesh_add_surface(RID p_mesh, const RS::SurfaceData &p_surface)
mesh->bone_aabbs.resize(p_surface.bone_aabbs.size());
}
for (int i = 0; i < p_surface.bone_aabbs.size(); i++) {
- mesh->bone_aabbs.write[i].merge_with(p_surface.bone_aabbs[i]);
+ const AABB &bone = p_surface.bone_aabbs[i];
+ if (!bone.has_no_volume()) {
+ mesh->bone_aabbs.write[i].merge_with(bone);
+ }
}
mesh->aabb.merge_with(p_surface.aabb);
}
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index cef0af30ee..232cda48fc 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -1942,6 +1942,21 @@ void EditorNode::_dialog_action(String p_file) {
}
} break;
+ case FILE_SAVE_AND_RUN_MAIN_SCENE: {
+ ProjectSettings::get_singleton()->set("application/run/main_scene", p_file);
+ ProjectSettings::get_singleton()->save();
+
+ if (file->get_file_mode() == EditorFileDialog::FILE_MODE_SAVE_FILE) {
+ _save_default_environment();
+ _save_scene_with_preview(p_file);
+ if ((bool)pick_main_scene->get_meta("from_native", false)) {
+ run_native->resume_run_native();
+ } else {
+ _run(false, p_file);
+ }
+ }
+ } break;
+
case FILE_EXPORT_MESH_LIBRARY: {
Ref<MeshLibrary> ml;
if (file_export_lib_merge->is_pressed() && FileAccess::exists(p_file)) {
@@ -2396,10 +2411,8 @@ void EditorNode::_run(bool p_current, const String &p_custom) {
}
if (scene->get_scene_file_path().is_empty()) {
- current_menu_option = -1;
- _menu_option(FILE_SAVE_AS_SCENE);
- // Set the option to save and run so when the dialog is accepted, the scene runs.
current_menu_option = FILE_SAVE_AND_RUN;
+ _menu_option_confirm(FILE_SAVE_AS_SCENE, true);
file->set_title(TTR("Save scene before running..."));
return;
}
@@ -2414,6 +2427,7 @@ void EditorNode::_run(bool p_current, const String &p_custom) {
if (!ensure_main_scene(false)) {
return;
}
+ run_filename = GLOBAL_DEF_BASIC("application/run/main_scene", "");
}
if (bool(EDITOR_GET("run/auto_save/save_before_running"))) {
@@ -4102,8 +4116,15 @@ void EditorNode::_pick_main_scene_custom_action(const String &p_custom_action_na
}
pick_main_scene->hide();
- current_menu_option = SETTINGS_PICK_MAIN_SCENE;
- _dialog_action(scene->get_scene_file_path());
+
+ if (!FileAccess::exists(scene->get_scene_file_path())) {
+ current_menu_option = FILE_SAVE_AND_RUN_MAIN_SCENE;
+ _menu_option_confirm(FILE_SAVE_AS_SCENE, true);
+ file->set_title(TTR("Save scene before running..."));
+ } else {
+ current_menu_option = SETTINGS_PICK_MAIN_SCENE;
+ _dialog_action(scene->get_scene_file_path());
+ }
}
}
diff --git a/editor/editor_node.h b/editor/editor_node.h
index 0201e84eaf..771eaf6a68 100644
--- a/editor/editor_node.h
+++ b/editor/editor_node.h
@@ -141,6 +141,7 @@ private:
FILE_SAVE_AS_SCENE,
FILE_SAVE_ALL_SCENES,
FILE_SAVE_AND_RUN,
+ FILE_SAVE_AND_RUN_MAIN_SCENE,
FILE_SHOW_IN_FILESYSTEM,
FILE_EXPORT_PROJECT,
FILE_EXPORT_MESH_LIBRARY,
diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp
index 566c22f5a9..400ad1ebac 100644
--- a/editor/editor_plugin.cpp
+++ b/editor/editor_plugin.cpp
@@ -445,7 +445,7 @@ void EditorPlugin::add_control_to_container(CustomControlContainer p_location, C
CanvasItemEditor::get_singleton()->get_bottom_split()->add_child(p_control);
} break;
- case CONTAINER_PROPERTY_EDITOR_BOTTOM: {
+ case CONTAINER_INSPECTOR_BOTTOM: {
InspectorDock::get_singleton()->get_addon_area()->add_child(p_control);
} break;
@@ -498,7 +498,7 @@ void EditorPlugin::remove_control_from_container(CustomControlContainer p_locati
CanvasItemEditor::get_singleton()->get_bottom_split()->remove_child(p_control);
} break;
- case CONTAINER_PROPERTY_EDITOR_BOTTOM: {
+ case CONTAINER_INSPECTOR_BOTTOM: {
InspectorDock::get_singleton()->get_addon_area()->remove_child(p_control);
} break;
@@ -950,7 +950,7 @@ void EditorPlugin::_bind_methods() {
BIND_ENUM_CONSTANT(CONTAINER_CANVAS_EDITOR_SIDE_LEFT);
BIND_ENUM_CONSTANT(CONTAINER_CANVAS_EDITOR_SIDE_RIGHT);
BIND_ENUM_CONSTANT(CONTAINER_CANVAS_EDITOR_BOTTOM);
- BIND_ENUM_CONSTANT(CONTAINER_PROPERTY_EDITOR_BOTTOM);
+ BIND_ENUM_CONSTANT(CONTAINER_INSPECTOR_BOTTOM);
BIND_ENUM_CONSTANT(CONTAINER_PROJECT_SETTING_TAB_LEFT);
BIND_ENUM_CONSTANT(CONTAINER_PROJECT_SETTING_TAB_RIGHT);
diff --git a/editor/editor_plugin.h b/editor/editor_plugin.h
index 84c63d1021..3f9d276b6a 100644
--- a/editor/editor_plugin.h
+++ b/editor/editor_plugin.h
@@ -184,7 +184,7 @@ public:
CONTAINER_CANVAS_EDITOR_SIDE_LEFT,
CONTAINER_CANVAS_EDITOR_SIDE_RIGHT,
CONTAINER_CANVAS_EDITOR_BOTTOM,
- CONTAINER_PROPERTY_EDITOR_BOTTOM,
+ CONTAINER_INSPECTOR_BOTTOM,
CONTAINER_PROJECT_SETTING_TAB_LEFT,
CONTAINER_PROJECT_SETTING_TAB_RIGHT,
};
diff --git a/editor/icons/DefaultProjectIcon.svg b/editor/icons/DefaultProjectIcon.svg
index f81ba4d390..adc26df6c2 100644
--- a/editor/icons/DefaultProjectIcon.svg
+++ b/editor/icons/DefaultProjectIcon.svg
@@ -1 +1 @@
-<svg height="64" viewBox="0 0 64 64" width="64" xmlns="http://www.w3.org/2000/svg"><g stroke-linejoin="round"><path d="m8 0c-4.432 0-8 3.568-8 8v48c0 4.432 3.568 8 8 8h48c4.432 0 8-3.568 8-8v-48c0-4.432-3.568-8-8-8z" fill="#355570" stroke-linecap="round" stroke-width="2"/><path d="m8 0c-4.432 0-8 3.568-8 8v48c0 4.432 3.568 8 8 8h48c4.432 0 8-3.568 8-8v-48c0-4.432-3.568-8-8-8zm0 2h48c3.324 0 6 2.676 6 6v48c0 3.324-2.676 6-6 6h-48c-3.324 0-6-2.676-6-6v-48c0-3.324 2.676-6 6-6z" fill-opacity=".19608" stroke-linecap="round" stroke-width="2"/><path d="m27.254 10c-2.1314.47383-4.2401 1.134-6.2168 2.1289.04521 1.7455.15796 3.4164.38672 5.1152-.76768.4919-1.574.91443-2.291 1.4902-.72854.5604-1.4731 1.0965-2.1328 1.752-1.3179-.8716-2.7115-1.691-4.1484-2.4141-1.549 1.667-2.9985 3.4672-4.1816 5.4805.89011 1.4399 1.8209 2.7894 2.8242 4.0703h.027343v9.9453 1.2617 1.1504l-.009765 1.6309h-.001953c.0031.7321.011718 1.5356.011718 1.6953 0 7.1942 9.1264 10.652 20.465 10.691h.013672.013672c11.338-.04 20.461-3.4972 20.461-10.691 0-.1626.010282-.96271.013672-1.6953h-.001953l-.011719-1.6309v-.98633l.003907-.001953v-11.369h.027343c1.0035-1.2809 1.9337-2.6304 2.8242-4.0703-1.1827-2.0133-2.6327-3.8135-4.1816-5.4805-1.4366.7231-2.8325 1.5425-4.1504 2.4141-.65947-.6555-1.4013-1.1916-2.1309-1.752-.71682-.5758-1.5248-.99833-2.291-1.4902.22813-1.6988.3413-3.3697.38672-5.1152-1.977-.99494-4.0863-1.6551-6.2188-2.1289-.85139 1.4309-1.6285 2.9812-2.3066 4.4961-.80409-.1344-1.613-.18571-2.4219-.19531h-.015625-.015625c-.81037.01-1.6176.060513-2.4219.19531-.67768-1.5149-1.4559-3.0652-2.3086-4.4961z" fill="#fff" stroke="#fff" stroke-width="3"/></g><g stroke-width=".32031" transform="matrix(.050279 0 0 .050279 6.2574 1.18)"><path d="m0 0s-.325 1.994-.515 1.976l-36.182-3.491c-2.879-.278-5.115-2.574-5.317-5.459l-.994-14.247-27.992-1.997-1.904 12.912c-.424 2.872-2.932 5.037-5.835 5.037h-38.188c-2.902 0-5.41-2.165-5.834-5.037l-1.905-12.912-27.992 1.997-.994 14.247c-.202 2.886-2.438 5.182-5.317 5.46l-36.2 3.49c-.187.018-.324-1.978-.511-1.978l-.049-7.83 30.658-4.944 1.004-14.374c.203-2.91 2.551-5.263 5.463-5.472l38.551-2.75c.146-.01.29-.016.434-.016 2.897 0 5.401 2.166 5.825 5.038l1.959 13.286h28.005l1.959-13.286c.423-2.871 2.93-5.037 5.831-5.037.142 0 .284.005.423.015l38.556 2.75c2.911.209 5.26 2.562 5.463 5.472l1.003 14.374 30.645 4.966z" fill="#fff" transform="matrix(4.1626 0 0 -4.1626 919.24 771.67)"/><path d="m0 0v-59.041c.108-.001.216-.005.323-.015l36.196-3.49c1.896-.183 3.382-1.709 3.514-3.609l1.116-15.978 31.574-2.253 2.175 14.747c.282 1.912 1.922 3.329 3.856 3.329h38.188c1.933 0 3.573-1.417 3.855-3.329l2.175-14.747 31.575 2.253 1.115 15.978c.133 1.9 1.618 3.425 3.514 3.609l36.182 3.49c.107.01.214.014.322.015v4.711l.015.005v54.325h.134c4.795 6.12 9.232 12.569 13.487 19.449-5.651 9.62-12.575 18.217-19.976 26.182-6.864-3.455-13.531-7.369-19.828-11.534-3.151 3.132-6.7 5.694-10.186 8.372-3.425 2.751-7.285 4.768-10.946 7.118 1.09 8.117 1.629 16.108 1.846 24.448-9.446 4.754-19.519 7.906-29.708 10.17-4.068-6.837-7.788-14.241-11.028-21.479-3.842.642-7.702.88-11.567.926v.006c-.027 0-.052-.006-.075-.006-.024 0-.049.006-.073.006v-.006c-3.872-.046-7.729-.284-11.572-.926-3.238 7.238-6.956 14.642-11.03 21.479-10.184-2.264-20.258-5.416-29.703-10.17.216-8.34.755-16.331 1.848-24.448-3.668-2.35-7.523-4.367-10.949-7.118-3.481-2.678-7.036-5.24-10.188-8.372-6.297 4.165-12.962 8.079-19.828 11.534-7.401-7.965-14.321-16.562-19.974-26.182 4.253-6.88 8.693-13.329 13.487-19.449z" fill="#478cbf" transform="matrix(4.1626 0 0 -4.1626 104.7 525.91)"/><path d="m0 0-1.121-16.063c-.135-1.936-1.675-3.477-3.611-3.616l-38.555-2.751c-.094-.007-.188-.01-.281-.01-1.916 0-3.569 1.406-3.852 3.33l-2.211 14.994h-31.459l-2.211-14.994c-.297-2.018-2.101-3.469-4.133-3.32l-38.555 2.751c-1.936.139-3.476 1.68-3.611 3.616l-1.121 16.063-32.547 3.138c.015-3.498.06-7.33.06-8.093 0-34.374 43.605-50.896 97.781-51.086h.133c54.176.19 97.766 16.712 97.766 51.086 0 .777.047 4.593.063 8.093z" fill="#478cbf" transform="matrix(4.1626 0 0 -4.1626 784.07 817.24)"/><path d="m0 0c0-12.052-9.765-21.815-21.813-21.815-12.042 0-21.81 9.763-21.81 21.815 0 12.044 9.768 21.802 21.81 21.802 12.048 0 21.813-9.758 21.813-21.802" fill="#fff" transform="matrix(4.1626 0 0 -4.1626 389.21 625.67)"/><path d="m0 0c0-7.994-6.479-14.473-14.479-14.473-7.996 0-14.479 6.479-14.479 14.473s6.483 14.479 14.479 14.479c8 0 14.479-6.485 14.479-14.479" fill="#414042" transform="matrix(4.1626 0 0 -4.1626 367.37 631.06)"/><path d="m0 0c-3.878 0-7.021 2.858-7.021 6.381v20.081c0 3.52 3.143 6.381 7.021 6.381s7.028-2.861 7.028-6.381v-20.081c0-3.523-3.15-6.381-7.028-6.381" fill="#fff" transform="matrix(4.1626 0 0 -4.1626 511.99 724.74)"/><path d="m0 0c0-12.052 9.765-21.815 21.815-21.815 12.041 0 21.808 9.763 21.808 21.815 0 12.044-9.767 21.802-21.808 21.802-12.05 0-21.815-9.758-21.815-21.802" fill="#fff" transform="matrix(4.1626 0 0 -4.1626 634.79 625.67)"/><path d="m0 0c0-7.994 6.477-14.473 14.471-14.473 8.002 0 14.479 6.479 14.479 14.473s-6.477 14.479-14.479 14.479c-7.994 0-14.471-6.485-14.471-14.479" fill="#414042" transform="matrix(4.1626 0 0 -4.1626 656.64 631.06)"/></g></svg>
+<svg height="128" width="128" xmlns="http://www.w3.org/2000/svg"><g transform="translate(32 32)"><path d="m-16-32c-8.86 0-16 7.13-16 15.99v95.98c0 8.86 7.13 15.99 16 15.99h96c8.86 0 16-7.13 16-15.99v-95.98c0-8.85-7.14-15.99-16-15.99z" fill="#363d52"/><path d="m-16-32c-8.86 0-16 7.13-16 15.99v95.98c0 8.86 7.13 15.99 16 15.99h96c8.86 0 16-7.13 16-15.99v-95.98c0-8.85-7.14-15.99-16-15.99zm0 4h96c6.64 0 12 5.35 12 11.99v95.98c0 6.64-5.35 11.99-12 11.99h-96c-6.64 0-12-5.35-12-11.99v-95.98c0-6.64 5.36-11.99 12-11.99z" fill-opacity=".4"/></g><g stroke-width="9.92746" transform="matrix(.10073078 0 0 .10073078 12.425923 2.256365)"><path d="m0 0s-.325 1.994-.515 1.976l-36.182-3.491c-2.879-.278-5.115-2.574-5.317-5.459l-.994-14.247-27.992-1.997-1.904 12.912c-.424 2.872-2.932 5.037-5.835 5.037h-38.188c-2.902 0-5.41-2.165-5.834-5.037l-1.905-12.912-27.992 1.997-.994 14.247c-.202 2.886-2.438 5.182-5.317 5.46l-36.2 3.49c-.187.018-.324-1.978-.511-1.978l-.049-7.83 30.658-4.944 1.004-14.374c.203-2.91 2.551-5.263 5.463-5.472l38.551-2.75c.146-.01.29-.016.434-.016 2.897 0 5.401 2.166 5.825 5.038l1.959 13.286h28.005l1.959-13.286c.423-2.871 2.93-5.037 5.831-5.037.142 0 .284.005.423.015l38.556 2.75c2.911.209 5.26 2.562 5.463 5.472l1.003 14.374 30.645 4.966z" fill="#fff" transform="matrix(4.162611 0 0 -4.162611 919.24059 771.67186)"/><path d="m0 0v-47.514-6.035-5.492c.108-.001.216-.005.323-.015l36.196-3.49c1.896-.183 3.382-1.709 3.514-3.609l1.116-15.978 31.574-2.253 2.175 14.747c.282 1.912 1.922 3.329 3.856 3.329h38.188c1.933 0 3.573-1.417 3.855-3.329l2.175-14.747 31.575 2.253 1.115 15.978c.133 1.9 1.618 3.425 3.514 3.609l36.182 3.49c.107.01.214.014.322.015v4.711l.015.005v54.325c5.09692 6.4164715 9.92323 13.494208 13.621 19.449-5.651 9.62-12.575 18.217-19.976 26.182-6.864-3.455-13.531-7.369-19.828-11.534-3.151 3.132-6.7 5.694-10.186 8.372-3.425 2.751-7.285 4.768-10.946 7.118 1.09 8.117 1.629 16.108 1.846 24.448-9.446 4.754-19.519 7.906-29.708 10.17-4.068-6.837-7.788-14.241-11.028-21.479-3.842.642-7.702.88-11.567.926v.006c-.027 0-.052-.006-.075-.006-.024 0-.049.006-.073.006v-.006c-3.872-.046-7.729-.284-11.572-.926-3.238 7.238-6.956 14.642-11.03 21.479-10.184-2.264-20.258-5.416-29.703-10.17.216-8.34.755-16.331 1.848-24.448-3.668-2.35-7.523-4.367-10.949-7.118-3.481-2.678-7.036-5.24-10.188-8.372-6.297 4.165-12.962 8.079-19.828 11.534-7.401-7.965-14.321-16.562-19.974-26.182 4.4426579-6.973692 9.2079702-13.9828876 13.621-19.449z" fill="#478cbf" transform="matrix(4.162611 0 0 -4.162611 104.69892 525.90697)"/><path d="m0 0-1.121-16.063c-.135-1.936-1.675-3.477-3.611-3.616l-38.555-2.751c-.094-.007-.188-.01-.281-.01-1.916 0-3.569 1.406-3.852 3.33l-2.211 14.994h-31.459l-2.211-14.994c-.297-2.018-2.101-3.469-4.133-3.32l-38.555 2.751c-1.936.139-3.476 1.68-3.611 3.616l-1.121 16.063-32.547 3.138c.015-3.498.06-7.33.06-8.093 0-34.374 43.605-50.896 97.781-51.086h.066.067c54.176.19 97.766 16.712 97.766 51.086 0 .777.047 4.593.063 8.093z" fill="#478cbf" transform="matrix(4.162611 0 0 -4.162611 784.07144 817.24284)"/><path d="m0 0c0-12.052-9.765-21.815-21.813-21.815-12.042 0-21.81 9.763-21.81 21.815 0 12.044 9.768 21.802 21.81 21.802 12.048 0 21.813-9.758 21.813-21.802" fill="#fff" transform="matrix(4.162611 0 0 -4.162611 389.21484 625.67104)"/><path d="m0 0c0-7.994-6.479-14.473-14.479-14.473-7.996 0-14.479 6.479-14.479 14.473s6.483 14.479 14.479 14.479c8 0 14.479-6.485 14.479-14.479" fill="#414042" transform="matrix(4.162611 0 0 -4.162611 367.36686 631.05679)"/><path d="m0 0c-3.878 0-7.021 2.858-7.021 6.381v20.081c0 3.52 3.143 6.381 7.021 6.381s7.028-2.861 7.028-6.381v-20.081c0-3.523-3.15-6.381-7.028-6.381" fill="#fff" transform="matrix(4.162611 0 0 -4.162611 511.99336 724.73954)"/><path d="m0 0c0-12.052 9.765-21.815 21.815-21.815 12.041 0 21.808 9.763 21.808 21.815 0 12.044-9.767 21.802-21.808 21.802-12.05 0-21.815-9.758-21.815-21.802" fill="#fff" transform="matrix(4.162611 0 0 -4.162611 634.78706 625.67104)"/><path d="m0 0c0-7.994 6.477-14.473 14.471-14.473 8.002 0 14.479 6.479 14.479 14.473s-6.477 14.479-14.479 14.479c-7.994 0-14.471-6.485-14.471-14.479" fill="#414042" transform="matrix(4.162611 0 0 -4.162611 656.64056 631.05679)"/></g></svg>
diff --git a/editor/import/resource_importer_layered_texture.cpp b/editor/import/resource_importer_layered_texture.cpp
index 2e6de95a46..b301bbf0f9 100644
--- a/editor/import/resource_importer_layered_texture.cpp
+++ b/editor/import/resource_importer_layered_texture.cpp
@@ -139,7 +139,7 @@ void ResourceImporterLayeredTexture::get_import_options(const String &p_path, Li
r_options->push_back(ImportOption(PropertyInfo(Variant::FLOAT, "compress/lossy_quality", PROPERTY_HINT_RANGE, "0,1,0.01"), 0.7));
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "compress/hdr_compression", PROPERTY_HINT_ENUM, "Disabled,Opaque Only,Always"), 1));
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "compress/bptc_ldr", PROPERTY_HINT_ENUM, "Disabled,Enabled,RGBA Only"), 0));
- r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "compress/channel_pack", PROPERTY_HINT_ENUM, "sRGB Friendly,Optimized"), 0));
+ r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "compress/channel_pack", PROPERTY_HINT_ENUM, "sRGB Friendly,Optimized,Normal Map (RG Channels)"), 0));
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "mipmaps/generate"), true));
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "mipmaps/limit", PROPERTY_HINT_RANGE, "-1,256"), -1));
@@ -250,7 +250,7 @@ void ResourceImporterLayeredTexture::_save_tex(Vector<Ref<Image>> p_images, cons
}
if (p_mipmaps) {
- p_images.write[i]->generate_mipmaps();
+ p_images.write[i]->generate_mipmaps(p_csource == Image::COMPRESS_SOURCE_NORMAL);
} else {
p_images.write[i]->clear_mipmaps();
}
@@ -354,6 +354,9 @@ Error ResourceImporterLayeredTexture::import(const String &p_source_file, const
Image::CompressSource csource = Image::COMPRESS_SOURCE_GENERIC;
if (channel_pack == 0) {
csource = Image::COMPRESS_SOURCE_SRGB;
+ } else if (channel_pack == 2) {
+ // force normal
+ csource = Image::COMPRESS_SOURCE_NORMAL;
}
Image::UsedChannels used_channels = image->detect_used_channels(csource);
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index 21891e381b..9d2dcd129c 100644
--- a/editor/project_manager.cpp
+++ b/editor/project_manager.cpp
@@ -1164,6 +1164,12 @@ void ProjectList::load_project_icon(int p_index) {
icon = default_icon;
}
+ // The default project icon is 128×128 to look crisp on hiDPI displays,
+ // but we want the actual displayed size to be 64×64 on loDPI displays.
+ item.control->icon->set_ignore_texture_size(true);
+ item.control->icon->set_custom_minimum_size(Size2(64, 64) * EDSCALE);
+ item.control->icon->set_stretch_mode(TextureRect::STRETCH_KEEP_ASPECT_CENTERED);
+
item.control->icon->set_texture(icon);
item.control->icon_needs_reload = false;
}
diff --git a/editor/shader_create_dialog.cpp b/editor/shader_create_dialog.cpp
index bd1f2529ca..8c4a231e8a 100644
--- a/editor/shader_create_dialog.cpp
+++ b/editor/shader_create_dialog.cpp
@@ -37,6 +37,13 @@
#include "scene/resources/visual_shader.h"
#include "servers/rendering/shader_types.h"
+enum ShaderType {
+ SHADER_TYPE_TEXT,
+ SHADER_TYPE_VISUAL,
+ SHADER_TYPE_INC,
+ SHADER_TYPE_MAX,
+};
+
void ShaderCreateDialog::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE: {
diff --git a/editor/shader_create_dialog.h b/editor/shader_create_dialog.h
index bf031c3601..9ba655369b 100644
--- a/editor/shader_create_dialog.h
+++ b/editor/shader_create_dialog.h
@@ -44,13 +44,6 @@ class EditorFileDialog;
class ShaderCreateDialog : public ConfirmationDialog {
GDCLASS(ShaderCreateDialog, ConfirmationDialog);
- enum ShaderType {
- SHADER_TYPE_TEXT,
- SHADER_TYPE_VISUAL,
- SHADER_TYPE_INC,
- SHADER_TYPE_MAX,
- };
-
struct ShaderTypeData {
List<String> extensions;
String default_extension;
diff --git a/modules/openxr/doc_classes/OpenXRAction.xml b/modules/openxr/doc_classes/OpenXRAction.xml
index 6ff8c1ad26..d1a2ce2d2e 100644
--- a/modules/openxr/doc_classes/OpenXRAction.xml
+++ b/modules/openxr/doc_classes/OpenXRAction.xml
@@ -5,7 +5,7 @@
</brief_description>
<description>
This resource defines an OpenXR action. Actions can be used both for inputs (buttons/joystick/trigger/etc) and outputs (haptics).
- OpenXR performs automatic conversion between action type and input type whenever possible. An analogue trigger bound to a boolean action will thus return [code]false[/core] if the trigger is depressed and [code]true[/code] if pressed fully.
+ OpenXR performs automatic conversion between action type and input type whenever possible. An analogue trigger bound to a boolean action will thus return [code]false[/code] if the trigger is depressed and [code]true[/code] if pressed fully.
Actions are not directly bound to specific devices, instead OpenXR recognises a limited number of top level paths that identify devices by usage. We can restrict which devices an action can be bound to by these top level paths. For instance an action that should only be used for hand held controllers can have the top level paths "/user/hand/left" and "/user/hand/right" associated with them. See the [url=https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#semantic-path-reserved]reserved path section in the OpenXR specification[/url] for more info on the top level paths.
Note that the name of the resource is used to register the action with.
</description>
diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp
index 34086add2a..685b1f01af 100644
--- a/platform/android/export/export_plugin.cpp
+++ b/platform/android/export/export_plugin.cpp
@@ -248,6 +248,7 @@ static const char *AAB_ASSETS_DIRECTORY = "res://android/build/assetPacks/instal
static const int DEFAULT_MIN_SDK_VERSION = 19; // Should match the value in 'platform/android/java/app/config.gradle#minSdk'
static const int DEFAULT_TARGET_SDK_VERSION = 32; // Should match the value in 'platform/android/java/app/config.gradle#targetSdk'
+#ifndef ANDROID_ENABLED
void EditorExportPlatformAndroid::_check_for_changes_poll_thread(void *ud) {
EditorExportPlatformAndroid *ea = static_cast<EditorExportPlatformAndroid *>(ud);
@@ -277,7 +278,6 @@ void EditorExportPlatformAndroid::_check_for_changes_poll_thread(void *ud) {
}
}
-#ifndef ANDROID_ENABLED
// Check for devices updates
String adb = get_adb_path();
if (FileAccess::exists(adb)) {
@@ -389,7 +389,6 @@ void EditorExportPlatformAndroid::_check_for_changes_poll_thread(void *ud) {
ea->devices_changed.set();
}
}
-#endif
uint64_t sleep = 200;
uint64_t wait = 3000000;
@@ -402,7 +401,6 @@ void EditorExportPlatformAndroid::_check_for_changes_poll_thread(void *ud) {
}
}
-#ifndef ANDROID_ENABLED
if (EditorSettings::get_singleton()->get("export/android/shutdown_adb_on_exit")) {
String adb = get_adb_path();
if (!FileAccess::exists(adb)) {
@@ -413,8 +411,8 @@ void EditorExportPlatformAndroid::_check_for_changes_poll_thread(void *ud) {
args.push_back("kill-server");
OS::get_singleton()->execute(adb, args);
}
-#endif
}
+#endif
String EditorExportPlatformAndroid::get_project_name(const String &p_name) const {
String aname;
@@ -3138,10 +3136,14 @@ EditorExportPlatformAndroid::EditorExportPlatformAndroid() {
devices_changed.set();
plugins_changed.set();
+#ifndef ANDROID_ENABLED
check_for_changes_thread.start(_check_for_changes_poll_thread, this);
+#endif
}
EditorExportPlatformAndroid::~EditorExportPlatformAndroid() {
+#ifndef ANDROID_ENABLED
quit_request.set();
check_for_changes_thread.wait_to_finish();
+#endif
}
diff --git a/platform/android/export/export_plugin.h b/platform/android/export/export_plugin.h
index 9455967053..46012bd46c 100644
--- a/platform/android/export/export_plugin.h
+++ b/platform/android/export/export_plugin.h
@@ -80,10 +80,12 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
Vector<Device> devices;
SafeFlag devices_changed;
Mutex device_lock;
+#ifndef ANDROID_ENABLED
Thread check_for_changes_thread;
SafeFlag quit_request;
static void _check_for_changes_poll_thread(void *ud);
+#endif
String get_project_name(const String &p_name) const;
diff --git a/platform/android/file_access_filesystem_jandroid.cpp b/platform/android/file_access_filesystem_jandroid.cpp
index 6b21c18d59..56561cb616 100644
--- a/platform/android/file_access_filesystem_jandroid.cpp
+++ b/platform/android/file_access_filesystem_jandroid.cpp
@@ -46,6 +46,7 @@ jmethodID FileAccessFilesystemJAndroid::_file_seek_end = nullptr;
jmethodID FileAccessFilesystemJAndroid::_file_read = nullptr;
jmethodID FileAccessFilesystemJAndroid::_file_tell = nullptr;
jmethodID FileAccessFilesystemJAndroid::_file_eof = nullptr;
+jmethodID FileAccessFilesystemJAndroid::_file_set_eof = nullptr;
jmethodID FileAccessFilesystemJAndroid::_file_close = nullptr;
jmethodID FileAccessFilesystemJAndroid::_file_write = nullptr;
jmethodID FileAccessFilesystemJAndroid::_file_flush = nullptr;
@@ -162,6 +163,16 @@ bool FileAccessFilesystemJAndroid::eof_reached() const {
}
}
+void FileAccessFilesystemJAndroid::_set_eof(bool eof) {
+ if (_file_set_eof) {
+ ERR_FAIL_COND_MSG(!is_open(), "File must be opened before use.");
+
+ JNIEnv *env = get_jni_env();
+ ERR_FAIL_COND(env == nullptr);
+ env->CallVoidMethod(file_access_handler, _file_set_eof, id, eof);
+ }
+}
+
uint8_t FileAccessFilesystemJAndroid::get_8() const {
ERR_FAIL_COND_V_MSG(!is_open(), 0, "File must be opened before use.");
uint8_t byte;
@@ -184,6 +195,7 @@ String FileAccessFilesystemJAndroid::get_line() const {
while (true) {
size_t line_buffer_size = MIN(buffer_size_limit, file_size - get_position());
if (line_buffer_size <= 0) {
+ const_cast<FileAccessFilesystemJAndroid *>(this)->_set_eof(true);
break;
}
@@ -310,6 +322,7 @@ void FileAccessFilesystemJAndroid::setup(jobject p_file_access_handler) {
_file_get_size = env->GetMethodID(cls, "fileGetSize", "(I)J");
_file_tell = env->GetMethodID(cls, "fileGetPosition", "(I)J");
_file_eof = env->GetMethodID(cls, "isFileEof", "(I)Z");
+ _file_set_eof = env->GetMethodID(cls, "setFileEof", "(IZ)V");
_file_seek = env->GetMethodID(cls, "fileSeek", "(IJ)V");
_file_seek_end = env->GetMethodID(cls, "fileSeekFromEnd", "(IJ)V");
_file_read = env->GetMethodID(cls, "fileRead", "(ILjava/nio/ByteBuffer;)I");
diff --git a/platform/android/file_access_filesystem_jandroid.h b/platform/android/file_access_filesystem_jandroid.h
index 7deb8de37b..76d7db6e3a 100644
--- a/platform/android/file_access_filesystem_jandroid.h
+++ b/platform/android/file_access_filesystem_jandroid.h
@@ -44,6 +44,7 @@ class FileAccessFilesystemJAndroid : public FileAccess {
static jmethodID _file_seek_end;
static jmethodID _file_tell;
static jmethodID _file_eof;
+ static jmethodID _file_set_eof;
static jmethodID _file_read;
static jmethodID _file_write;
static jmethodID _file_flush;
@@ -56,6 +57,7 @@ class FileAccessFilesystemJAndroid : public FileAccess {
String path_src;
void _close(); ///< close a file
+ void _set_eof(bool eof);
public:
virtual Error _open(const String &p_path, int p_mode_flags) override; ///< open a file
diff --git a/platform/android/java/lib/src/org/godotengine/godot/io/file/DataAccess.kt b/platform/android/java/lib/src/org/godotengine/godot/io/file/DataAccess.kt
index 463dabfb23..f23537a29e 100644
--- a/platform/android/java/lib/src/org/godotengine/godot/io/file/DataAccess.kt
+++ b/platform/android/java/lib/src/org/godotengine/godot/io/file/DataAccess.kt
@@ -104,7 +104,6 @@ internal abstract class DataAccess(private val filePath: String) {
protected abstract val fileChannel: FileChannel
internal var endOfFile = false
- private set
fun close() {
try {
@@ -125,9 +124,7 @@ internal abstract class DataAccess(private val filePath: String) {
fun seek(position: Long) {
try {
fileChannel.position(position)
- if (position <= size()) {
- endOfFile = false
- }
+ endOfFile = position >= fileChannel.size()
} catch (e: Exception) {
Log.w(TAG, "Exception when seeking file $filePath.", e)
}
@@ -161,8 +158,7 @@ internal abstract class DataAccess(private val filePath: String) {
fun read(buffer: ByteBuffer): Int {
return try {
val readBytes = fileChannel.read(buffer)
- endOfFile = readBytes == -1
- || (fileChannel.position() >= fileChannel.size() && fileChannel.size() > 0)
+ endOfFile = readBytes == -1 || (fileChannel.position() >= fileChannel.size())
if (readBytes == -1) {
0
} else {
diff --git a/platform/android/java/lib/src/org/godotengine/godot/io/file/FileAccessHandler.kt b/platform/android/java/lib/src/org/godotengine/godot/io/file/FileAccessHandler.kt
index 04b6772c45..83da3a24b3 100644
--- a/platform/android/java/lib/src/org/godotengine/godot/io/file/FileAccessHandler.kt
+++ b/platform/android/java/lib/src/org/godotengine/godot/io/file/FileAccessHandler.kt
@@ -194,6 +194,11 @@ class FileAccessHandler(val context: Context) {
return files[fileId].endOfFile
}
+ fun setFileEof(fileId: Int, eof: Boolean) {
+ val file = files[fileId] ?: return
+ file.endOfFile = eof
+ }
+
fun fileClose(fileId: Int) {
if (hasFileId(fileId)) {
files[fileId].close()
diff --git a/platform/ios/export/export_plugin.cpp b/platform/ios/export/export_plugin.cpp
index 2771ab8ca2..425a977569 100644
--- a/platform/ios/export/export_plugin.cpp
+++ b/platform/ios/export/export_plugin.cpp
@@ -1884,10 +1884,14 @@ bool EditorExportPlatformIOS::has_valid_project_configuration(const Ref<EditorEx
EditorExportPlatformIOS::EditorExportPlatformIOS() {
logo = ImageTexture::create_from_image(memnew(Image(_ios_logo)));
plugins_changed.set();
+#ifndef ANDROID_ENABLED
check_for_changes_thread.start(_check_for_changes_poll_thread, this);
+#endif
}
EditorExportPlatformIOS::~EditorExportPlatformIOS() {
+#ifndef ANDROID_ENABLED
quit_request.set();
check_for_changes_thread.wait_to_finish();
+#endif
}
diff --git a/platform/ios/export/export_plugin.h b/platform/ios/export/export_plugin.h
index 8079eda8f6..abda8e218a 100644
--- a/platform/ios/export/export_plugin.h
+++ b/platform/ios/export/export_plugin.h
@@ -57,8 +57,10 @@ class EditorExportPlatformIOS : public EditorExportPlatform {
// Plugins
SafeFlag plugins_changed;
+#ifndef ANDROID_ENABLED
Thread check_for_changes_thread;
SafeFlag quit_request;
+#endif
Mutex plugins_lock;
Vector<PluginConfigIOS> plugins;
@@ -139,6 +141,7 @@ class EditorExportPlatformIOS : public EditorExportPlatform {
return true;
}
+#ifndef ANDROID_ENABLED
static void _check_for_changes_poll_thread(void *ud) {
EditorExportPlatformIOS *ea = static_cast<EditorExportPlatformIOS *>(ud);
@@ -172,6 +175,7 @@ class EditorExportPlatformIOS : public EditorExportPlatform {
}
}
}
+#endif
protected:
virtual void get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) const override;
diff --git a/scene/2d/line_2d.cpp b/scene/2d/line_2d.cpp
index 06e5cbc97e..837f3061f1 100644
--- a/scene/2d/line_2d.cpp
+++ b/scene/2d/line_2d.cpp
@@ -346,13 +346,13 @@ void Line2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_points", "points"), &Line2D::set_points);
ClassDB::bind_method(D_METHOD("get_points"), &Line2D::get_points);
- ClassDB::bind_method(D_METHOD("set_point_position", "i", "position"), &Line2D::set_point_position);
- ClassDB::bind_method(D_METHOD("get_point_position", "i"), &Line2D::get_point_position);
+ ClassDB::bind_method(D_METHOD("set_point_position", "index", "position"), &Line2D::set_point_position);
+ ClassDB::bind_method(D_METHOD("get_point_position", "index"), &Line2D::get_point_position);
ClassDB::bind_method(D_METHOD("get_point_count"), &Line2D::get_point_count);
- ClassDB::bind_method(D_METHOD("add_point", "position", "at_position"), &Line2D::add_point, DEFVAL(-1));
- ClassDB::bind_method(D_METHOD("remove_point", "i"), &Line2D::remove_point);
+ ClassDB::bind_method(D_METHOD("add_point", "position", "index"), &Line2D::add_point, DEFVAL(-1));
+ ClassDB::bind_method(D_METHOD("remove_point", "index"), &Line2D::remove_point);
ClassDB::bind_method(D_METHOD("clear_points"), &Line2D::clear_points);
diff --git a/scene/resources/curve.cpp b/scene/resources/curve.cpp
index 5de92acb75..1835604285 100644
--- a/scene/resources/curve.cpp
+++ b/scene/resources/curve.cpp
@@ -1167,7 +1167,7 @@ void Curve2D::_get_property_list(List<PropertyInfo> *p_list) const {
void Curve2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_point_count"), &Curve2D::get_point_count);
ClassDB::bind_method(D_METHOD("set_point_count", "count"), &Curve2D::set_point_count);
- ClassDB::bind_method(D_METHOD("add_point", "position", "in", "out", "at_position"), &Curve2D::add_point, DEFVAL(Vector2()), DEFVAL(Vector2()), DEFVAL(-1));
+ ClassDB::bind_method(D_METHOD("add_point", "position", "in", "out", "index"), &Curve2D::add_point, DEFVAL(Vector2()), DEFVAL(Vector2()), DEFVAL(-1));
ClassDB::bind_method(D_METHOD("set_point_position", "idx", "position"), &Curve2D::set_point_position);
ClassDB::bind_method(D_METHOD("get_point_position", "idx"), &Curve2D::get_point_position);
ClassDB::bind_method(D_METHOD("set_point_in", "idx", "position"), &Curve2D::set_point_in);
@@ -1972,7 +1972,7 @@ void Curve3D::_get_property_list(List<PropertyInfo> *p_list) const {
void Curve3D::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_point_count"), &Curve3D::get_point_count);
ClassDB::bind_method(D_METHOD("set_point_count", "count"), &Curve3D::set_point_count);
- ClassDB::bind_method(D_METHOD("add_point", "position", "in", "out", "at_position"), &Curve3D::add_point, DEFVAL(Vector3()), DEFVAL(Vector3()), DEFVAL(-1));
+ ClassDB::bind_method(D_METHOD("add_point", "position", "in", "out", "index"), &Curve3D::add_point, DEFVAL(Vector3()), DEFVAL(Vector3()), DEFVAL(-1));
ClassDB::bind_method(D_METHOD("set_point_position", "idx", "position"), &Curve3D::set_point_position);
ClassDB::bind_method(D_METHOD("get_point_position", "idx"), &Curve3D::get_point_position);
ClassDB::bind_method(D_METHOD("set_point_tilt", "idx", "tilt"), &Curve3D::set_point_tilt);
diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp
index 619036d296..880876baed 100644
--- a/scene/resources/font.cpp
+++ b/scene/resources/font.cpp
@@ -2808,6 +2808,8 @@ void SystemFont::_update_base_font() {
file->set_oversampling(oversampling);
base_font = file;
+
+ break;
}
if (base_font.is_valid()) {
diff --git a/servers/navigation_server_2d.cpp b/servers/navigation_server_2d.cpp
index 126bb08c94..27b49014d8 100644
--- a/servers/navigation_server_2d.cpp
+++ b/servers/navigation_server_2d.cpp
@@ -204,7 +204,7 @@ void NavigationServer2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("map_create"), &NavigationServer2D::map_create);
ClassDB::bind_method(D_METHOD("map_set_active", "map", "active"), &NavigationServer2D::map_set_active);
- ClassDB::bind_method(D_METHOD("map_is_active", "nap"), &NavigationServer2D::map_is_active);
+ ClassDB::bind_method(D_METHOD("map_is_active", "map"), &NavigationServer2D::map_is_active);
ClassDB::bind_method(D_METHOD("map_set_cell_size", "map", "cell_size"), &NavigationServer2D::map_set_cell_size);
ClassDB::bind_method(D_METHOD("map_get_cell_size", "map"), &NavigationServer2D::map_get_cell_size);
ClassDB::bind_method(D_METHOD("map_set_edge_connection_margin", "map", "margin"), &NavigationServer2D::map_set_edge_connection_margin);
diff --git a/servers/navigation_server_3d.cpp b/servers/navigation_server_3d.cpp
index 115eda7b30..206698f97c 100644
--- a/servers/navigation_server_3d.cpp
+++ b/servers/navigation_server_3d.cpp
@@ -41,7 +41,7 @@ void NavigationServer3D::_bind_methods() {
ClassDB::bind_method(D_METHOD("map_create"), &NavigationServer3D::map_create);
ClassDB::bind_method(D_METHOD("map_set_active", "map", "active"), &NavigationServer3D::map_set_active);
- ClassDB::bind_method(D_METHOD("map_is_active", "nap"), &NavigationServer3D::map_is_active);
+ ClassDB::bind_method(D_METHOD("map_is_active", "map"), &NavigationServer3D::map_is_active);
ClassDB::bind_method(D_METHOD("map_set_up", "map", "up"), &NavigationServer3D::map_set_up);
ClassDB::bind_method(D_METHOD("map_get_up", "map"), &NavigationServer3D::map_get_up);
ClassDB::bind_method(D_METHOD("map_set_cell_size", "map", "cell_size"), &NavigationServer3D::map_set_cell_size);
diff --git a/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp b/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp
index dc3f35f942..585c42b2d8 100644
--- a/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp
+++ b/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp
@@ -416,7 +416,10 @@ void MeshStorage::mesh_add_surface(RID p_mesh, const RS::SurfaceData &p_surface)
mesh->bone_aabbs.resize(p_surface.bone_aabbs.size());
}
for (int i = 0; i < p_surface.bone_aabbs.size(); i++) {
- mesh->bone_aabbs.write[i].merge_with(p_surface.bone_aabbs[i]);
+ const AABB &bone = p_surface.bone_aabbs[i];
+ if (!bone.has_no_volume()) {
+ mesh->bone_aabbs.write[i].merge_with(bone);
+ }
}
mesh->aabb.merge_with(p_surface.aabb);
}