diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/classes/Directory.xml | 2 | ||||
-rw-r--r-- | doc/classes/MultiplayerAPI.xml | 91 | ||||
-rw-r--r-- | doc/classes/MultiplayerReplicator.xml | 139 | ||||
-rw-r--r-- | doc/classes/OS.xml | 8 | ||||
-rw-r--r-- | doc/classes/RenderingDevice.xml | 4 | ||||
-rw-r--r-- | doc/classes/String.xml | 15 | ||||
-rw-r--r-- | doc/classes/TextEdit.xml | 12 | ||||
-rw-r--r-- | doc/classes/Theme.xml | 21 | ||||
-rw-r--r-- | doc/classes/Tree.xml | 3 | ||||
-rw-r--r-- | doc/classes/TreeItem.xml | 18 | ||||
-rw-r--r-- | doc/classes/UndoRedo.xml | 4 |
11 files changed, 204 insertions, 113 deletions
diff --git a/doc/classes/Directory.xml b/doc/classes/Directory.xml index 919960cc9f..e8e5a286b4 100644 --- a/doc/classes/Directory.xml +++ b/doc/classes/Directory.xml @@ -187,7 +187,7 @@ <argument index="0" name="from" type="String" /> <argument index="1" name="to" type="String" /> <description> - Renames (move) the [code]from[/code] file to the [code]to[/code] destination. Both arguments should be paths to files, either relative or absolute. If the destination file exists and is not access-protected, it will be overwritten. + Renames (move) the [code]from[/code] file or directory to the [code]to[/code] destination. Both arguments should be paths to files or directories, either relative or absolute. If the destination file or directory exists and is not access-protected, it will be overwritten. Returns one of the [enum Error] code constants ([code]OK[/code] on success). </description> </method> diff --git a/doc/classes/MultiplayerAPI.xml b/doc/classes/MultiplayerAPI.xml index b9f50ad02a..610b00efe9 100644 --- a/doc/classes/MultiplayerAPI.xml +++ b/doc/classes/MultiplayerAPI.xml @@ -66,34 +66,6 @@ Sends the given raw [code]bytes[/code] to a specific peer identified by [code]id[/code] (see [method MultiplayerPeer.set_target_peer]). Default ID is [code]0[/code], i.e. broadcast to all peers. </description> </method> - <method name="send_despawn"> - <return type="int" enum="Error" /> - <argument index="0" name="peer_id" type="int" /> - <argument index="1" name="scene_id" type="int" /> - <argument index="2" name="path" type="NodePath" /> - <argument index="3" name="data" type="PackedByteArray" default="PackedByteArray()" /> - <description> - Sends a despawn request for the scene identified by [code]scene_id[/code] to the given [code]peer_id[/code] (see [method MultiplayerPeer.set_target_peer]). If the scene is configured as [constant SPAWN_MODE_SERVER] (see [method spawnable_config]) and the request is sent by the server (see [method is_network_server]), the receiving peer(s) will automatically queue for deletion the node at [code]path[/code] and emit the signal [signal network_despawn]. In all other cases no deletion happens, and the signal [signal network_despawn_request] is emitted instead. - </description> - </method> - <method name="send_spawn"> - <return type="int" enum="Error" /> - <argument index="0" name="peer_id" type="int" /> - <argument index="1" name="scene_id" type="int" /> - <argument index="2" name="path" type="NodePath" /> - <argument index="3" name="data" type="PackedByteArray" default="PackedByteArray()" /> - <description> - Sends a spawn request for the scene identified by [code]scene_id[/code] to the given [code]peer_id[/code] (see [method MultiplayerPeer.set_target_peer]). If the scene is configured as [constant SPAWN_MODE_SERVER] (see [method spawnable_config]) and the request is sent by the server (see [method is_network_server]), the receiving peer(s) will automatically instantiate that scene, add it to the [SceneTree] at the given [code]path[/code] and emit the signal [signal network_spawn]. In all other cases no instantiation happens, and the signal [signal network_spawn_request] is emitted instead. - </description> - </method> - <method name="spawnable_config"> - <return type="int" enum="Error" /> - <argument index="0" name="scene_id" type="int" /> - <argument index="1" name="spawn_mode" type="int" enum="MultiplayerAPI.SpawnMode" /> - <description> - Configures the MultiplayerAPI to track instances of the [PackedScene] idenfied by [code]scene_id[/code] (see [method ResourceLoader.get_resource_uid]) for the purpose of network replication. See [enum SpawnMode] for the possible configurations. - </description> - </method> </methods> <members> <member name="allow_object_decoding" type="bool" setter="set_allow_object_decoding" getter="is_object_decoding_allowed" default="false"> @@ -106,6 +78,8 @@ <member name="refuse_new_network_connections" type="bool" setter="set_refuse_new_network_connections" getter="is_refusing_new_network_connections" default="false"> If [code]true[/code], the MultiplayerAPI's [member network_peer] refuses new incoming connections. </member> + <member name="replicator" type="MultiplayerReplicator" setter="" getter="get_replicator"> + </member> <member name="root_node" type="Node" setter="set_root_node" getter="get_root_node"> The root node to use for RPCs. Instead of an absolute path, a relative path will be used to find the node upon which the RPC should be executed. This effectively allows to have different branches of the scene tree to be managed by different MultiplayerAPI, allowing for example to run both client and server in the same scene. @@ -122,25 +96,6 @@ Emitted when this MultiplayerAPI's [member network_peer] fails to establish a connection to a server. Only emitted on clients. </description> </signal> - <signal name="network_despawn"> - <argument index="0" name="id" type="int" /> - <argument index="1" name="scene_id" type="int" /> - <argument index="2" name="node" type="Node" /> - <argument index="3" name="data" type="PackedByteArray" /> - <description> - Emitted on a client before deleting a local Node upon receiving a despawn request from the server. - </description> - </signal> - <signal name="network_despawn_request"> - <argument index="0" name="id" type="int" /> - <argument index="1" name="scene_id" type="int" /> - <argument index="2" name="parent" type="Node" /> - <argument index="3" name="name" type="String" /> - <argument index="4" name="data" type="PackedByteArray" /> - <description> - Emitted when a network despawn request has been received from a client, or for a [PackedScene] that has been configured as [constant SPAWN_MODE_CUSTOM]. - </description> - </signal> <signal name="network_peer_connected"> <argument index="0" name="id" type="int" /> <description> @@ -160,39 +115,6 @@ Emitted when this MultiplayerAPI's [member network_peer] receive a [code]packet[/code] with custom data (see [method send_bytes]). ID is the peer ID of the peer that sent the packet. </description> </signal> - <signal name="network_spawn"> - <argument index="0" name="id" type="int" /> - <argument index="1" name="scene_id" type="int" /> - <argument index="2" name="node" type="Node" /> - <argument index="3" name="data" type="PackedByteArray" /> - <description> - Emitted on a client after a new Node is instantiated locally and added to the SceneTree upon receiving a spawn request from the server. - </description> - </signal> - <signal name="network_spawn_request"> - <argument index="0" name="id" type="int" /> - <argument index="1" name="scene_id" type="int" /> - <argument index="2" name="parent" type="Node" /> - <argument index="3" name="name" type="String" /> - <argument index="4" name="data" type="PackedByteArray" /> - <description> - Emitted when a network spawn request has been received from a client, or for a [PackedScene] that has been configured as [constant SPAWN_MODE_CUSTOM]. - </description> - </signal> - <signal name="network_spawnable_added"> - <argument index="0" name="scene_id" type="int" /> - <argument index="1" name="node" type="Node" /> - <description> - Emitted when an instance of a [PackedScene] that has been configured for networking enters the [SceneTree]. See [method spawnable_config]. - </description> - </signal> - <signal name="network_spawnable_removed"> - <argument index="0" name="scene_id" type="int" /> - <argument index="1" name="node" type="Node" /> - <description> - Emitted when an instance of a [PackedScene] that has been configured for networking leaves the [SceneTree]. See [method spawnable_config]. - </description> - </signal> <signal name="server_disconnected"> <description> Emitted when this MultiplayerAPI's [member network_peer] disconnects from server. Only emitted on clients. @@ -212,14 +134,5 @@ <constant name="RPC_MODE_PUPPET" value="3" enum="RPCMode"> Used with [method Node.rpc_config] to set a method to be called or a property to be changed only on puppets for this node. Analogous to the [code]puppet[/code] keyword. Only accepts calls or property changes from the node's network master, see [method Node.set_network_master]. </constant> - <constant name="SPAWN_MODE_NONE" value="0" enum="SpawnMode"> - Used with [method spawnable_config] to identify a [PackedScene] that should not be replicated. - </constant> - <constant name="SPAWN_MODE_SERVER" value="1" enum="SpawnMode"> - Used with [method spawnable_config] to identify a [PackedScene] that should be automatically replicated from server to clients. - </constant> - <constant name="SPAWN_MODE_CUSTOM" value="2" enum="SpawnMode"> - Used with [method spawnable_config] to identify a [PackedScene] that can be manually replicated among peers. - </constant> </constants> </class> diff --git a/doc/classes/MultiplayerReplicator.xml b/doc/classes/MultiplayerReplicator.xml new file mode 100644 index 0000000000..15029e181f --- /dev/null +++ b/doc/classes/MultiplayerReplicator.xml @@ -0,0 +1,139 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="MultiplayerReplicator" inherits="Object" version="4.0"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + <method name="decode_state"> + <return type="int" enum="Error" /> + <argument index="0" name="scene_id" type="int" /> + <argument index="1" name="object" type="Object" /> + <argument index="2" name="data" type="PackedByteArray" /> + <description> + Decode the given [code]data[/code] representing a spawnable state into [code]object[/code] using the configuration associated with the provided [code]scene_id[/code]. This function is called automatically when a client receives a server spawn for a scene with [constant REPLICATION_MODE_SERVER]. See [method spawn_config]. + Tip: You may find this function useful in servers when parsing spawn requests from clients, or when implementing your own logic with [constant REPLICATION_MODE_CUSTOM]. + </description> + </method> + <method name="despawn"> + <return type="int" enum="Error" /> + <argument index="0" name="scene_id" type="int" /> + <argument index="1" name="object" type="Object" /> + <argument index="2" name="peer_id" type="int" default="0" /> + <description> + </description> + </method> + <method name="encode_state"> + <return type="PackedByteArray" /> + <argument index="0" name="scene_id" type="int" /> + <argument index="1" name="object" type="Object" /> + <description> + Encode the given [code]object[/code] using the configuration associated with the provided [code]scene_id[/code]. This function is called automatically when the server spawns scenes with [constant REPLICATION_MODE_SERVER]. See [method spawn_config]. + Tip: You may find this function useful when requesting spawns from clients to server, or when implementing your own logic with [constant REPLICATION_MODE_CUSTOM]. + </description> + </method> + <method name="send_despawn"> + <return type="int" enum="Error" /> + <argument index="0" name="peer_id" type="int" /> + <argument index="1" name="scene_id" type="int" /> + <argument index="2" name="data" type="Variant" default="null" /> + <argument index="3" name="path" type="NodePath" default="NodePath("")" /> + <description> + Sends a despawn request for the scene identified by [code]scene_id[/code] to the given [code]peer_id[/code] (see [method MultiplayerPeer.set_target_peer]). If the scene is configured as [constant REPLICATION_MODE_SERVER] (see [method spawn_config]) and the request is sent by the server (see [method MultiplayerAPI.is_network_server]), the receiving peer(s) will automatically queue for deletion the node at [code]path[/code] and emit the signal [signal despawned]. In all other cases no deletion happens, and the signal [signal despawn_requested] is emitted instead. + </description> + </method> + <method name="send_spawn"> + <return type="int" enum="Error" /> + <argument index="0" name="peer_id" type="int" /> + <argument index="1" name="scene_id" type="int" /> + <argument index="2" name="data" type="Variant" default="null" /> + <argument index="3" name="path" type="NodePath" default="NodePath("")" /> + <description> + Sends a spawn request for the scene identified by [code]scene_id[/code] to the given [code]peer_id[/code] (see [method MultiplayerPeer.set_target_peer]). If the scene is configured as [constant REPLICATION_MODE_SERVER] (see [method spawn_config]) and the request is sent by the server (see [method MultiplayerAPI.is_network_server]), the receiving peer(s) will automatically instantiate that scene, add it to the [SceneTree] at the given [code]path[/code] and emit the signal [signal spawned]. In all other cases no instantiation happens, and the signal [signal spawn_requested] is emitted instead. + </description> + </method> + <method name="spawn"> + <return type="int" enum="Error" /> + <argument index="0" name="scene_id" type="int" /> + <argument index="1" name="object" type="Object" /> + <argument index="2" name="peer_id" type="int" default="0" /> + <description> + </description> + </method> + <method name="spawn_config"> + <return type="int" enum="Error" /> + <argument index="0" name="scene_id" type="int" /> + <argument index="1" name="spawn_mode" type="int" enum="MultiplayerReplicator.ReplicationMode" /> + <argument index="2" name="properties" type="StringName[]" default="[]" /> + <argument index="3" name="custom_send" type="Callable" /> + <argument index="4" name="custom_receive" type="Callable" /> + <description> + Configures the MultiplayerAPI to track instances of the [PackedScene] identified by [code]scene_id[/code] (see [method ResourceLoader.get_resource_uid]) for the purpose of network replication. When [code]mode[/code] is [constant REPLICATION_MODE_SERVER], the specified [code]properties[/code] will also be replicated to clients during the initial spawn. + Tip: You can use a custom property in the scene main script to return a customly optimized state representation. + </description> + </method> + </methods> + <signals> + <signal name="despawn_requested"> + <argument index="0" name="id" type="int" /> + <argument index="1" name="scene_id" type="int" /> + <argument index="2" name="parent" type="Node" /> + <argument index="3" name="name" type="String" /> + <argument index="4" name="data" type="PackedByteArray" /> + <description> + Emitted when a network despawn request has been received from a client, or for a [PackedScene] that has been configured as [constant REPLICATION_MODE_CUSTOM]. + </description> + </signal> + <signal name="despawned"> + <argument index="0" name="scene_id" type="int" /> + <argument index="1" name="node" type="Node" /> + <description> + Emitted on a client before deleting a local Node upon receiving a despawn request from the server. + </description> + </signal> + <signal name="replicated_instance_added"> + <argument index="0" name="scene_id" type="int" /> + <argument index="1" name="node" type="Node" /> + <description> + Emitted when an instance of a [PackedScene] that has been configured for networking enters the [SceneTree]. See [method spawn_config]. + </description> + </signal> + <signal name="replicated_instance_removed"> + <argument index="0" name="scene_id" type="int" /> + <argument index="1" name="node" type="Node" /> + <description> + Emitted when an instance of a [PackedScene] that has been configured for networking leaves the [SceneTree]. See [method spawn_config]. + </description> + </signal> + <signal name="spawn_requested"> + <argument index="0" name="id" type="int" /> + <argument index="1" name="scene_id" type="int" /> + <argument index="2" name="parent" type="Node" /> + <argument index="3" name="name" type="String" /> + <argument index="4" name="data" type="PackedByteArray" /> + <description> + Emitted when a network spawn request has been received from a client, or for a [PackedScene] that has been configured as [constant REPLICATION_MODE_CUSTOM]. + </description> + </signal> + <signal name="spawned"> + <argument index="0" name="scene_id" type="int" /> + <argument index="1" name="node" type="Node" /> + <description> + Emitted on a client after a new Node is instantiated locally and added to the SceneTree upon receiving a spawn request from the server. + </description> + </signal> + </signals> + <constants> + <constant name="REPLICATION_MODE_NONE" value="0" enum="ReplicationMode"> + Used with [method spawn_config] to identify a [PackedScene] that should not be replicated. + </constant> + <constant name="REPLICATION_MODE_SERVER" value="1" enum="ReplicationMode"> + Used with [method spawn_config] to identify a [PackedScene] that should be automatically replicated from server to clients. + </constant> + <constant name="REPLICATION_MODE_CUSTOM" value="2" enum="ReplicationMode"> + Used with [method spawn_config] to identify a [PackedScene] that can be manually replicated among peers. + </constant> + </constants> +</class> diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index e5d45189c7..757730f6c8 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -197,12 +197,6 @@ Returns the path to the current engine executable. </description> </method> - <method name="get_external_data_dir" qualifiers="const"> - <return type="String" /> - <description> - On Android, returns the absolute directory path where user data can be written to external storage if available. On all other platforms, this will return the same location as [method get_user_data_dir]. - </description> - </method> <method name="get_granted_permissions" qualifiers="const"> <return type="PackedStringArray" /> <description> @@ -270,9 +264,11 @@ <method name="get_system_dir" qualifiers="const"> <return type="String" /> <argument index="0" name="dir" type="int" enum="OS.SystemDir" /> + <argument index="1" name="shared_storage" type="bool" default="true" /> <description> Returns the actual path to commonly used folders across different platforms. Available locations are specified in [enum SystemDir]. [b]Note:[/b] This method is implemented on Android, Linux, macOS and Windows. + [b]Note:[/b] Shared storage is implemented on Android and allows to differentiate between app specific and shared directories. Shared directories have additional restrictions on Android. </description> </method> <method name="get_thread_caller_id" qualifiers="const"> diff --git a/doc/classes/RenderingDevice.xml b/doc/classes/RenderingDevice.xml index c329821646..24f7f4274e 100644 --- a/doc/classes/RenderingDevice.xml +++ b/doc/classes/RenderingDevice.xml @@ -448,6 +448,7 @@ <method name="shader_compile_binary_from_spirv"> <return type="PackedByteArray" /> <argument index="0" name="spirv_data" type="RDShaderSPIRV" /> + <argument index="1" name="name" type="String" default="""" /> <description> </description> </method> @@ -465,8 +466,9 @@ </description> </method> <method name="shader_create_from_spirv"> - <return type="PackedByteArray" /> + <return type="RID" /> <argument index="0" name="spirv_data" type="RDShaderSPIRV" /> + <argument index="1" name="name" type="String" default="""" /> <description> </description> </method> diff --git a/doc/classes/String.xml b/doc/classes/String.xml index 0376a3f96e..467e2f901f 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -410,6 +410,21 @@ <argument index="0" name="number" type="float" /> <argument index="1" name="decimals" type="int" default="-1" /> <description> + Converts a [float] to a string representation of a decimal number. + The number of decimal places can be specified with [code]decimals[/code]. If [code]decimals[/code] is [code]-1[/code] (default), decimal places will be automatically adjusted so that the string representation has 14 significant digits (counting both digits to the left and the right of the decimal point). + Trailing zeros are not included in the string. The last digit will be rounded and not truncated. + Some examples: + [codeblock] + String.num(3.141593) # "3.141593" + String.num(3.141593, 3) # "3.142" + String.num(3.14159300) # "3.141593", no trailing zeros. + # 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: + String.num(-0.0000012345432123454321) # "-0.00000123454321" + String.num(-10000.0000012345432123454321) # "-10000.0000012345" + [/codeblock] </description> </method> <method name="num_scientific" qualifiers="static"> diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index 68d20e41d0..7aa627b7d0 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -464,12 +464,24 @@ Returns if the user has IME text. </description> </method> + <method name="has_redo" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if a "redo" action is available. + </description> + </method> <method name="has_selection" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if the user has selected text. </description> </method> + <method name="has_undo" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if an "undo" action is available. + </description> + </method> <method name="insert_line_at"> <return type="void" /> <argument index="0" name="line" type="int" /> diff --git a/doc/classes/Theme.xml b/doc/classes/Theme.xml index 1124fb8084..edf5874432 100644 --- a/doc/classes/Theme.xml +++ b/doc/classes/Theme.xml @@ -81,19 +81,6 @@ Unmarks [code]theme_type[/code] as being a variation of any other type. </description> </method> - <method name="copy_default_theme"> - <return type="void" /> - <description> - Sets the theme's values to a copy of the default theme values. - </description> - </method> - <method name="copy_theme"> - <return type="void" /> - <argument index="0" name="other" type="Theme" /> - <description> - Sets the theme's values to a copy of a given theme. - </description> - </method> <method name="get_color" qualifiers="const"> <return type="Color" /> <argument index="0" name="name" type="StringName" /> @@ -340,6 +327,14 @@ Returns [code]true[/code] if [code]theme_type[/code] is marked as a variation of [code]base_type[/code] in this theme. </description> </method> + <method name="merge_with"> + <return type="void" /> + <argument index="0" name="other" type="Theme" /> + <description> + Adds missing and overrides existing definitions with values from the [code]other[/code] [Theme]. + [b]Note:[/b] This modifies the current theme. If you want to merge two themes together without modifying either one, create a new empty theme and merge the other two into it one after another. + </description> + </method> <method name="rename_color"> <return type="void" /> <argument index="0" name="old_name" type="StringName" /> diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml index 50a573d30f..ed24905254 100644 --- a/doc/classes/Tree.xml +++ b/doc/classes/Tree.xml @@ -552,6 +552,9 @@ <theme_item name="hseparation" data_type="constant" type="int" default="4"> The horizontal space between item cells. This is also used as the margin at the start of an item when folding is disabled. </theme_item> + <theme_item name="indeterminate" data_type="icon" type="Texture2D"> + The check icon to display when the [constant TreeItem.CELL_MODE_CHECK] mode cell is indeterminate. + </theme_item> <theme_item name="item_margin" data_type="constant" type="int" default="12"> The horizontal margin at the start of an item. This is used when folding is enabled for the item. </theme_item> diff --git a/doc/classes/TreeItem.xml b/doc/classes/TreeItem.xml index 944b9fdc06..406c074758 100644 --- a/doc/classes/TreeItem.xml +++ b/doc/classes/TreeItem.xml @@ -340,6 +340,13 @@ Returns [code]true[/code] if column [code]column[/code] is editable. </description> </method> + <method name="is_indeterminate" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="column" type="int" /> + <description> + Returns [code]true[/code] if the given column is indeterminate. + </description> + </method> <method name="is_selectable" qualifiers="const"> <return type="bool" /> <argument index="0" name="column" type="int" /> @@ -415,7 +422,7 @@ <argument index="0" name="column" type="int" /> <argument index="1" name="checked" type="bool" /> <description> - If [code]true[/code], the column [code]column[/code] is checked. + If [code]true[/code], the column [code]column[/code] is checked. Clears column's indeterminate status. </description> </method> <method name="set_custom_as_button"> @@ -507,6 +514,15 @@ Sets the given column's icon's texture region. </description> </method> + <method name="set_indeterminate"> + <return type="void" /> + <argument index="0" name="column" type="int" /> + <argument index="1" name="indeterminate" type="bool" /> + <description> + If [code]true[/code], the column [code]column[/code] is marked indeterminate. + [b]Note:[/b] If set [code]true[/code] from [code]false[/code], then column is cleared of checked status. + </description> + </method> <method name="set_language"> <return type="void" /> <argument index="0" name="column" type="int" /> diff --git a/doc/classes/UndoRedo.xml b/doc/classes/UndoRedo.xml index 4417447891..def6fe5d1f 100644 --- a/doc/classes/UndoRedo.xml +++ b/doc/classes/UndoRedo.xml @@ -166,13 +166,13 @@ This is useful mostly to check if something changed from a saved version. </description> </method> - <method name="has_redo"> + <method name="has_redo" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if a "redo" action is available. </description> </method> - <method name="has_undo"> + <method name="has_undo" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if an "undo" action is available. |