mirror of
https://codeberg.org/StreamGraph/StreamGraph.git
synced 2024-11-13 19:49:55 +01:00
test disconnections but 2
This commit is contained in:
parent
a5acd3a1c3
commit
83d5fae1bd
1 changed files with 13 additions and 0 deletions
|
@ -32,6 +32,7 @@ func _ready() -> void:
|
||||||
)
|
)
|
||||||
|
|
||||||
connection_request.connect(attempt_connection)
|
connection_request.connect(attempt_connection)
|
||||||
|
disconnection_request.connect(attempt_disconnect)
|
||||||
|
|
||||||
|
|
||||||
func attempt_connection(from_node_name: StringName, from_port: int, to_node_name: StringName, to_port: int) -> void:
|
func attempt_connection(from_node_name: StringName, from_port: int, to_node_name: StringName, to_port: int) -> void:
|
||||||
|
@ -43,3 +44,15 @@ func attempt_connection(from_node_name: StringName, from_port: int, to_node_name
|
||||||
|
|
||||||
if deck.connect_nodes(from_node, to_node, from_output, to_input):
|
if deck.connect_nodes(from_node, to_node, from_output, to_input):
|
||||||
connect_node(from_node_name, from_port, to_node_name, to_port)
|
connect_node(from_node_name, from_port, to_node_name, to_port)
|
||||||
|
|
||||||
|
|
||||||
|
func attempt_disconnect(from_node_name: StringName, from_port: int, to_node_name: StringName, to_port: int) -> void:
|
||||||
|
var from_node: DeckNode = get_node(NodePath(from_node_name)).node
|
||||||
|
var to_node: DeckNode = get_node(NodePath(to_node_name)).node
|
||||||
|
|
||||||
|
var from_output := from_node.get_global_port_idx_from_output(from_port)
|
||||||
|
var to_input := to_node.get_global_port_idx_from_input(to_port)
|
||||||
|
|
||||||
|
deck.disconnect_nodes(from_node, to_node, from_output, to_input)
|
||||||
|
|
||||||
|
disconnect_node(from_node_name, from_port, to_node_name, to_port)
|
||||||
|
|
Loading…
Reference in a new issue