ajout de panneaux de contrôles, de paramètres et refactorisation de la gestion de l'audio
This commit is contained in:
14
gui/menu/window/content_label.tscn
Normal file
14
gui/menu/window/content_label.tscn
Normal file
@@ -0,0 +1,14 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://d3agt2njfgddb"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_qjfiv"]
|
||||
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="2_klh4u"]
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_yj6f1"]
|
||||
font = ExtResource("2_klh4u")
|
||||
font_size = 20
|
||||
font_color = Color(0.13725491, 0.39215687, 0.6666667, 1)
|
||||
|
||||
[node name="LanguageText" type="Label"]
|
||||
theme = ExtResource("1_qjfiv")
|
||||
text = "Language"
|
||||
label_settings = SubResource("LabelSettings_yj6f1")
|
||||
29
gui/menu/window/content_title.tscn
Normal file
29
gui/menu/window/content_title.tscn
Normal file
@@ -0,0 +1,29 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://cvjqp3oewr3rv"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_g1qh5"]
|
||||
[ext_resource type="Script" uid="uid://cj3o5y7cyipcs" path="res://gui/menu/window/scripts/content_title.gd" id="1_xbmdr"]
|
||||
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="2_xbmdr"]
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_58dya"]
|
||||
font = ExtResource("2_xbmdr")
|
||||
font_size = 30
|
||||
font_color = Color(0.0627451, 0.05882353, 0.16862746, 1)
|
||||
|
||||
[node name="ContentTitle" type="HBoxContainer"]
|
||||
script = ExtResource("1_xbmdr")
|
||||
title = "TITLE"
|
||||
|
||||
[node name="Text" type="Label" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme = ExtResource("1_g1qh5")
|
||||
theme_override_colors/font_color = Color(0.13725491, 0.39215687, 0.6666667, 1)
|
||||
text = "TITLE"
|
||||
label_settings = SubResource("LabelSettings_58dya")
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
custom_minimum_size = Vector2(0, 2)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 8
|
||||
color = Color(0.0627451, 0.05882353, 0.16862746, 1)
|
||||
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
|
||||
107
gui/menu/window/window.tscn
Normal file
107
gui/menu/window/window.tscn
Normal file
@@ -0,0 +1,107 @@
|
||||
[gd_scene load_steps=10 format=3 uid="uid://brxrl7sipyy6k"]
|
||||
|
||||
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="1_0d57l"]
|
||||
[ext_resource type="Script" uid="uid://bvsjrf5n8jp1i" path="res://gui/menu/window/scripts/window.gd" id="1_8s3xn"]
|
||||
[ext_resource type="Texture2D" uid="uid://ottk0ccw1d1r" path="res://common/icons/square-rounded-x.svg" id="2_8s3xn"]
|
||||
[ext_resource type="Script" uid="uid://0dhj8sdpil7q" path="res://gui/tools/control_animation_player.gd" id="2_n80be"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="4_ghh86"]
|
||||
[ext_resource type="Texture2D" uid="uid://bxrn0qho5jo7f" path="res://common/icons/square-rounded-x-nofill.svg" id="5_ghh86"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_yj6f1"]
|
||||
bg_color = Color(1, 0.6509804, 0.09019608, 1)
|
||||
corner_radius_top_left = 20
|
||||
corner_radius_top_right = 20
|
||||
corner_radius_bottom_right = 20
|
||||
corner_radius_bottom_left = 20
|
||||
expand_margin_bottom = 50.0
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_apjlw"]
|
||||
font = ExtResource("1_0d57l")
|
||||
font_size = 30
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_7c7ks"]
|
||||
bg_color = Color(1, 1, 1, 1)
|
||||
corner_radius_top_left = 20
|
||||
corner_radius_top_right = 20
|
||||
corner_radius_bottom_right = 20
|
||||
corner_radius_bottom_left = 20
|
||||
|
||||
[node name="Window" type="VBoxContainer"]
|
||||
custom_minimum_size = Vector2(700, 500)
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -250.0
|
||||
offset_top = -250.0
|
||||
offset_right = 250.00012
|
||||
offset_bottom = 250.00122
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 4
|
||||
theme_override_constants/separation = 10
|
||||
script = ExtResource("1_8s3xn")
|
||||
title = "Hello"
|
||||
|
||||
[node name="ControlAnimationPlayer" type="Node" parent="."]
|
||||
unique_name_in_owner = true
|
||||
script = ExtResource("2_n80be")
|
||||
metadata/_custom_type_script = "uid://0dhj8sdpil7q"
|
||||
|
||||
[node name="WindowHeader" type="Panel" parent="."]
|
||||
custom_minimum_size = Vector2(0, 50)
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_yj6f1")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="WindowHeader"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 10
|
||||
anchor_right = 1.0
|
||||
offset_bottom = 58.0
|
||||
grow_horizontal = 2
|
||||
theme_override_constants/margin_left = 15
|
||||
theme_override_constants/margin_top = 0
|
||||
theme_override_constants/margin_right = 15
|
||||
theme_override_constants/margin_bottom = 0
|
||||
|
||||
[node name="WindowTitle" type="Label" parent="WindowHeader/MarginContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
text = "Hello"
|
||||
label_settings = SubResource("LabelSettings_apjlw")
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="CloseButton" type="TextureButton" parent="WindowHeader/MarginContainer"]
|
||||
custom_minimum_size = Vector2(40, 40)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
size_flags_vertical = 4
|
||||
theme = ExtResource("4_ghh86")
|
||||
texture_normal = ExtResource("2_8s3xn")
|
||||
texture_hover = ExtResource("5_ghh86")
|
||||
ignore_texture_size = true
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="WindowContent" type="Panel" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_7c7ks")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="WindowContent"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme = ExtResource("4_ghh86")
|
||||
|
||||
[node name="ContentContainer" type="ScrollContainer" parent="WindowContent/MarginContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[connection signal="pressed" from="WindowHeader/MarginContainer/CloseButton" to="." method="_on_close_button_pressed"]
|
||||
Reference in New Issue
Block a user