test connections

This commit is contained in:
Lera Elvoé 2023-06-11 18:39:26 +03:00
parent badd1e2450
commit 2c4a937a76
No known key found for this signature in database
3 changed files with 15 additions and 2 deletions

View file

@ -21,7 +21,7 @@ func _receive(to_port: int, data: DeckType, extra_data: Array = []) -> void:
if to_port != 1:
return
# var data_to_print = data.get_value()
var data_to_print = input_ports[0].value_callback.call()
var data_to_print = data.get_value()
# var data_to_print = input_ports[0].value_callback.call()
print(data_to_print)
print("extra data: ", extra_data)

10
test.gd
View file

@ -13,6 +13,8 @@ var print_node = preload("res://classes/deck/nodes/print.gd")
func _ready() -> void:
var a = [1, 2, 3]
var b = [2, 1, 3]
add_button_button.pressed.connect(
func():
var node := deck.add_node(button_node)
@ -30,3 +32,11 @@ func _ready() -> void:
nodes_container.add_child(node_renderer)
add_print_button.disabled = true
)
connect_them_button.pressed.connect(
func():
var node_a: DeckNode = nodes_container.get_child(0).node
var node_b: DeckNode = nodes_container.get_child(1).node
deck.connect_nodes(node_a, node_b, 0, 1)
)

View file

@ -43,6 +43,9 @@ func _ready() -> void:
output_port.value_callback = port_drawer.get_text
"button":
port_drawer.add_button(output_port.label)
port_drawer.button_pressed.connect(func():
node.send(i, DeckType.DeckTypeBool.new(true))
)
_:
port_drawer.add_label(output_port.label)