miggor-StreamGraph/test.gd
2023-06-10 20:13:16 +03:00

32 lines
1,018 B
GDScript

extends Control
var node_renderer_scene := preload("res://test_node_renderer.tscn")
@onready var nodes_container: HBoxContainer = $NodesContainer
@onready var add_button_button: Button = $AddButtonButton
@onready var add_print_button: Button = $AddPrintButton
@onready var connect_them_button: Button = $ConnectThemButton
var deck: Deck = Deck.new()
var button_node = preload("res://classes/deck/nodes/button.gd")
var print_node = preload("res://classes/deck/nodes/print.gd")
func _ready() -> void:
add_button_button.pressed.connect(
func():
var node := deck.add_node(button_node)
var node_renderer = node_renderer_scene.instantiate()
node_renderer.node = node
nodes_container.add_child(node_renderer)
add_button_button.disabled = true
)
add_print_button.pressed.connect(
func():
var node := deck.add_node(print_node)
var node_renderer = node_renderer_scene.instantiate()
node_renderer.node = node
nodes_container.add_child(node_renderer)
add_print_button.disabled = true
)