extends Control


var current_inspected: Control

func _ready() -> void:
	GuiSignalBus.add_buttons.connect(add_buttons)
	GuiSignalBus.clear_buttons.connect(clear_buttons)

func clear_buttons() -> void:
	if current_inspected:
		current_inspected.queue_free()

func add_buttons(buttons: Control) -> void:
	clear_buttons()
	
	current_inspected = buttons
	add_child(buttons)
