ajout de panneaux de contrôles, de paramètres et refactorisation de la gestion de l'audio
This commit is contained in:
11
gui/menu/window/scripts/content_title.gd
Normal file
11
gui/menu/window/scripts/content_title.gd
Normal file
@@ -0,0 +1,11 @@
|
||||
@tool
|
||||
extends HBoxContainer
|
||||
|
||||
@export var title : String = "" :
|
||||
set(v):
|
||||
title = v
|
||||
if is_node_ready():
|
||||
%Text.text = v
|
||||
|
||||
func _ready():
|
||||
%Text.text = title
|
||||
1
gui/menu/window/scripts/content_title.gd.uid
Normal file
1
gui/menu/window/scripts/content_title.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cj3o5y7cyipcs
|
||||
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()
|
||||
1
gui/menu/window/scripts/window.gd.uid
Normal file
1
gui/menu/window/scripts/window.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bvsjrf5n8jp1i
|
||||
Reference in New Issue
Block a user