diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-07-31 23:55:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-31 23:55:19 +0200 |
commit | 790b63b27cb0a792f99f9da481b292d5f01cda4a (patch) | |
tree | 3522a0d2b81926ee9c9e23246461fb9438777e25 /doc/classes/GraphEdit.xml | |
parent | 6c5330154e215f3be9f9455ebf2027ef25b5d46b (diff) | |
parent | 2fb69afde6adfc793adb268f35723a8378be6392 (diff) |
Merge pull request #51128 from HaSa1002/add-graphedit-is-ok-method-4
Diffstat (limited to 'doc/classes/GraphEdit.xml')
-rw-r--r-- | doc/classes/GraphEdit.xml | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml index 965dbe7449..33145dccd0 100644 --- a/doc/classes/GraphEdit.xml +++ b/doc/classes/GraphEdit.xml @@ -55,6 +55,29 @@ [/codeblock] </description> </method> + <method name="_is_node_hover_valid" qualifiers="virtual"> + <return type="bool" /> + <argument index="0" name="from" type="StringName" /> + <argument index="1" name="from_slot" type="int" /> + <argument index="2" name="to" type="StringName" /> + <argument index="3" name="to_slot" type="int" /> + <description> + This virtual method can be used to insert additional error detection while the user is dragging a connection over a valid port. + Return [code]true[/code] if the connection is indeed valid or return [code]false[/code] if the connection is impossible. If the connection is impossible, no snapping to the port and thus no connection request to that port will happen. + In this example a connection to same node is suppressed: + [codeblocks] + [gdscript] + func _is_node_hover_valid(from, from_slot, to, to_slot): + return from != to + [/gdscript] + [csharp] + public override bool _IsNodeHoverValid(String from, int fromSlot, String to, int toSlot) { + return from != to; + } + [/csharp] + [/codeblocks] + </description> + </method> <method name="add_valid_connection_type"> <return type="void" /> <argument index="0" name="from_type" type="int" /> |