Merge pull request #44914 from swarnimarun/master-visualscript-refactor

Fix doc for the VisualScript class after #39649 PR
This commit is contained in:
Rémi Verschelde 2021-01-04 21:19:00 +01:00 committed by GitHub
commit 0b49e5de12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 55 additions and 83 deletions

View file

@ -26,23 +26,23 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="func_node_id" type="int">
</argument>
<description>
Add a function with the specified name to the VisualScript.
Add a function with the specified name to the VisualScript, and assign the root [VisualScriptFunction] node's id as [code]func_node_id[/code].
</description>
</method>
<method name="add_node">
<return type="void">
</return>
<argument index="0" name="func" type="StringName">
<argument index="0" name="id" type="int">
</argument>
<argument index="1" name="id" type="int">
<argument index="1" name="node" type="VisualScriptNode">
</argument>
<argument index="2" name="node" type="VisualScriptNode">
</argument>
<argument index="3" name="position" type="Vector2" default="Vector2( 0, 0 )">
<argument index="2" name="position" type="Vector2" default="Vector2( 0, 0 )">
</argument>
<description>
Add a node to a function of the VisualScript.
Add a node to the VisualScript.
</description>
</method>
<method name="add_variable">
@ -157,15 +157,13 @@
<method name="data_connect">
<return type="void">
</return>
<argument index="0" name="func" type="StringName">
<argument index="0" name="from_node" type="int">
</argument>
<argument index="1" name="from_node" type="int">
<argument index="1" name="from_port" type="int">
</argument>
<argument index="2" name="from_port" type="int">
<argument index="2" name="to_node" type="int">
</argument>
<argument index="3" name="to_node" type="int">
</argument>
<argument index="4" name="to_port" type="int">
<argument index="3" name="to_port" type="int">
</argument>
<description>
Connect two data ports. The value of [code]from_node[/code]'s [code]from_port[/code] would be fed into [code]to_node[/code]'s [code]to_port[/code].
@ -174,15 +172,13 @@
<method name="data_disconnect">
<return type="void">
</return>
<argument index="0" name="func" type="StringName">
<argument index="0" name="from_node" type="int">
</argument>
<argument index="1" name="from_node" type="int">
<argument index="1" name="from_port" type="int">
</argument>
<argument index="2" name="from_port" type="int">
<argument index="2" name="to_node" type="int">
</argument>
<argument index="3" name="to_node" type="int">
</argument>
<argument index="4" name="to_port" type="int">
<argument index="3" name="to_port" type="int">
</argument>
<description>
Disconnect two data ports previously connected with [method data_connect].
@ -197,37 +193,31 @@
Returns the id of a function's entry point node.
</description>
</method>
<method name="get_function_scroll" qualifiers="const">
<return type="Vector2">
</return>
<argument index="0" name="name" type="StringName">
</argument>
<description>
Returns the position of the center of the screen for a given function.
</description>
</method>
<method name="get_node" qualifiers="const">
<return type="VisualScriptNode">
</return>
<argument index="0" name="func" type="StringName">
</argument>
<argument index="1" name="id" type="int">
<argument index="0" name="id" type="int">
</argument>
<description>
Returns a node given its id and its function.
Returns a node given its id.
</description>
</method>
<method name="get_node_position" qualifiers="const">
<return type="Vector2">
</return>
<argument index="0" name="func" type="StringName">
</argument>
<argument index="1" name="id" type="int">
<argument index="0" name="id" type="int">
</argument>
<description>
Returns a node's position in pixels.
</description>
</method>
<method name="get_scroll" qualifiers="const">
<return type="Vector2">
</return>
<description>
Returns the current position of the center of the screen.
</description>
</method>
<method name="get_variable_default_value" qualifiers="const">
<return type="Variant">
</return>
@ -267,15 +257,13 @@
<method name="has_data_connection" qualifiers="const">
<return type="bool">
</return>
<argument index="0" name="func" type="StringName">
<argument index="0" name="from_node" type="int">
</argument>
<argument index="1" name="from_node" type="int">
<argument index="1" name="from_port" type="int">
</argument>
<argument index="2" name="from_port" type="int">
<argument index="2" name="to_node" type="int">
</argument>
<argument index="3" name="to_node" type="int">
</argument>
<argument index="4" name="to_port" type="int">
<argument index="3" name="to_port" type="int">
</argument>
<description>
Returns whether the specified data ports are connected.
@ -293,9 +281,7 @@
<method name="has_node" qualifiers="const">
<return type="bool">
</return>
<argument index="0" name="func" type="StringName">
</argument>
<argument index="1" name="id" type="int">
<argument index="0" name="id" type="int">
</argument>
<description>
Returns whether a node exists with the given id.
@ -304,13 +290,11 @@
<method name="has_sequence_connection" qualifiers="const">
<return type="bool">
</return>
<argument index="0" name="func" type="StringName">
<argument index="0" name="from_node" type="int">
</argument>
<argument index="1" name="from_node" type="int">
<argument index="1" name="from_output" type="int">
</argument>
<argument index="2" name="from_output" type="int">
</argument>
<argument index="3" name="to_node" type="int">
<argument index="2" name="to_node" type="int">
</argument>
<description>
Returns whether the specified sequence ports are connected.
@ -346,12 +330,10 @@
<method name="remove_node">
<return type="void">
</return>
<argument index="0" name="func" type="StringName">
</argument>
<argument index="1" name="id" type="int">
<argument index="0" name="id" type="int">
</argument>
<description>
Remove a specific node.
Remove the node with the specified id.
</description>
</method>
<method name="remove_variable">
@ -399,13 +381,11 @@
<method name="sequence_connect">
<return type="void">
</return>
<argument index="0" name="func" type="StringName">
<argument index="0" name="from_node" type="int">
</argument>
<argument index="1" name="from_node" type="int">
<argument index="1" name="from_output" type="int">
</argument>
<argument index="2" name="from_output" type="int">
</argument>
<argument index="3" name="to_node" type="int">
<argument index="2" name="to_node" type="int">
</argument>
<description>
Connect two sequence ports. The execution will flow from of [code]from_node[/code]'s [code]from_output[/code] into [code]to_node[/code].
@ -415,29 +395,16 @@
<method name="sequence_disconnect">
<return type="void">
</return>
<argument index="0" name="func" type="StringName">
<argument index="0" name="from_node" type="int">
</argument>
<argument index="1" name="from_node" type="int">
<argument index="1" name="from_output" type="int">
</argument>
<argument index="2" name="from_output" type="int">
</argument>
<argument index="3" name="to_node" type="int">
<argument index="2" name="to_node" type="int">
</argument>
<description>
Disconnect two sequence ports previously connected with [method sequence_connect].
</description>
</method>
<method name="set_function_scroll">
<return type="void">
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="ofs" type="Vector2">
</argument>
<description>
Position the center of the screen for a function.
</description>
</method>
<method name="set_instance_base_type">
<return type="void">
</return>
@ -450,14 +417,21 @@
<method name="set_node_position">
<return type="void">
</return>
<argument index="0" name="func" type="StringName">
<argument index="0" name="id" type="int">
</argument>
<argument index="1" name="id" type="int">
</argument>
<argument index="2" name="position" type="Vector2">
<argument index="1" name="position" type="Vector2">
</argument>
<description>
Position a node on the screen.
Set the node position in the VisualScript graph.
</description>
</method>
<method name="set_scroll">
<return type="void">
</return>
<argument index="0" name="ofs" type="Vector2">
</argument>
<description>
Set the screen center to the given position.
</description>
</method>
<method name="set_variable_default_value">
@ -496,9 +470,7 @@
</methods>
<signals>
<signal name="node_ports_changed">
<argument index="0" name="function" type="String">
</argument>
<argument index="1" name="id" type="int">
<argument index="0" name="id" type="int">
</argument>
<description>
Emitted when the ports of a node are changed.

View file

@ -1167,7 +1167,7 @@ Dictionary VisualScript::_get_data() const {
}
void VisualScript::_bind_methods() {
ClassDB::bind_method(D_METHOD("add_function", "name"), &VisualScript::add_function);
ClassDB::bind_method(D_METHOD("add_function", "name", "func_node_id"), &VisualScript::add_function);
ClassDB::bind_method(D_METHOD("has_function", "name"), &VisualScript::has_function);
ClassDB::bind_method(D_METHOD("remove_function", "name"), &VisualScript::remove_function);
ClassDB::bind_method(D_METHOD("rename_function", "name", "new_name"), &VisualScript::rename_function);