ajout de panneaux de contrôles, de paramètres et refactorisation de la gestion de l'audio
This commit is contained in:
30
gui/menu/window/scripts/window.gd
Normal file
30
gui/menu/window/scripts/window.gd
Normal file
@@ -0,0 +1,30 @@
|
||||
@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()
|
||||
%ControlAnimationPlayer.appear()
|
||||
|
||||
func close_window():
|
||||
%ControlAnimationPlayer.disappear(0.3)
|
||||
await get_tree().create_timer(0.3).timeout
|
||||
hide()
|
||||
closed.emit()
|
||||
Reference in New Issue
Block a user