Ajout du menu principal et des paramètres. Attention : ça ne fonctionne pas

This commit is contained in:
E213872U 2025-01-24 08:58:24 +01:00
parent ffaa27de5c
commit 432f7ccc7a
28 changed files with 69743 additions and 19 deletions

View file

@ -0,0 +1,41 @@
extends Control
@onready var menu_principal = $Menu_principal
@onready var menu_parametres = $Menu_parametres
func _ready():
menu_parametres.exit_parametres.connect(on_exit_parametres)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _on_quit_button_pressed():
"""
Entrée : Rien
Sortie : Rien
Action : Termine le programme
"""
get_tree().quit()
func _on_param_button_pressed():
menu_principal.visible = false
menu_parametres.set_process(true)
menu_parametres.visible = true
func on_exit_parametres() -> void :
menu_principal.visible = true
menu_parametres.visible = false
func _on_play_button_pressed():
print("Jouer")
func _on_load_button_pressed():
print("Charger une sauvegarde")

View file

@ -0,0 +1,200 @@
[gd_scene load_steps=7 format=3 uid="uid://bmwgfrd8butry"]
[ext_resource type="Script" path="res://menu_principal/menu_principal_affichage.gd" id="1_10mja"]
[ext_resource type="Texture2D" uid="uid://cxlv1wa2jvbux" path="res://ressources/images/menu_jeu_button.svg" id="1_502q6"]
[ext_resource type="Texture2D" uid="uid://cfcpmnwn081vb" path="res://ressources/images/menu_jeu_button_survole.svg" id="2_b8slo"]
[ext_resource type="Texture2D" uid="uid://c5q7bc5hpe6hd" path="res://ressources/images/menu_jeu_tiny_button.svg" id="3_o6osq"]
[ext_resource type="Texture2D" uid="uid://1pxsc65es708" path="res://ressources/images/menu_jeu_tiny_button_survole.svg" id="4_egxbj"]
[ext_resource type="PackedScene" uid="uid://di4chlep1t1or" path="res://parametres/menu_parametres.tscn" id="6_0lenm"]
[node name="Menu_principal_affichage" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_10mja")
[node name="ImageFond" type="TextureRect" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="Menu_principal" type="MarginContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 12
theme_override_constants/margin_top = 12
theme_override_constants/margin_right = 12
theme_override_constants/margin_bottom = 12
[node name="HBoxContainer" type="HBoxContainer" parent="Menu_principal"]
layout_mode = 2
theme_override_constants/separation = 93
[node name="VSeparator" type="VSeparator" parent="Menu_principal/HBoxContainer"]
modulate = Color(1, 1, 1, 0)
self_modulate = Color(1, 1, 1, 0)
layout_mode = 2
theme_override_constants/separation = -200
[node name="VBoxMainButton" type="VBoxContainer" parent="Menu_principal/HBoxContainer"]
layout_mode = 2
theme_override_constants/separation = 48
[node name="HSeparator" type="HSeparator" parent="Menu_principal/HBoxContainer/VBoxMainButton"]
modulate = Color(0, 0, 0, 0)
self_modulate = Color(1, 1, 1, 0)
layout_mode = 2
size_flags_vertical = 3
[node name="play_button" type="TextureButton" parent="Menu_principal/HBoxContainer/VBoxMainButton"]
layout_mode = 2
texture_normal = ExtResource("1_502q6")
texture_pressed = ExtResource("2_b8slo")
texture_hover = ExtResource("2_b8slo")
texture_focused = ExtResource("2_b8slo")
stretch_mode = 0
[node name="play_label" type="Label" parent="Menu_principal/HBoxContainer/VBoxMainButton/play_button"]
modulate = Color(0, 0, 0, 1)
layout_mode = 0
offset_right = 256.0
offset_bottom = 128.0
theme_override_font_sizes/font_size = 32
text = "Jouer"
horizontal_alignment = 1
vertical_alignment = 1
language = "fr_FR"
[node name="load_button" type="TextureButton" parent="Menu_principal/HBoxContainer/VBoxMainButton"]
layout_mode = 2
texture_normal = ExtResource("1_502q6")
texture_pressed = ExtResource("2_b8slo")
texture_hover = ExtResource("2_b8slo")
texture_focused = ExtResource("2_b8slo")
stretch_mode = 0
[node name="load_label" type="Label" parent="Menu_principal/HBoxContainer/VBoxMainButton/load_button"]
modulate = Color(0, 0, 0, 1)
layout_mode = 0
offset_right = 256.0
offset_bottom = 128.0
theme_override_font_sizes/font_size = 32
text = "Charger
"
horizontal_alignment = 1
vertical_alignment = 1
language = "fr_FR"
[node name="quit_button" type="TextureButton" parent="Menu_principal/HBoxContainer/VBoxMainButton"]
layout_mode = 2
texture_normal = ExtResource("1_502q6")
texture_pressed = ExtResource("2_b8slo")
texture_hover = ExtResource("2_b8slo")
texture_focused = ExtResource("2_b8slo")
stretch_mode = 0
[node name="quit_label" type="Label" parent="Menu_principal/HBoxContainer/VBoxMainButton/quit_button"]
modulate = Color(0, 0, 0, 1)
layout_mode = 0
offset_right = 256.0
offset_bottom = 128.0
theme_override_font_sizes/font_size = 32
text = "Quitter"
horizontal_alignment = 1
vertical_alignment = 1
language = "fr_FR"
[node name="HSeparator2" type="HSeparator" parent="Menu_principal/HBoxContainer/VBoxMainButton"]
modulate = Color(0, 0, 0, 0)
self_modulate = Color(1, 1, 1, 0)
layout_mode = 2
size_flags_vertical = 3
[node name="VSeparator2" type="VSeparator" parent="Menu_principal/HBoxContainer"]
modulate = Color(1, 1, 1, 0)
self_modulate = Color(1, 1, 1, 0)
layout_mode = 2
size_flags_horizontal = 3
[node name="VBoxSideButton" type="VBoxContainer" parent="Menu_principal/HBoxContainer"]
layout_mode = 2
theme_override_constants/separation = 30
[node name="HSeparator" type="HSeparator" parent="Menu_principal/HBoxContainer/VBoxSideButton"]
modulate = Color(1, 1, 1, 0)
self_modulate = Color(1, 1, 1, 0)
layout_mode = 2
size_flags_vertical = 3
theme_override_constants/separation = 355
[node name="param_button" type="TextureButton" parent="Menu_principal/HBoxContainer/VBoxSideButton"]
custom_minimum_size = Vector2(150, 0)
layout_mode = 2
texture_normal = ExtResource("3_o6osq")
texture_pressed = ExtResource("4_egxbj")
texture_hover = ExtResource("4_egxbj")
texture_focused = ExtResource("4_egxbj")
stretch_mode = 0
[node name="param_label" type="Label" parent="Menu_principal/HBoxContainer/VBoxSideButton/param_button"]
modulate = Color(0, 0, 0, 1)
layout_mode = 0
offset_right = 150.0
offset_bottom = 64.0
theme_override_font_sizes/font_size = 17
text = "Paramètres"
horizontal_alignment = 1
vertical_alignment = 1
language = "fr_FR"
[node name="credit_button" type="TextureButton" parent="Menu_principal/HBoxContainer/VBoxSideButton"]
layout_mode = 2
texture_normal = ExtResource("3_o6osq")
texture_pressed = ExtResource("4_egxbj")
texture_hover = ExtResource("4_egxbj")
texture_focused = ExtResource("4_egxbj")
stretch_mode = 0
[node name="credit_label" type="Label" parent="Menu_principal/HBoxContainer/VBoxSideButton/credit_button"]
modulate = Color(0, 0, 0, 1)
layout_mode = 0
offset_right = 150.0
offset_bottom = 64.0
theme_override_font_sizes/font_size = 25
text = "Crédits"
horizontal_alignment = 1
vertical_alignment = 1
language = "fr_FR"
[node name="HSeparator2" type="HSeparator" parent="Menu_principal/HBoxContainer/VBoxSideButton"]
modulate = Color(1, 1, 1, 0)
self_modulate = Color(1, 1, 1, 0)
layout_mode = 2
theme_override_constants/separation = 10
[node name="VSeparator3" type="VSeparator" parent="Menu_principal/HBoxContainer"]
modulate = Color(1, 1, 1, 0)
self_modulate = Color(1, 1, 1, 0)
layout_mode = 2
[node name="Menu_parametres" parent="." instance=ExtResource("6_0lenm")]
visible = false
layout_mode = 1
[node name="MusiqueFond" type="AudioStreamPlayer" parent="."]
autoplay = true
[connection signal="pressed" from="Menu_principal/HBoxContainer/VBoxMainButton/play_button" to="." method="_on_play_button_pressed"]
[connection signal="pressed" from="Menu_principal/HBoxContainer/VBoxMainButton/load_button" to="." method="_on_load_button_pressed"]
[connection signal="pressed" from="Menu_principal/HBoxContainer/VBoxMainButton/quit_button" to="." method="_on_quit_button_pressed"]
[connection signal="pressed" from="Menu_principal/HBoxContainer/VBoxSideButton/param_button" to="." method="_on_param_button_pressed"]

View file

@ -0,0 +1,49 @@
[gd_scene load_steps=2 format=3 uid="uid://n5vmjs3xhmma"]
[ext_resource type="Script" path="res://parametres/assign_menu/assigner_bouton.gd" id="1_jtqf2"]
[node name="assigner_bouton" type="Control" groups=["changer_touches"]]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_jtqf2")
[node name="HBoxContainer" type="HBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -268.5
offset_top = -26.5
offset_right = 268.5
offset_bottom = 26.5
grow_horizontal = 2
grow_vertical = 2
alignment = 1
[node name="Label" type="Label" parent="HBoxContainer"]
custom_minimum_size = Vector2(200, 40)
layout_mode = 2
theme_override_font_sizes/font_size = 32
text = "ACTION"
vertical_alignment = 1
[node name="VSeparator" type="VSeparator" parent="HBoxContainer"]
modulate = Color(1, 1, 1, 0)
self_modulate = Color(1, 1, 1, 0)
custom_minimum_size = Vector2(50, 0)
layout_mode = 2
[node name="Button" type="Button" parent="HBoxContainer"]
custom_minimum_size = Vector2(75, 75)
layout_mode = 2
theme_override_font_sizes/font_size = 32
text = "BOUTON ACTION
"
[connection signal="pressed" from="HBoxContainer/Button" to="." method="_on_button_pressed"]

View file

@ -0,0 +1,67 @@
class_name Assigner_Bouton
extends Control
@onready var label = $HBoxContainer/Label as Label
@onready var button = $HBoxContainer/Button as Button
@export var nom_action : String = "BOUGER_HAUT"
var nom_touche : String = OS.get_keycode_string(InputMap.action_get_events(nom_action)[0].physical_keycode)
# Called when the node enters the scene tree for the first time.
func _ready():
set_process_unhandled_key_input(false)
set_texte_label()
set_texte_bouton()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func set_texte_label() -> void :
label.text = "Non assignée"
match nom_action :
"BOUGER_HAUT":
label.text = "monter"
"BOUGER_BAS":
label.text = "descendre"
"BOUGER_DROITE":
label.text = "droite"
"BOUGER_GAUCHE":
label.text = "gauche"
"PAUSE":
label.text = "Pause"
func set_texte_bouton() -> void:
nom_touche = OS.get_keycode_string(InputMap.action_get_events(nom_action)[0].physical_keycode)
button.text = "%s" % nom_touche
func definir_touche(touche)-> void:
var old = InputMap.action_get_events(nom_action)[0]
var action_keycode=touche.physical_keycode
InputMap.action_erase_events(nom_action)
InputMap.action_add_event(nom_action, touche)
set_texte_bouton()
for i in get_tree().get_nodes_in_group("changer_touches"):
if i.nom_action != self.nom_action :
if i.nom_touche==self.nom_touche :
i.definir_touche(old)
func _on_button_pressed():
button.text = "Appuyez sur une touche..."
set_process_unhandled_key_input(true)
func _unhandled_key_input(event):
definir_touche(event)
set_process_unhandled_key_input(false)
func _on_hidden():
set_process_unhandled_key_input(true)
set_texte_bouton()

View file

@ -0,0 +1,50 @@
[gd_scene load_steps=2 format=3 uid="uid://n5vmjs3xhmma"]
[ext_resource type="Script" path="res://parametres/assign_menu/assigner_bouton.gd" id="1_jtqf2"]
[node name="assigner_bouton" type="Control" groups=["changer_touches"]]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_jtqf2")
[node name="HBoxContainer" type="HBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -268.5
offset_top = -26.5
offset_right = 268.5
offset_bottom = 26.5
grow_horizontal = 2
grow_vertical = 2
alignment = 1
[node name="Label" type="Label" parent="HBoxContainer"]
custom_minimum_size = Vector2(200, 40)
layout_mode = 2
theme_override_font_sizes/font_size = 32
text = "ACTION"
vertical_alignment = 1
[node name="VSeparator" type="VSeparator" parent="HBoxContainer"]
modulate = Color(1, 1, 1, 0)
self_modulate = Color(1, 1, 1, 0)
custom_minimum_size = Vector2(50, 0)
layout_mode = 2
size_flags_horizontal = 3
[node name="Button" type="Button" parent="HBoxContainer"]
custom_minimum_size = Vector2(150, 75)
layout_mode = 2
theme_override_font_sizes/font_size = 32
text = "BOUTON_ACTION"
[connection signal="hidden" from="." to="." method="_on_hidden"]
[connection signal="pressed" from="HBoxContainer/Button" to="." method="_on_button_pressed"]

View file

@ -0,0 +1,52 @@
extends Control
@onready var option_button = $HBoxContainer/OptionButton as OptionButton
const MODE_FENETRE_LISTE : Array[String] = [
"Plein écran",
"Fenetré",
"Fenetré sans bordure",
"Plein écran sans bordure"
]
# Called when the node enters the scene tree for the first time.
func _ready():
add_window_mode_items()
option_button.item_selected.connect(on_window_mode_selected)
set_default_status()
func set_default_status() -> void :
if DisplayServer.window_get_mode() == DisplayServer.WINDOW_MODE_WINDOWED :
if DisplayServer.window_get_flag(DisplayServer.WINDOW_FLAG_BORDERLESS) :
option_button.select(2)
else :
option_button.select(1)
else :
if DisplayServer.window_get_flag(DisplayServer.WINDOW_FLAG_BORDERLESS) :
option_button.select(3)
else :
option_button.select(0)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func add_window_mode_items() -> void:
for mode_fenetre in MODE_FENETRE_LISTE:
option_button.add_item(mode_fenetre)
func on_window_mode_selected (index : int) -> void :
match index:
0: #Fullscreen
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)
DisplayServer.window_set_flag(DisplayServer.WINDOW_FLAG_BORDERLESS, false)
1: #Windowed
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED)
DisplayServer.window_set_flag(DisplayServer.WINDOW_FLAG_BORDERLESS, false)
2: #Windowed Borderless
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED)
DisplayServer.window_set_flag(DisplayServer.WINDOW_FLAG_BORDERLESS, true)
3: #Fullscreen Borderless
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)
DisplayServer.window_set_flag(DisplayServer.WINDOW_FLAG_BORDERLESS, true)

