From 35b8fc2d851354fea69c6e5f28ce483c2b75a1a4 Mon Sep 17 00:00:00 2001 From: Swarnim Arun Date: Mon, 4 Jan 2021 21:42:55 +0530 Subject: [PATCH] Fix doc for the VisualScript class. --- .../doc_classes/VisualScript.xml | 136 +++++++----------- modules/visual_script/visual_script.cpp | 2 +- 2 files changed, 55 insertions(+), 83 deletions(-) diff --git a/modules/visual_script/doc_classes/VisualScript.xml b/modules/visual_script/doc_classes/VisualScript.xml index 088d84d2ec7..5112ea43a77 100644 --- a/modules/visual_script/doc_classes/VisualScript.xml +++ b/modules/visual_script/doc_classes/VisualScript.xml @@ -26,23 +26,23 @@ + + - 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]. - + - + - - - + - Add a node to a function of the VisualScript. + Add a node to the VisualScript. @@ -157,15 +157,13 @@ - + - + - + - - - + 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 @@ - + - + - + - - - + Disconnect two data ports previously connected with [method data_connect]. @@ -197,37 +193,31 @@ Returns the id of a function's entry point node. - - - - - - - Returns the position of the center of the screen for a given function. - - - - - + - Returns a node given its id and its function. + Returns a node given its id. - - - + Returns a node's position in pixels. + + + + + Returns the current position of the center of the screen. + + @@ -267,15 +257,13 @@ - + - + - + - - - + Returns whether the specified data ports are connected. @@ -293,9 +281,7 @@ - - - + Returns whether a node exists with the given id. @@ -304,13 +290,11 @@ - + - + - - - + Returns whether the specified sequence ports are connected. @@ -346,12 +330,10 @@ - - - + - Remove a specific node. + Remove the node with the specified id. @@ -399,13 +381,11 @@ - + - + - - - + 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 @@ - + - + - - - + Disconnect two sequence ports previously connected with [method sequence_connect]. - - - - - - - - - Position the center of the screen for a function. - - @@ -450,14 +417,21 @@ - + - - - + - Position a node on the screen. + Set the node position in the VisualScript graph. + + + + + + + + + Set the screen center to the given position. @@ -496,9 +470,7 @@ - - - + Emitted when the ports of a node are changed. diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp index 224534f6744..e9355f35c72 100644 --- a/modules/visual_script/visual_script.cpp +++ b/modules/visual_script/visual_script.cpp @@ -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);