diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/classes/@GlobalScope.xml | 4 | ||||
-rw-r--r-- | doc/classes/AnimationLibrary.xml | 70 | ||||
-rw-r--r-- | doc/classes/AnimationPlayer.xml | 34 | ||||
-rw-r--r-- | doc/classes/Array.xml | 2 | ||||
-rw-r--r-- | doc/classes/CanvasItem.xml | 3 | ||||
-rw-r--r-- | doc/classes/CharacterBody2D.xml | 2 | ||||
-rw-r--r-- | doc/classes/CharacterBody3D.xml | 2 | ||||
-rw-r--r-- | doc/classes/EditorInspector.xml | 10 | ||||
-rw-r--r-- | doc/classes/Node.xml | 27 | ||||
-rw-r--r-- | doc/classes/OptionButton.xml | 20 | ||||
-rw-r--r-- | doc/classes/Position2D.xml | 5 | ||||
-rw-r--r-- | doc/classes/ProjectSettings.xml | 4 | ||||
-rw-r--r-- | doc/classes/RichTextLabel.xml | 13 | ||||
-rw-r--r-- | doc/classes/ScriptLanguageExtension.xml | 12 | ||||
-rw-r--r-- | doc/classes/SpinBox.xml | 1 | ||||
-rw-r--r-- | doc/classes/TabContainer.xml | 21 | ||||
-rw-r--r-- | doc/classes/TextServer.xml | 4 | ||||
-rw-r--r-- | doc/classes/Tree.xml | 3 | ||||
-rw-r--r-- | doc/classes/Tween.xml | 7 | ||||
-rw-r--r-- | doc/classes/Window.xml | 9 | ||||
-rwxr-xr-x | doc/tools/make_rst.py | 78 |
21 files changed, 269 insertions, 62 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index a2b310ca82..da6513a08b 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -2546,13 +2546,13 @@ The property is a translatable string. </constant> <constant name="PROPERTY_USAGE_GROUP" value="128" enum="PropertyUsageFlags"> - Used to group properties together in the editor. + Used to group properties together in the editor. See [EditorInspector]. </constant> <constant name="PROPERTY_USAGE_CATEGORY" value="256" enum="PropertyUsageFlags"> Used to categorize properties together in the editor. </constant> <constant name="PROPERTY_USAGE_SUBGROUP" value="512" enum="PropertyUsageFlags"> - Used to group properties together in the editor in a subgroup (under a group). + Used to group properties together in the editor in a subgroup (under a group). See [EditorInspector]. </constant> <constant name="PROPERTY_USAGE_NO_INSTANCE_STATE" value="2048" enum="PropertyUsageFlags"> The property does not save its state in [PackedScene]. diff --git a/doc/classes/AnimationLibrary.xml b/doc/classes/AnimationLibrary.xml new file mode 100644 index 0000000000..0a731edadd --- /dev/null +++ b/doc/classes/AnimationLibrary.xml @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="AnimationLibrary" inherits="Resource" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + <method name="add_animation"> + <return type="int" enum="Error" /> + <argument index="0" name="name" type="StringName" /> + <argument index="1" name="animation" type="Animation" /> + <description> + </description> + </method> + <method name="get_animation" qualifiers="const"> + <return type="Animation" /> + <argument index="0" name="name" type="StringName" /> + <description> + </description> + </method> + <method name="get_animation_list" qualifiers="const"> + <return type="StringName[]" /> + <description> + </description> + </method> + <method name="has_animation" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="name" type="StringName" /> + <description> + </description> + </method> + <method name="remove_animation"> + <return type="void" /> + <argument index="0" name="name" type="StringName" /> + <description> + </description> + </method> + <method name="rename_animation"> + <return type="void" /> + <argument index="0" name="name" type="StringName" /> + <argument index="1" name="newname" type="StringName" /> + <description> + </description> + </method> + </methods> + <members> + <member name="_data" type="Dictionary" setter="_set_data" getter="_get_data" default="{}"> + </member> + </members> + <signals> + <signal name="animation_added"> + <argument index="0" name="name" type="Animation" /> + <description> + </description> + </signal> + <signal name="animation_removed"> + <argument index="0" name="name" type="Animation" /> + <description> + </description> + </signal> + <signal name="animation_renamed"> + <argument index="0" name="name" type="Animation" /> + <argument index="1" name="to_name" type="Animation" /> + <description> + </description> + </signal> + </signals> +</class> diff --git a/doc/classes/AnimationPlayer.xml b/doc/classes/AnimationPlayer.xml index b1d04ce1f2..625cf3c47c 100644 --- a/doc/classes/AnimationPlayer.xml +++ b/doc/classes/AnimationPlayer.xml @@ -14,12 +14,11 @@ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> </tutorials> <methods> - <method name="add_animation"> + <method name="add_animation_library"> <return type="int" enum="Error" /> <argument index="0" name="name" type="StringName" /> - <argument index="1" name="animation" type="Animation" /> + <argument index="1" name="library" type="AnimationLibrary" /> <description> - Adds [code]animation[/code] to the player accessible with the key [code]name[/code]. </description> </method> <method name="advance"> @@ -63,6 +62,12 @@ Returns the name of [code]animation[/code] or an empty string if not found. </description> </method> + <method name="find_animation_library" qualifiers="const"> + <return type="StringName" /> + <argument index="0" name="animation" type="Animation" /> + <description> + </description> + </method> <method name="get_animation" qualifiers="const"> <return type="Animation" /> <argument index="0" name="name" type="StringName" /> @@ -70,6 +75,17 @@ Returns the [Animation] with key [code]name[/code] or [code]null[/code] if not found. </description> </method> + <method name="get_animation_library" qualifiers="const"> + <return type="AnimationLibrary" /> + <argument index="0" name="name" type="StringName" /> + <description> + </description> + </method> + <method name="get_animation_library_list" qualifiers="const"> + <return type="StringName[]" /> + <description> + </description> + </method> <method name="get_animation_list" qualifiers="const"> <return type="PackedStringArray" /> <description> @@ -103,6 +119,12 @@ Returns [code]true[/code] if the [AnimationPlayer] stores an [Animation] with key [code]name[/code]. </description> </method> + <method name="has_animation_library" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="name" type="StringName" /> + <description> + </description> + </method> <method name="is_playing" qualifiers="const"> <return type="bool" /> <description> @@ -138,19 +160,17 @@ [b]Note:[/b] If a looped animation is currently playing, the queued animation will never play unless the looped animation is stopped somehow. </description> </method> - <method name="remove_animation"> + <method name="remove_animation_library"> <return type="void" /> <argument index="0" name="name" type="StringName" /> <description> - Removes the animation with key [code]name[/code]. </description> </method> - <method name="rename_animation"> + <method name="rename_animation_library"> <return type="void" /> <argument index="0" name="name" type="StringName" /> <argument index="1" name="newname" type="StringName" /> <description> - Renames an existing animation with key [code]name[/code] to [code]newname[/code]. </description> </method> <method name="seek"> diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index 27331d3f96..ef4f86f1a9 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -194,7 +194,7 @@ <return type="void" /> <argument index="0" name="value" type="Variant" /> <description> - Removes the first occurrence of a value from the array. To remove an element by index, use [method remove_at] instead. + Removes the first occurrence of a value from the array. If the value does not exist in the array, nothing happens. To remove an element by index, use [method remove_at] instead. [b]Note:[/b] This method acts in-place and doesn't return a value. [b]Note:[/b] On large arrays, this method will be slower if the removed element is close to the beginning of the array (index 0). This is because all elements placed after the removed element have to be reindexed. </description> diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index 5205a1db3b..baaf33956f 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -480,9 +480,6 @@ <member name="show_behind_parent" type="bool" setter="set_draw_behind_parent" getter="is_draw_behind_parent_enabled" default="false"> If [code]true[/code], the object draws behind its parent. </member> - <member name="show_on_top" type="bool" setter="_set_on_top" getter="_is_on_top"> - If [code]true[/code], the object draws on top of its parent. - </member> <member name="texture_filter" type="int" setter="set_texture_filter" getter="get_texture_filter" enum="CanvasItem.TextureFilter" default="0"> The texture filtering mode to use on this [CanvasItem]. </member> diff --git a/doc/classes/CharacterBody2D.xml b/doc/classes/CharacterBody2D.xml index 28060f6579..63d493248f 100644 --- a/doc/classes/CharacterBody2D.xml +++ b/doc/classes/CharacterBody2D.xml @@ -183,7 +183,7 @@ If [code]true[/code], during a jump against the ceiling, the body will slide, if [code]false[/code] it will be stopped and will fall vertically. </member> <member name="up_direction" type="Vector2" setter="set_up_direction" getter="get_up_direction" default="Vector2(0, -1)"> - Direction vector used to determine what is a wall and what is a floor (or a ceiling), rather than a wall, when calling [method move_and_slide]. Defaults to [code]Vector2.UP[/code]. If set to [code]Vector2(0, 0)[/code], everything is considered a wall. This is useful for topdown games. + Vector pointing upwards, used to determine what is a wall and what is a floor (or a ceiling) when calling [method move_and_slide]. Defaults to [code]Vector2.UP[/code]. As the vector will be normalized it can't be equal to [constant Vector2.ZERO], if you want all collisions to be reported as walls, consider using [constant MOTION_MODE_FLOATING] as [member motion_mode]. </member> <member name="velocity" type="Vector2" setter="set_velocity" getter="get_velocity" default="Vector2(0, 0)"> Current velocity vector in pixels per second, used and modified during calls to [method move_and_slide]. diff --git a/doc/classes/CharacterBody3D.xml b/doc/classes/CharacterBody3D.xml index 4895e2cff7..6c5cd62fe1 100644 --- a/doc/classes/CharacterBody3D.xml +++ b/doc/classes/CharacterBody3D.xml @@ -168,7 +168,7 @@ If [code]true[/code], during a jump against the ceiling, the body will slide, if [code]false[/code] it will be stopped and will fall vertically. </member> <member name="up_direction" type="Vector3" setter="set_up_direction" getter="get_up_direction" default="Vector3(0, 1, 0)"> - Direction vector used to determine what is a wall and what is a floor (or a ceiling), rather than a wall, when calling [method move_and_slide]. Defaults to [code]Vector3.UP[/code]. If set to [code]Vector3(0, 0, 0)[/code], everything is considered a wall. This is useful for topdown games. + Vector pointing upwards, used to determine what is a wall and what is a floor (or a ceiling) when calling [method move_and_slide]. Defaults to [code]Vector3.UP[/code]. As the vector will be normalized it can't be equal to [constant Vector3.ZERO], if you want all collisions to be reported as walls, consider using [constant MOTION_MODE_FLOATING] as [member motion_mode]. </member> <member name="velocity" type="Vector3" setter="set_velocity" getter="get_velocity" default="Vector3(0, 0, 0)"> Current velocity vector (typically meters per second), used and modified during calls to [method move_and_slide]. diff --git a/doc/classes/EditorInspector.xml b/doc/classes/EditorInspector.xml index cd249ed319..365e1f13a9 100644 --- a/doc/classes/EditorInspector.xml +++ b/doc/classes/EditorInspector.xml @@ -1,11 +1,15 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="EditorInspector" inherits="ScrollContainer" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - A tab used to edit properties of the selected node. + A control used to edit properties of an object. </brief_description> <description> - The editor inspector is by default located on the right-hand side of the editor. It's used to edit the properties of the selected node. For example, you can select a node such as the Sprite2D then edit its transform through the inspector tool. The editor inspector is an essential tool in the game development workflow. - [b]Note:[/b] This class shouldn't be instantiated directly. Instead, access the singleton using [method EditorInterface.get_inspector]. + This is the control that implements property editing in the editor's Settings dialogs, the Inspector dock, etc. To get the [EditorInspector] used in the editor's Inspector dock, use [method EditorInterface.get_inspector]. + [EditorInspector] will show properties in the same order as the array returned by [method Object.get_property_list]. + If a property's name is path-like (i.e. if it contains forward slashes), [EditorInspector] will create nested sections for "directories" along the path. For example, if a property is named [code]highlighting/gdscript/node_path_color[/code], it will be shown as "Node Path Color" inside the "GDScript" section nested inside the "Highlighting" section. + If a property has [constant @GlobalScope.PROPERTY_USAGE_GROUP] usage, it will group subsequent properties whose name starts with the property's hint string. The group ends when a property does not start with that hint string or when a new group starts. An empty group name effectively ends the current group. [EditorInspector] will create a top-level section for each group. For example, if a property with group usage is named [code]Collide With[/code] and its hint string is [code]collide_with_[/code], a subsequent [code]collide_with_area[/code] property will be shown as "Area" inside the "Collide With" section. + If a property has [constant @GlobalScope.PROPERTY_USAGE_SUBGROUP] usage, a subgroup will be created in the same way as a group, and a second-level section will be created for each subgroup. + [b]Note:[/b] Unlike sections created from path-like property names, [EditorInspector] won't capitalize the name for sections created from groups. So properties with group usage usually use capitalized names instead of snake_cased names. </description> <tutorials> </tutorials> diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index b1a6ed7740..7079036879 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -84,6 +84,17 @@ [b]Note:[/b] [method _ready] may be called only once for each node. After removing a node from the scene tree and adding it again, [code]_ready[/code] will not be called a second time. This can be bypassed by requesting another call with [method request_ready], which may be called anywhere before adding the node again. </description> </method> + <method name="_shortcut_input" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="event" type="InputEvent" /> + <description> + Called when an [InputEventKey] or [InputEventShortcut] hasn't been consumed by [method _input] or any GUI [Control] item. The input event propagates up through the node tree until a node consumes it. + It is only called if shortcut processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process_shortcut_input]. + To consume the input event and stop it propagating further to other nodes, [method Viewport.set_input_as_handled] can be called. + This method can be used to handle shortcuts. + [b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not orphan). + </description> + </method> <method name="_unhandled_input" qualifiers="virtual"> <return type="void" /> <argument index="0" name="event" type="InputEvent" /> @@ -102,6 +113,7 @@ Called when an [InputEventKey] or [InputEventShortcut] hasn't been consumed by [method _input] or any GUI [Control] item. The input event propagates up through the node tree until a node consumes it. It is only called if unhandled key input processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process_unhandled_key_input]. To consume the input event and stop it propagating further to other nodes, [method Viewport.set_input_as_handled] can be called. + This method can be used to handle Unicode character input with [kbd]Alt[/kbd], [kbd]Alt + Ctrl[/kbd], and [kbd]Alt + Shift[/kbd] modifiers, after shortcuts were handled. For gameplay input, this and [method _unhandled_input] are usually a better fit than [method _input] as they allow the GUI to intercept the events first. [b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not an orphan). </description> @@ -462,6 +474,12 @@ Returns [code]true[/code] if internal processing is enabled (see [method set_process_internal]). </description> </method> + <method name="is_processing_shortcut_input" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if the node is processing shortcuts (see [method set_process_shortcut_input]). + </description> + </method> <method name="is_processing_unhandled_input" qualifiers="const"> <return type="bool" /> <description> @@ -673,6 +691,13 @@ [b]Warning:[/b] Built-in Nodes rely on the internal processing for their own logic, so changing this value from your code may lead to unexpected behavior. Script access to this internal logic is provided for specific advanced uses, but is unsafe and not supported. </description> </method> + <method name="set_process_shortcut_input"> + <return type="void" /> + <argument index="0" name="enable" type="bool" /> + <description> + Enables shortcut processing. Enabled automatically if [method _shortcut_input] is overridden. Any calls to this before [method _ready] will be ignored. + </description> + </method> <method name="set_process_unhandled_input"> <return type="void" /> <argument index="0" name="enable" type="bool" /> @@ -707,7 +732,7 @@ The override to the default [MultiplayerAPI]. Set to [code]null[/code] to use the default [SceneTree] one. </member> <member name="editor_description" type="String" setter="set_editor_description" getter="get_editor_description" default=""""> - Add a custom description to a node. + Add a custom description to a node. It will be displayed in a tooltip when hovered in editor's scene tree. </member> <member name="multiplayer" type="MultiplayerAPI" setter="" getter="get_multiplayer"> The [MultiplayerAPI] instance associated with this node. Either the [member custom_multiplayer], or the default SceneTree one (if inside tree). diff --git a/doc/classes/OptionButton.xml b/doc/classes/OptionButton.xml index 25e41116a2..b7145ab923 100644 --- a/doc/classes/OptionButton.xml +++ b/doc/classes/OptionButton.xml @@ -30,8 +30,9 @@ </method> <method name="add_separator"> <return type="void" /> + <argument index="0" name="text" type="String" default="""" /> <description> - Adds a separator to the list of items. Separators help to group items. Separator also takes up an index and is appended at the end. + Adds a separator to the list of items. Separators help to group items, and can optionally be given a [code]text[/code] header. A separator also gets an index assigned, and is appended at the end of the item list. </description> </method> <method name="clear"> @@ -89,6 +90,12 @@ [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member Window.visible] property. </description> </method> + <method name="get_selectable_item" qualifiers="const"> + <return type="int" /> + <argument index="0" name="from_last" type="bool" default="false" /> + <description> + </description> + </method> <method name="get_selected_id" qualifiers="const"> <return type="int" /> <description> @@ -101,6 +108,11 @@ Gets the metadata of the selected item. Metadata for items can be set using [method set_item_metadata]. </description> </method> + <method name="has_selectable_items" qualifiers="const"> + <return type="bool" /> + <description> + </description> + </method> <method name="is_item_disabled" qualifiers="const"> <return type="bool" /> <argument index="0" name="idx" type="int" /> @@ -108,6 +120,12 @@ Returns [code]true[/code] if the item at index [code]idx[/code] is disabled. </description> </method> + <method name="is_item_separator" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="idx" type="int" /> + <description> + </description> + </method> <method name="remove_item"> <return type="void" /> <argument index="0" name="idx" type="int" /> diff --git a/doc/classes/Position2D.xml b/doc/classes/Position2D.xml index 881ec028de..754fd1fdf1 100644 --- a/doc/classes/Position2D.xml +++ b/doc/classes/Position2D.xml @@ -8,4 +8,9 @@ </description> <tutorials> </tutorials> + <members> + <member name="gizmo_extents" type="float" setter="set_gizmo_extents" getter="get_gizmo_extents" default="10.0"> + Size of the gizmo cross that appears in the editor. + </member> + </members> </class> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 5e43c4a4cf..ee32677b3a 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -512,7 +512,7 @@ </member> <member name="display/window/size/resizable" type="bool" setter="" getter="" default="true"> Allows the window to be resizable by default. - [b]Note:[/b] This setting is ignored on iOS and Android. + [b]Note:[/b] This setting is ignored on iOS. </member> <member name="display/window/size/viewport_height" type="int" setter="" getter="" default="600"> Sets the game's main viewport height. On desktop platforms, this is also the initial window height. @@ -1923,7 +1923,7 @@ </member> <member name="rendering/vulkan/staging_buffer/texture_upload_region_size_px" type="int" setter="" getter="" default="64"> </member> - <member name="xr/openxr/default_action_map" type="String" setter="" getter="" default=""res://default_action_map.tres""> + <member name="xr/openxr/default_action_map" type="String" setter="" getter="" default=""res://openxr_action_map.tres""> Action map configuration to load by default. </member> <member name="xr/openxr/enabled" type="bool" setter="" getter="" default="false"> diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml index e805d3469c..b572ad2ed8 100644 --- a/doc/classes/RichTextLabel.xml +++ b/doc/classes/RichTextLabel.xml @@ -49,6 +49,12 @@ Clears the tag stack and sets [member text] to an empty string. </description> </method> + <method name="deselect"> + <return type="void" /> + <description> + Clears the current selection. + </description> + </method> <method name="get_character_line"> <return type="int" /> <argument index="0" name="character" type="int" /> @@ -370,6 +376,13 @@ Scrolls the window's top line to match first line of the [code]paragraph[/code]. </description> </method> + <method name="select_all"> + <return type="void" /> + <description> + Select all the text. + If [member selection_enabled] is [code]false[/code], no selection will occur. + </description> + </method> <method name="set_cell_border_color"> <return type="void" /> <argument index="0" name="color" type="Color" /> diff --git a/doc/classes/ScriptLanguageExtension.xml b/doc/classes/ScriptLanguageExtension.xml index 7225d93030..d66bb6a7c7 100644 --- a/doc/classes/ScriptLanguageExtension.xml +++ b/doc/classes/ScriptLanguageExtension.xml @@ -378,6 +378,18 @@ </constant> <constant name="LOOKUP_RESULT_MAX" value="7" enum="LookupResultType"> </constant> + <constant name="LOCATION_LOCAL" value="0" enum="CodeCompletionLocation"> + The option is local to the location of the code completion query - e.g. a local variable. + </constant> + <constant name="LOCATION_PARENT_MASK" value="256" enum="CodeCompletionLocation"> + The option is from the containing class or a parent class, relative to the location of the code completion query. Perform a bitwise OR with the class depth (e.g. 0 for the local class, 1 for the parent, 2 for the grandparent, etc) to store the depth of an option in a the class or a parent class. + </constant> + <constant name="LOCATION_OTHER_USER_CODE" value="512" enum="CodeCompletionLocation"> + The option is from user code which is not local and not in a derived class (e.g. Autoload Singletons). + </constant> + <constant name="LOCATION_OTHER" value="1024" enum="CodeCompletionLocation"> + The option is from other engine code, not covered by the other enum constants - e.g. built-in classes. + </constant> <constant name="CODE_COMPLETION_KIND_CLASS" value="0" enum="CodeCompletionKind"> </constant> <constant name="CODE_COMPLETION_KIND_FUNCTION" value="1" enum="CodeCompletionKind"> diff --git a/doc/classes/SpinBox.xml b/doc/classes/SpinBox.xml index 5e3eb0c9f8..e84f9c38ff 100644 --- a/doc/classes/SpinBox.xml +++ b/doc/classes/SpinBox.xml @@ -25,6 +25,7 @@ The above code will create a [SpinBox], disable context menu on it and set the text alignment to right. See [Range] class for more options over the [SpinBox]. [b]Note:[/b] [SpinBox] relies on an underlying [LineEdit] node. To theme a [SpinBox]'s background, add theme items for [LineEdit] and customize them. + [b]Note:[/b] If you want to implement drag and drop for the underlying [LineEdit], you can use [method Control.set_drag_forwarding] on the node returned by [method get_line_edit]. </description> <tutorials> </tutorials> diff --git a/doc/classes/TabContainer.xml b/doc/classes/TabContainer.xml index c506152546..011b716dfc 100644 --- a/doc/classes/TabContainer.xml +++ b/doc/classes/TabContainer.xml @@ -30,6 +30,13 @@ Returns the previously active tab index. </description> </method> + <method name="get_tab_button_icon" qualifiers="const"> + <return type="Texture2D" /> + <argument index="0" name="tab_idx" type="int" /> + <description> + Returns the button icon from the tab at index [code]tab_idx[/code]. + </description> + </method> <method name="get_tab_control" qualifiers="const"> <return type="Control" /> <argument index="0" name="tab_idx" type="int" /> @@ -92,6 +99,14 @@ If set on a [Popup] node instance, a popup menu icon appears in the top-right corner of the [TabContainer] (setting it to [code]null[/code] will make it go away). Clicking it will expand the [Popup] node. </description> </method> + <method name="set_tab_button_icon"> + <return type="void" /> + <argument index="0" name="tab_idx" type="int" /> + <argument index="1" name="icon" type="Texture2D" /> + <description> + Sets the button icon from the tab at index [code]tab_idx[/code]. + </description> + </method> <method name="set_tab_disabled"> <return type="void" /> <argument index="0" name="tab_idx" type="int" /> @@ -158,6 +173,12 @@ Emitted when the [TabContainer]'s [Popup] button is clicked. See [method set_popup] for details. </description> </signal> + <signal name="tab_button_pressed"> + <argument index="0" name="tab" type="int" /> + <description> + Emitted when the user clicks on the button icon on this tab. + </description> + </signal> <signal name="tab_changed"> <argument index="0" name="tab" type="int" /> <description> diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml index b4339bef11..9ef800d7e1 100644 --- a/doc/classes/TextServer.xml +++ b/doc/classes/TextServer.xml @@ -1249,9 +1249,9 @@ <method name="shaped_text_get_word_breaks" qualifiers="const"> <return type="PackedInt32Array" /> <argument index="0" name="shaped" type="RID" /> - <argument index="1" name="grapheme_flags" type="int" /> + <argument index="1" name="grapheme_flags" type="int" default="264" /> <description> - Breaks text into words and returns array of character ranges. + Breaks text into words and returns array of character ranges. Use [code]grapheme_flags[/code] to set what characters are used for breaking (see [enum GraphemeFlag]). </description> </method> <method name="shaped_text_hit_test_grapheme" qualifiers="const"> diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml index b8c39bee49..5abec4b437 100644 --- a/doc/classes/Tree.xml +++ b/doc/classes/Tree.xml @@ -179,8 +179,9 @@ <return type="Rect2" /> <argument index="0" name="item" type="TreeItem" /> <argument index="1" name="column" type="int" default="-1" /> + <argument index="2" name="button_index" type="int" default="-1" /> <description> - Returns the rectangle area for the specified [TreeItem]. If [code]column[/code] is specified, only get the position and size of that column, otherwise get the rectangle containing all columns. + Returns the rectangle area for the specified [TreeItem]. If [code]column[/code] is specified, only get the position and size of that column, otherwise get the rectangle containing all columns. If a button index is specified, the rectangle of that button will be returned. </description> </method> <method name="get_item_at_position" qualifiers="const"> diff --git a/doc/classes/Tween.xml b/doc/classes/Tween.xml index 2c152410ce..72f32f39c2 100644 --- a/doc/classes/Tween.xml +++ b/doc/classes/Tween.xml @@ -72,6 +72,13 @@ [b]Note:[/b] The [Tween] will become invalid after finished, but you can call [method stop] after the step, to keep it and reset. </description> </method> + <method name="get_total_elapsed_time" qualifiers="const"> + <return type="float" /> + <description> + Returns the total time in seconds the [Tween] has been animating (i.e. time since it started, not counting pauses etc.). The time is affected by [method set_speed_scale] and [method stop] will reset it to [code]0[/code]. + [b]Note:[/code] As it results from accumulating frame deltas, the time returned after the [Tween] has finished animating will be slightly greater than the actual [Tween] duration. + </description> + </method> <method name="interpolate_value"> <return type="Variant" /> <argument index="0" name="initial_value" type="Variant" /> diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml index 9853f906bc..87a65db192 100644 --- a/doc/classes/Window.xml +++ b/doc/classes/Window.xml @@ -349,6 +349,15 @@ <argument index="0" name="files" type="PackedStringArray" /> <description> Emitted when files are dragged from the OS file manager and dropped in the game window. The argument is a list of file paths. + Note that this method only works with non-embedded windows, i.e. the main window and [Window]-derived nodes when [member Viewport.gui_embed_subwindows] is disabled in the main viewport. + Example usage: + [codeblock] + func _ready(): + get_viewport().files_dropped.connect(on_files_dropped) + + func on_files_dropped(files): + print(files) + [/codeblock] </description> </signal> <signal name="focus_entered"> diff --git a/doc/tools/make_rst.py b/doc/tools/make_rst.py index 365beb434b..eba4cee33a 100755 --- a/doc/tools/make_rst.py +++ b/doc/tools/make_rst.py @@ -58,7 +58,7 @@ strings_l10n = {} def print_error(error, state): # type: (str, State) -> None print("ERROR: {}".format(error)) - state.errored = True + state.num_errors += 1 class TypeName: @@ -163,8 +163,7 @@ class ClassDef: class State: def __init__(self): # type: () -> None - # Has any error been reported? - self.errored = False + self.num_errors = 0 self.classes = OrderedDict() # type: OrderedDict[str, ClassDef] self.current_class = "" # type: str @@ -194,7 +193,7 @@ class State: property_name = property.attrib["name"] if property_name in class_def.properties: - print_error("Duplicate property '{}', file: {}".format(property_name, class_name), self) + print_error('{}.xml: Duplicate property "{}".'.format(class_name, property_name), self) continue type_name = TypeName.from_element(property) @@ -305,7 +304,7 @@ class State: constant_def = ConstantDef(constant_name, value, constant.text) if enum is None: if constant_name in class_def.constants: - print_error("Duplicate constant '{}', file: {}".format(constant_name, class_name), self) + print_error('{}.xml: Duplicate constant "{}".'.format(class_name, constant_name), self) continue class_def.constants[constant_name] = constant_def @@ -328,7 +327,7 @@ class State: signal_name = signal.attrib["name"] if signal_name in class_def.signals: - print_error("Duplicate signal '{}', file: {}".format(signal_name, class_name), self) + print_error('{}.xml: Duplicate signal "{}".'.format(class_name, signal_name), self) continue params = parse_arguments(signal) @@ -351,8 +350,8 @@ class State: theme_item_id = "{}_{}".format(theme_item_data_name, theme_item_name) if theme_item_id in class_def.theme_items: print_error( - "Duplicate theme property '{}' of type '{}', file: {}".format( - theme_item_name, theme_item_data_name, class_name + '{}.xml: Duplicate theme item "{}" of type "{}".'.format( + class_name, theme_item_name, theme_item_data_name ), self, ) @@ -430,7 +429,7 @@ def main(): # type: () -> None if entry.msgid in BASE_STRINGS: strings_l10n[entry.msgid] = entry.msgstr else: - print("No PO file at '{}' for language '{}'.".format(lang_file, args.lang)) + print('No PO file at "{}" for language "{}".'.format(lang_file, args.lang)) print("Checking for errors in the XML class reference...") @@ -453,7 +452,7 @@ def main(): # type: () -> None elif os.path.isfile(path): if not path.endswith(".xml"): - print("Got non-.xml file '{}' in input, skipping.".format(path)) + print('Got non-.xml file "{}" in input, skipping.'.format(path)) continue file_list.append(path) @@ -465,17 +464,17 @@ def main(): # type: () -> None try: tree = ET.parse(cur_file) except ET.ParseError as e: - print_error("Parse error reading file '{}': {}".format(cur_file, e), state) + print_error("{}.xml: Parse error while reading the file: {}".format(cur_file, e), state) continue doc = tree.getroot() if "version" not in doc.attrib: - print_error("Version missing from 'doc', file: {}".format(cur_file), state) + print_error('{}.xml: "version" attribute missing from "doc".'.format(cur_file), state) continue name = doc.attrib["name"] if name in classes: - print_error("Duplicate class '{}'".format(name), state) + print_error('{}.xml: Duplicate class "{}".'.format(cur_file, name), state) continue classes[name] = (doc, cur_file) @@ -484,7 +483,7 @@ def main(): # type: () -> None try: state.parse_class(data[0], data[1]) except Exception as e: - print_error("Exception while parsing class '{}': {}".format(name, e), state) + print_error("{}.xml: Exception while parsing class: {}".format(name, e), state) state.sort_classes() @@ -499,12 +498,17 @@ def main(): # type: () -> None state.current_class = class_name make_rst_class(class_def, state, args.dry_run, args.output) - if not state.errored: - print("No errors found.") + if state.num_errors == 0: + print("No errors found in the class reference XML.") if not args.dry_run: print("Wrote reStructuredText files for each class to: %s" % args.output) else: - print("Errors were found in the class reference XML. Please check the messages above.") + if state.num_errors >= 2: + print( + "%d errors were found in the class reference XML. Please check the messages above." % state.num_errors + ) + else: + print("1 error was found in the class reference XML. Please check the messages above.") exit(1) @@ -856,7 +860,7 @@ def escape_rst(text, until_pos=-1): # type: (str) -> str def format_codeblock(code_type, post_text, indent_level, state): # types: str, str, int, state end_pos = post_text.find("[/" + code_type + "]") if end_pos == -1: - print_error("[" + code_type + "] without a closing tag, file: {}".format(state.current_class), state) + 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] @@ -875,9 +879,9 @@ def format_codeblock(code_type, post_text, indent_level, state): # types: str, if to_skip > indent_level: print_error( - "Four spaces should be used for indentation within [" + "{}.xml: Four spaces should be used for indentation within [" + code_type - + "], file: {}".format(state.current_class), + + "].".format(state.current_class), state, ) @@ -987,7 +991,7 @@ def rstize_text(text, state): # type: (str, State) -> str if param.find(".") != -1: ss = param.split(".") if len(ss) > 2: - print_error("Bad reference: '{}', file: {}".format(param, state.current_class), state) + print_error('{}.xml: Bad reference: "{}".'.format(state.current_class, param), state) class_param, method_param = ss else: @@ -1000,33 +1004,31 @@ def rstize_text(text, state): # type: (str, State) -> str if cmd.startswith("constructor"): if method_param not in class_def.constructors: print_error( - "Unresolved constructor '{}', file: {}".format(param, state.current_class), state + '{}.xml: Unresolved constructor "{}".'.format(state.current_class, param), state ) ref_type = "_constructor" if cmd.startswith("method"): if method_param not in class_def.methods: - print_error("Unresolved method '{}', file: {}".format(param, state.current_class), state) + print_error('{}.xml: Unresolved method "{}".'.format(state.current_class, param), state) ref_type = "_method" if cmd.startswith("operator"): if method_param not in class_def.operators: - print_error("Unresolved operator '{}', file: {}".format(param, state.current_class), state) + 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("Unresolved member '{}', file: {}".format(param, state.current_class), state) + 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( - "Unresolved theme item '{}', file: {}".format(param, state.current_class), state - ) + 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("Unresolved signal '{}', file: {}".format(param, state.current_class), state) + print_error('{}.xml: Unresolved signal "{}".'.format(state.current_class, param), state) ref_type = "_signal" elif cmd.startswith("constant"): @@ -1052,13 +1054,13 @@ def rstize_text(text, state): # type: (str, State) -> str break if not found: - print_error("Unresolved constant '{}', file: {}".format(param, state.current_class), state) + print_error('{}.xml: Unresolved constant "{}".'.format(state.current_class, param), state) ref_type = "_constant" else: print_error( - "Unresolved type reference '{}' in method reference '{}', file: {}".format( - class_param, param, state.current_class + '{}.xml: Unresolved type reference "{}" in method reference "{}".'.format( + state.current_class, class_param, param ), state, ) @@ -1078,7 +1080,7 @@ def rstize_text(text, state): # type: (str, State) -> str endurl_pos = text.find("[/url]", endq_pos + 1) if endurl_pos == -1: print_error( - "Tag depth mismatch for [url]: no closing [/url], file: {}".format(state.current_class), state + "{}.xml: Tag depth mismatch for [url]: no closing [/url]".format(state.current_class), state ) break link_title = text[endq_pos + 1 : endurl_pos] @@ -1203,7 +1205,9 @@ def rstize_text(text, state): # type: (str, State) -> str previous_pos = pos if tag_depth > 0: - print_error("Tag depth mismatch: too many/little open/close tags, file: {}".format(state.current_class), state) + print_error( + "{}.xml: Tag depth mismatch: too many (or too little) open/close tags.".format(state.current_class), state + ) return text @@ -1247,7 +1251,7 @@ def make_type(klass, state): # type: (str, State) -> str link_type = link_type[:-2] if link_type in state.classes: return ":ref:`{}<class_{}>`".format(klass, link_type) - print_error("Unresolved type '{}', file: {}".format(klass, state.current_class), state) + print_error('{}.xml: Unresolved type "{}".'.format(state.current_class, klass), state) return klass @@ -1271,7 +1275,7 @@ def make_enum(t, state): # type: (str, State) -> str # 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("Unresolved enum '{}', file: {}".format(t, state.current_class), state) + print_error('{}.xml: Unresolved enum "{}".'.format(state.current_class, t), state) return t @@ -1429,7 +1433,7 @@ def sanitize_operator_name(dirty_name, state): # type: (str, State) -> str else: clear_name = "xxx" - print_error("Unsupported operator type '{}', please add the missing rule.".format(dirty_name), state) + print_error('Unsupported operator type "{}", please add the missing rule.'.format(dirty_name), state) return clear_name |