From b80bc73a179cae249121ac3c93fd771978c05bb0 Mon Sep 17 00:00:00 2001 From: George Marques Date: Tue, 30 Jan 2018 22:09:41 -0200 Subject: [PATCH] Expose a few GraphEdit methods to script languages --- doc/classes/GraphEdit.xml | 77 +++++++++++++++++++++++++++++++++++++++ scene/gui/graph_edit.cpp | 9 +++++ 2 files changed, 86 insertions(+) diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml index 39d6ebc166f..2090155e855 100644 --- a/doc/classes/GraphEdit.xml +++ b/doc/classes/GraphEdit.xml @@ -12,6 +12,42 @@ + + + + + + + + + Makes possible the connection between two different slot types. The type is defined with the [method GraphNode.set_slot] method. + + + + + + + + + Makes possible to disconnect nodes when dragging from the slot at the left if it has the specified type. + + + + + + + + + Makes possible to disconnect nodes when dragging from the slot at the right if it has the specified type. + + + + + + + Remove all connections between nodes. + + @@ -64,12 +100,53 @@ Return true if the 'from_port' slot of 'from' GraphNode is connected to the 'to_port' slot of 'to' GraphNode. + + + + + + + + + Returns whether it's possible to connect slots of the specified types. + + + + + + + + + + + Makes it not possible to connect between two different slot types. The type is defined with the [method GraphNode.set_slot] method. + + + + + + + + + Removes the possibility to disconnect nodes when dragging from the slot at the left if it has the specified type. + + + + + + + + + Removes the possibility to disconnect nodes when dragging from the slot at the right if it has the specified type. + + + Sets the specified [code]node[/code] as the one selected. diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index 1b5014367be..38ce91a4df7 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -1147,9 +1147,18 @@ void GraphEdit::_bind_methods() { ClassDB::bind_method(D_METHOD("is_node_connected", "from", "from_port", "to", "to_port"), &GraphEdit::is_node_connected); ClassDB::bind_method(D_METHOD("disconnect_node", "from", "from_port", "to", "to_port"), &GraphEdit::disconnect_node); ClassDB::bind_method(D_METHOD("get_connection_list"), &GraphEdit::_get_connection_list); + ClassDB::bind_method(D_METHOD("clear_connections"), &GraphEdit::clear_connections); ClassDB::bind_method(D_METHOD("get_scroll_ofs"), &GraphEdit::get_scroll_ofs); ClassDB::bind_method(D_METHOD("set_scroll_ofs", "ofs"), &GraphEdit::set_scroll_ofs); + ClassDB::bind_method(D_METHOD("add_valid_right_disconnect_type", "type"), &GraphEdit::add_valid_right_disconnect_type); + ClassDB::bind_method(D_METHOD("remove_valid_right_disconnect_type", "type"), &GraphEdit::remove_valid_right_disconnect_type); + ClassDB::bind_method(D_METHOD("add_valid_left_disconnect_type", "type"), &GraphEdit::add_valid_left_disconnect_type); + ClassDB::bind_method(D_METHOD("remove_valid_left_disconnect_type", "type"), &GraphEdit::remove_valid_left_disconnect_type); + ClassDB::bind_method(D_METHOD("add_valid_connection_type", "from_type", "to_type"), &GraphEdit::add_valid_connection_type); + ClassDB::bind_method(D_METHOD("remove_valid_connection_type", "from_type", "to_type"), &GraphEdit::remove_valid_connection_type); + ClassDB::bind_method(D_METHOD("is_valid_connection_type", "from_type", "to_type"), &GraphEdit::is_valid_connection_type); + ClassDB::bind_method(D_METHOD("set_zoom", "p_zoom"), &GraphEdit::set_zoom); ClassDB::bind_method(D_METHOD("get_zoom"), &GraphEdit::get_zoom);