View file

@ -0,0 +1,13 @@
[gd_scene load_steps=3 format=3 uid="uid://bql1rrrswwr0y"]
[ext_resource type="PackedScene" uid="uid://bbnto4k0qufd7" path="res://parametres/drop_menu/drop_menu_parametres.tscn" id="1_uosn5"]
[ext_resource type="Script" path="res://parametres/drop_menu/drop_menu_fenetre.gd" id="2_s8chm"]
[node name="Drop_Menu_Parametres_Feunetre" instance=ExtResource("1_uosn5")]
script = ExtResource("2_s8chm")
[node name="HBoxContainer" parent="." index="0"]
alignment = 1
[node name="Label" parent="HBoxContainer" index="1"]
text = "Mode d'affichage"

View file

@ -0,0 +1,50 @@
[gd_scene format=3 uid="uid://bbnto4k0qufd7"]
[node name="Drop_Menu_Parametres" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_right = -375.0
offset_bottom = -586.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
[node name="HBoxContainer" type="HBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/separation = 42
[node name="VSeparator" type="VSeparator" parent="HBoxContainer"]
modulate = Color(1, 1, 1, 0)
self_modulate = Color(1, 1, 1, 0)
layout_mode = 2
size_flags_horizontal = 3
[node name="Label" type="Label" parent="HBoxContainer"]
custom_minimum_size = Vector2(264, 0)
layout_mode = 2
theme_override_font_sizes/font_size = 32
text = "TEXTE_PAR_DEFAUT"
vertical_alignment = 1
[node name="VSeparator2" type="VSeparator" parent="HBoxContainer"]
modulate = Color(1, 1, 1, 0)
self_modulate = Color(1, 1, 1, 0)
layout_mode = 2
[node name="OptionButton" type="OptionButton" parent="HBoxContainer"]
custom_minimum_size = Vector2(256, 64)
layout_mode = 2
theme_override_font_sizes/font_size = 32
[node name="VSeparator3" type="VSeparator" parent="HBoxContainer"]
modulate = Color(1, 1, 1, 0)
self_modulate = Color(1, 1, 1, 0)
layout_mode = 2
size_flags_horizontal = 3

View file

@ -0,0 +1,34 @@
extends Control
@onready var option_button = $HBoxContainer/OptionButton as OptionButton
const RESOLUTION_DICT : Dictionary = {
"1152 x 648" : Vector2i(1152, 648),
"1280 x 720" : Vector2i(1280, 720),
"1920 x 1080" : Vector2i(1920, 1080),
}
# Called when the node enters the scene tree for the first time.
func _ready():
add_resolution_items()
option_button.item_selected.connect(on_resolution_selected)
set_default_status()
func set_default_status() -> void :
if DisplayServer.window_get_size() == Vector2i(1280, 720) :
option_button.select(1)
elif DisplayServer.window_get_size() == Vector2i(1920, 1080):
option_button.select(2)
else :
option_button.select(0)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func add_resolution_items() -> void:
for resolution in RESOLUTION_DICT:
option_button.add_item(resolution)
func on_resolution_selected (index : int) -> void :
DisplayServer.window_set_size(RESOLUTION_DICT.values()[index])

View file

@ -0,0 +1,10 @@
[gd_scene load_steps=3 format=3 uid="uid://d30k33gvnoo46"]
[ext_resource type="PackedScene" uid="uid://bbnto4k0qufd7" path="res://parametres/drop_menu/drop_menu_parametres.tscn" id="1_ufhut"]
[ext_resource type="Script" path="res://parametres/drop_menu/drop_menu_resolution.gd" id="2_53mh2"]
[node name="Drop_Menu_Resolution" instance=ExtResource("1_ufhut")]
script = ExtResource("2_53mh2")
[node name="Label" parent="HBoxContainer" index="1"]
text = "Résolution"

View file

@ -0,0 +1,17 @@
extends Control
signal exit_parametres
# Called when the node enters the scene tree for the first time.
func _ready():
set_process(false)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _on_exit_button_pressed():
exit_parametres.emit()
set_process(false)

View file

@ -0,0 +1,80 @@
[gd_scene load_steps=6 format=3 uid="uid://di4chlep1t1or"]
[ext_resource type="Script" path="res://parametres/menu_parametres.gd" id="1_2rsun"]
[ext_resource type="PackedScene" uid="uid://d0ulsovtj84go" path="res://parametres/tab_parametres.tscn" id="2_hg7gg"]
[ext_resource type="Texture2D" uid="uid://c5q7bc5hpe6hd" path="res://ressources/images/menu_jeu_tiny_button.svg" id="3_28efj"]
[ext_resource type="Texture2D" uid="uid://1pxsc65es708" path="res://ressources/images/menu_jeu_tiny_button_survole.svg" id="4_fo4ob"]
[sub_resource type="SystemFont" id="SystemFont_ur4bm"]
font_names = PackedStringArray("Yu Gothic UI")
subpixel_positioning = 0
[node name="Menu_parametres" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_2rsun")
[node name="TabContainer" type="MarginContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 12
theme_override_constants/margin_top = 12
theme_override_constants/margin_right = 12
theme_override_constants/margin_bottom = 12
[node name="VBoxContainer" type="VBoxContainer" parent="TabContainer"]
layout_mode = 2
[node name="VSeparator" type="VSeparator" parent="TabContainer/VBoxContainer"]
layout_mode = 2
theme_override_constants/separation = 15
[node name="Label" type="Label" parent="TabContainer/VBoxContainer"]
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 10
theme_override_fonts/font = SubResource("SystemFont_ur4bm")
theme_override_font_sizes/font_size = 40
text = "Options"
horizontal_alignment = 1
vertical_alignment = 1
[node name="Tab_Parametres" parent="TabContainer/VBoxContainer" instance=ExtResource("2_hg7gg")]
layout_mode = 2
size_flags_vertical = 3
[node name="exit_button" type="TextureButton" parent="TabContainer/VBoxContainer"]
custom_minimum_size = Vector2(160, 50)
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 8
texture_normal = ExtResource("3_28efj")
texture_pressed = ExtResource("4_fo4ob")
texture_hover = ExtResource("4_fo4ob")
texture_focused = ExtResource("4_fo4ob")
stretch_mode = 0
[node name="Label" type="Label" parent="TabContainer/VBoxContainer/exit_button"]
modulate = Color(0, 0, 0, 1)
self_modulate = Color(0, 0, 0, 1)
layout_mode = 0
offset_right = 160.0
offset_bottom = 64.0
theme_override_font_sizes/font_size = 32
text = "Retour"
horizontal_alignment = 1
vertical_alignment = 1
[node name="VSeparator2" type="VSeparator" parent="TabContainer/VBoxContainer"]
layout_mode = 2
theme_override_constants/separation = 15
[connection signal="pressed" from="TabContainer/VBoxContainer/exit_button" to="." method="_on_exit_button_pressed"]

View file

@ -0,0 +1,46 @@
extends Control
@onready var nom_audio = $HBoxContainer/Nom_Audio as Label
@onready var valeur_audio = $HBoxContainer/Valeur_Audio as Label
@onready var h_slider = $HBoxContainer/HSlider as HSlider
@export_enum("Master", "Music", "Sfx") var bus_name : String
var bus_index : int = 0
# Called when the node enters the scene tree for the first time.
func _ready():
h_slider.value_changed.connect(on_value_changed)
connect_bus_index()
set_nom_audio()
set_slider_value()
func set_nom_audio () -> void :
match bus_name:
"Master" :
nom_audio.text = str("Général")
"Music" :
nom_audio.text = str("Musique")
"Sfx" :
nom_audio.text = str("Effets Sonores")
func set_valeur_audio () -> void :
valeur_audio.text = str(h_slider.value * 100) + " %"
func on_value_changed(value : float) -> void :
AudioServer.set_bus_volume_db(bus_index, linear_to_db(value))
set_valeur_audio()
func set_slider_value () -> void:
h_slider.value = db_to_linear(AudioServer.get_bus_volume_db(bus_index))
set_valeur_audio()
func connect_bus_index () -> void :
bus_index = AudioServer.get_bus_index(bus_name)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass

View file

@ -0,0 +1,68 @@
[gd_scene load_steps=2 format=3 uid="uid://dah5m6qsf1fdr"]
[ext_resource type="Script" path="res://parametres/slide_menu/slide_menu_parametres.gd" id="1_q83rq"]
[node name="slide_menu_parametres" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_right = -375.0
offset_bottom = -594.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
script = ExtResource("1_q83rq")
bus_name = "Master"
[node name="HBoxContainer" type="HBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/separation = 42
[node name="VSeparator" type="VSeparator" parent="HBoxContainer"]
modulate = Color(1, 1, 1, 0)
self_modulate = Color(1, 1, 1, 0)
layout_mode = 2
size_flags_horizontal = 3
[node name="Nom_Audio" type="Label" parent="HBoxContainer"]
custom_minimum_size = Vector2(300, 0)
layout_mode = 2
theme_override_font_sizes/font_size = 32
text = "TEXTE_PAR_DEFAUT
"
[node name="VSeparator2" type="VSeparator" parent="HBoxContainer"]
modulate = Color(1, 1, 1, 0)
self_modulate = Color(1, 1, 1, 0)
layout_mode = 2
[node name="HSlider" type="HSlider" parent="HBoxContainer"]
custom_minimum_size = Vector2(200, 32)
layout_mode = 2
size_flags_vertical = 1
max_value = 1.0
step = 0.01
[node name="VSeparator3" type="VSeparator" parent="HBoxContainer"]
modulate = Color(1, 1, 1, 0)
self_modulate = Color(1, 1, 1, 0)
layout_mode = 2
[node name="Valeur_Audio" type="Label" parent="HBoxContainer"]
custom_minimum_size = Vector2(95, 0)
layout_mode = 2
theme_override_font_sizes/font_size = 32
text = "100 %
"
[node name="VSeparator4" type="VSeparator" parent="HBoxContainer"]
modulate = Color(1, 1, 1, 0)
self_modulate = Color(1, 1, 1, 0)
layout_mode = 2
size_flags_horizontal = 3

View file

@ -0,0 +1,219 @@
[gd_scene load_steps=6 format=3 uid="uid://d0ulsovtj84go"]
[ext_resource type="PackedScene" uid="uid://bql1rrrswwr0y" path="res://parametres/drop_menu/drop_menu_fenetre.tscn" id="1_josna"]
[ext_resource type="PackedScene" uid="uid://d30k33gvnoo46" path="res://parametres/drop_menu/drop_menu_resolution.tscn" id="2_ar3u0"]
[ext_resource type="PackedScene" uid="uid://dah5m6qsf1fdr" path="res://parametres/slide_menu/slide_menu_parametres.tscn" id="3_4tew8"]
[ext_resource type="PackedScene" uid="uid://n5vmjs3xhmma" path="res://parametres/assign_menu/assigner_bouton.tscn" id="4_chw0c"]
[sub_resource type="GDScript" id="GDScript_nexub"]
script/source = "extends Control
@onready var commandes = $TabContainer/Commandes
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _on_commandes_tab_changed(tab):
if tab != 2 :
commandes.MarginContainer.ScrollContainer.VBoxContainer.assigner_bouton.set_process_unhandled_key_input(false)
commandes.MarginContainer.ScrollContainer.VBoxContainer.assigner_bouton2.set_process_unhandled_key_input(false)
"
[node name="Tab_Parametres" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = SubResource("GDScript_nexub")
[node name="TabContainer" type="TabContainer" parent="."]
layout_mode = 1
anchors_preset = -1
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 100.0
offset_top = 50.0
offset_right = -100.0
offset_bottom = -50.0
grow_horizontal = 2
grow_vertical = 2
tab_alignment = 1
current_tab = 0
[node name="Affichage" type="TabBar" parent="TabContainer"]
layout_mode = 2
metadata/_tab_index = 0
[node name="MarginContainer" type="MarginContainer" parent="TabContainer/Affichage"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 24
theme_override_constants/margin_top = 24
theme_override_constants/margin_right = 24
theme_override_constants/margin_bottom = 24
[node name="ScrollContainer" type="ScrollContainer" parent="TabContainer/Affichage/MarginContainer"]
layout_mode = 2
[node name="VBoxContainer2" type="VBoxContainer" parent="TabContainer/Affichage/MarginContainer/ScrollContainer"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_constants/separation = 90
alignment = 1
[node name="HSeparator" type="HSeparator" parent="TabContainer/Affichage/MarginContainer/ScrollContainer/VBoxContainer2"]
modulate = Color(0.105882, 0.105882, 0.105882, 0)
self_modulate = Color(1, 1, 1, 0)
layout_mode = 2
[node name="Drop_Menu_Parametres_Feunetre" parent="TabContainer/Affichage/MarginContainer/ScrollContainer/VBoxContainer2" instance=ExtResource("1_josna")]
layout_mode = 2
size_flags_horizontal = 1
size_flags_vertical = 3
[node name="Drop_Menu_Resolution" parent="TabContainer/Affichage/MarginContainer/ScrollContainer/VBoxContainer2" instance=ExtResource("2_ar3u0")]
layout_mode = 2
size_flags_horizontal = 1
size_flags_vertical = 3
[node name="Son" type="TabBar" parent="TabContainer"]
visible = false
layout_mode = 2
metadata/_tab_index = 1
[node name="MarginContainer" type="MarginContainer" parent="TabContainer/Son"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 24
theme_override_constants/margin_top = 24
theme_override_constants/margin_right = 24
theme_override_constants/margin_bottom = 24
[node name="ScrollContainer" type="ScrollContainer" parent="TabContainer/Son/MarginContainer"]
layout_mode = 2
[node name="VBoxContainer" type="VBoxContainer" parent="TabContainer/Son/MarginContainer/ScrollContainer"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_constants/separation = 64
alignment = 1
[node name="Label" type="Label" parent="TabContainer/Son/MarginContainer/ScrollContainer/VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 32
text = "Volume"
horizontal_alignment = 1
vertical_alignment = 1
[node name="slide_menu_parametres" parent="TabContainer/Son/MarginContainer/ScrollContainer/VBoxContainer" instance=ExtResource("3_4tew8")]
layout_mode = 2
size_flags_vertical = 3
[node name="slide_menu_parametres2" parent="TabContainer/Son/MarginContainer/ScrollContainer/VBoxContainer" instance=ExtResource("3_4tew8")]
layout_mode = 2
bus_name = "Music"
[node name="slide_menu_parametres3" parent="TabContainer/Son/MarginContainer/ScrollContainer/VBoxContainer" instance=ExtResource("3_4tew8")]
layout_mode = 2
bus_name = "Sfx"
[node name="Commandes" type="TabBar" parent="TabContainer"]
visible = false
layout_mode = 2
metadata/_tab_index = 2
[node name="MarginContainer" type="MarginContainer" parent="TabContainer/Commandes"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 24
theme_override_constants/margin_top = 24
theme_override_constants/margin_right = 24
theme_override_constants/margin_bottom = 24
[node name="ScrollContainer" type="ScrollContainer" parent="TabContainer/Commandes/MarginContainer"]
layout_mode = 2
[node name="VBoxContainer" type="VBoxContainer" parent="TabContainer/Commandes/MarginContainer/ScrollContainer"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_constants/separation = 90
alignment = 1
[node name="HSeparator" type="HSeparator" parent="TabContainer/Commandes/MarginContainer/ScrollContainer/VBoxContainer"]
modulate = Color(1, 1, 1, 0)
self_modulate = Color(1, 1, 1, 0)
layout_mode = 2
[node name="assigner_bouton3" parent="TabContainer/Commandes/MarginContainer/ScrollContainer/VBoxContainer" instance=ExtResource("4_chw0c")]
layout_mode = 2
[node name="assigner_bouton2" parent="TabContainer/Commandes/MarginContainer/ScrollContainer/VBoxContainer" instance=ExtResource("4_chw0c")]
layout_mode = 2
nom_action = "PAUSE"
[node name="HSeparator2" type="HSeparator" parent="TabContainer/Commandes/MarginContainer/ScrollContainer/VBoxContainer"]
modulate = Color(1, 1, 1, 0)
self_modulate = Color(1, 1, 1, 0)
layout_mode = 2
[node name="Accessibilité" type="TabBar" parent="TabContainer"]
visible = false
layout_mode = 2
metadata/_tab_index = 3
[node name="MarginContainer" type="MarginContainer" parent="TabContainer/Accessibilité"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 24
theme_override_constants/margin_top = 24
theme_override_constants/margin_right = 24
theme_override_constants/margin_bottom = 24
[node name="ScrollContainer" type="ScrollContainer" parent="TabContainer/Accessibilité/MarginContainer"]
layout_mode = 2
[node name="VBoxContainer2" type="VBoxContainer" parent="TabContainer/Accessibilité/MarginContainer/ScrollContainer"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_constants/separation = 90
alignment = 1
[node name="HSeparator" type="HSeparator" parent="TabContainer/Accessibilité/MarginContainer/ScrollContainer/VBoxContainer2"]
modulate = Color(0.105882, 0.105882, 0.105882, 0)
self_modulate = Color(1, 1, 1, 0)
layout_mode = 2
[node name="Label" type="Label" parent="TabContainer/Accessibilité/MarginContainer/ScrollContainer/VBoxContainer2"]
layout_mode = 2
text = "Taille de la police"
[node name="Label2" type="Label" parent="TabContainer/Accessibilité/MarginContainer/ScrollContainer/VBoxContainer2"]
layout_mode = 2
text = "Langue du jeu"
[connection signal="tab_changed" from="TabContainer/Commandes" to="." method="_on_commandes_tab_changed"]

View file

@ -11,9 +11,38 @@ config_version=5
[application]
config/name="code-game-jam-drop-plafond-2025"
run/main_scene="res://menu_principal/menu_principal_affichage.tscn"
config/features=PackedStringArray("4.3", "GL Compatibility")
config/icon="res://ressources/images/icon.svg"
[input]
bouger_haut={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":90,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
bouger_bas={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
bouger_droite={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
bouger_gauche={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":81,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
pause={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194305,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
[rendering]
renderer/rendering_method="gl_compatibility"

View file

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="124" height="124" x="2" y="2" fill="#363d52" stroke="#212532" stroke-width="4" rx="14"/><g fill="#fff" transform="translate(12.322 12.322)scale(.101)"><path d="M105 673v33q407 354 814 0v-33z"/><path fill="#478cbf" d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 814 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H446l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z"/><path d="M483 600c0 34 58 34 58 0v-86c0-34-58-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042" transform="translate(12.322 12.322)scale(.101)"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></svg>
<svg height="128" width="128" xmlns="http://www.w3.org/2000/svg"><rect x="2" y="2" width="124" height="124" rx="14" fill="#363d52" stroke="#212532" stroke-width="4"/><g transform="scale(.101) translate(122 122)"><g fill="#fff"><path d="M105 673v33q407 354 814 0v-33z"/><path d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 814 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H446l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z" fill="#478cbf"/><path d="M483 600c0 34 58 34 58 0v-86c0-34-58-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 994 B

After

Width:  |  Height:  |  Size: 949 B

View file

@ -2,7 +2,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://dqkqwj2ra7eam"
uid="uid://b4viqupj5q0je"
path="res://.godot/imported/icon.svg-eaaeb9af277c6e0c26291b9e614ad8ec.ctex"
metadata={
"vram_texture": false

File diff suppressed because it is too large Load diff

After

Width:  |  Height:  |  Size: 1.5 MiB

View file

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cxlv1wa2jvbux"
path="res://.godot/imported/menu_jeu_button.svg-bb0678d9ee874906f85ba3730e798e02.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://ressources/images/menu_jeu_button.svg"
dest_files=["res://.godot/imported/menu_jeu_button.svg-bb0678d9ee874906f85ba3730e798e02.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

File diff suppressed because it is too large Load diff

After

Width:  |  Height:  |  Size: 1.6 MiB

View file

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cfcpmnwn081vb"
path="res://.godot/imported/menu_jeu_button_survole.svg-aec0b4b13429ad0ba30c79b4a086a702.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://ressources/images/menu_jeu_button_survole.svg"
dest_files=["res://.godot/imported/menu_jeu_button_survole.svg-aec0b4b13429ad0ba30c79b4a086a702.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

File diff suppressed because it is too large Load diff

After

Width:  |  Height:  |  Size: 417 KiB

View file

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c5q7bc5hpe6hd"
path="res://.godot/imported/menu_jeu_tiny_button.svg-0f7c0530b14bc9f311f3c483a06a81b1.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://ressources/images/menu_jeu_tiny_button.svg"
dest_files=["res://.godot/imported/menu_jeu_tiny_button.svg-0f7c0530b14bc9f311f3c483a06a81b1.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

File diff suppressed because it is too large Load diff

After

Width:  |  Height:  |  Size: 438 KiB

View file

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://1pxsc65es708"
path="res://.godot/imported/menu_jeu_tiny_button_survole.svg-b69353f9c2bd0ab4149b1e6dd5cf8a50.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://ressources/images/menu_jeu_tiny_button_survole.svg"
dest_files=["res://.godot/imported/menu_jeu_tiny_button_survole.svg-b69353f9c2bd0ab4149b1e6dd5cf8a50.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -1,11 +0,0 @@
extends Node2D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass

View file

@ -1,6 +0,0 @@
[gd_scene load_steps=2 format=3 uid="uid://coaq6o6ml6nit"]
[ext_resource type="Script" path="res://scene 1/exemple.gd" id="1_68r4l"]
[node name="Node2D" type="Node2D"]
script = ExtResource("1_68r4l")