@tool extends VBoxContainer class_name GuiWindow signal closed @export var title : String : set = update_title @export_tool_button("Open", "Callable") var open_action = open_window @export_tool_button("Close", "Callable") var close_action = close_window func _ready(): update_title(title) func update_title(text : String): title = text if (is_node_ready()): %WindowTitle.text = title func _on_close_button_pressed(): close_window() func open_window(): show() modulate.a = 0. var tween = create_tween() tween.tween_property(self, 'modulate:a', 1, 0.3) func close_window(): if visible: modulate.a = 1. var tween = create_tween() tween.tween_property(self, 'modulate:a', 0, 0.3) await tween.finished hide() closed.emit()