#22 ajout de menu, écran de pause, écran de fin et remaniement du dossier gui

This commit is contained in:
2025-08-20 13:01:39 +02:00
parent 352c49cefa
commit 219e8258e7
50 changed files with 763 additions and 162 deletions

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-logout"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2" /><path d="M9 12h12l-3 -3" /><path d="M18 15l3 -3" /></svg>

After

Width:  |  Height:  |  Size: 451 B

View File

@@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dex283rx00fjb"
path="res://.godot/imported/logout.svg-adb7b7ff1fadfa9220dcf694870580b9.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://gui/game/pause/assets/icons/logout.svg"
dest_files=["res://.godot/imported/logout.svg-adb7b7ff1fadfa9220dcf694870580b9.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

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#ffffff" class="icon icon-tabler icons-tabler-filled icon-tabler-player-pause"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 4h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h2a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2z" /><path d="M17 4h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h2a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2z" /></svg>

After

Width:  |  Height:  |  Size: 412 B

View File

@@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b5cuxgisrsfgt"
path="res://.godot/imported/player-pause.svg-cb8236066c72679196b716c41226079f.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://gui/game/pause/assets/icons/player-pause.svg"
dest_files=["res://.godot/imported/player-pause.svg-cb8236066c72679196b716c41226079f.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

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#ffffff" class="icon icon-tabler icons-tabler-filled icon-tabler-player-play"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6 4v16a1 1 0 0 0 1.524 .852l13 -8a1 1 0 0 0 0 -1.704l-13 -8a1 1 0 0 0 -1.524 .852z" /></svg>

After

Width:  |  Height:  |  Size: 326 B

View File

@@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://vmsn54d1ptih"
path="res://.godot/imported/player-play.svg-25043c6a392478c90f845ddfdfb35372.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://gui/game/pause/assets/icons/player-play.svg"
dest_files=["res://.godot/imported/player-play.svg-25043c6a392478c90f845ddfdfb35372.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

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-rotate"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M19.95 11a8 8 0 1 0 -.5 4m.5 5v-5h-5" /></svg>

After

Width:  |  Height:  |  Size: 357 B

View File

@@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bewr0t1wi8pff"
path="res://.godot/imported/rotate.svg-af6a45b9d3420200a268c1390881e44f.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://gui/game/pause/assets/icons/rotate.svg"
dest_files=["res://.godot/imported/rotate.svg-af6a45b9d3420200a268c1390881e44f.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

105
gui/game/pause/pause.tscn Normal file
View File

@@ -0,0 +1,105 @@
[gd_scene load_steps=9 format=3 uid="uid://csiacsndm62ll"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/game/ressources/default_theme.tres" id="1_51ks3"]
[ext_resource type="Script" uid="uid://crt2d4m5ba25i" path="res://gui/game/pause/scripts/pause.gd" id="1_he4ox"]
[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/game/ressources/fonts/spincycle_ot.otf" id="2_8d1kg"]
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/game/ressources/default_label_settings.tres" id="3_0pdto"]
[ext_resource type="Texture2D" uid="uid://vmsn54d1ptih" path="res://gui/game/pause/assets/icons/player-play.svg" id="5_apjlw"]
[ext_resource type="Texture2D" uid="uid://bewr0t1wi8pff" path="res://gui/game/pause/assets/icons/rotate.svg" id="6_58dya"]
[ext_resource type="Texture2D" uid="uid://dex283rx00fjb" path="res://gui/game/pause/assets/icons/logout.svg" id="7_yj6f1"]
[sub_resource type="LabelSettings" id="LabelSettings_apjlw"]
font = ExtResource("2_8d1kg")
font_size = 50
[node name="Pause" type="Control"]
z_index = 10
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_he4ox")
[node name="ColorRect" type="ColorRect" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0.0352941, 0.0196078, 0.12549, 0.705882)
[node name="Tutorial" type="MarginContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("1_51ks3")
[node name="VBoxContainer" type="VBoxContainer" parent="Tutorial"]
layout_mode = 2
theme = ExtResource("1_51ks3")
theme_override_constants/separation = 9
alignment = 1
[node name="PauseTitle" type="Label" parent="Tutorial/VBoxContainer"]
layout_mode = 2
text = "Pause"
label_settings = SubResource("LabelSettings_apjlw")
horizontal_alignment = 1
[node name="StoryTitle" type="Label" parent="Tutorial/VBoxContainer"]
layout_mode = 2
text = "Story"
label_settings = ExtResource("3_0pdto")
horizontal_alignment = 1
[node name="StoryText" type="Label" parent="Tutorial/VBoxContainer"]
layout_mode = 2
text = "You are a robot who has recently arrived on a barren planet. Find and plant seeds to reduce the contamination.
You have limited energy, but can recharge when passing days.
You have 10 days to decontaminate as much as possible.
"
horizontal_alignment = 1
[node name="ControlsTitle" type="Label" parent="Tutorial/VBoxContainer"]
layout_mode = 2
text = "Controls"
label_settings = ExtResource("3_0pdto")
horizontal_alignment = 1
[node name="ControlsText" type="Label" parent="Tutorial/VBoxContainer"]
layout_mode = 2
text = "QWERTY/AZERTY/Directional Arrows : Move
E : Interact/Pickup Items
Space/Click : Use Item
W : Drop Item
"
horizontal_alignment = 1
[node name="HBoxContainer" type="HBoxContainer" parent="Tutorial/VBoxContainer"]
layout_mode = 2
alignment = 1
[node name="Resume" type="Button" parent="Tutorial/VBoxContainer/HBoxContainer"]
layout_mode = 2
text = "Resume Game"
icon = ExtResource("5_apjlw")
[node name="Restart" type="Button" parent="Tutorial/VBoxContainer/HBoxContainer"]
layout_mode = 2
text = "Restart"
icon = ExtResource("6_58dya")
[node name="Quit" type="Button" parent="Tutorial/VBoxContainer/HBoxContainer"]
layout_mode = 2
text = "Quit"
icon = ExtResource("7_yj6f1")
[connection signal="pressed" from="Tutorial/VBoxContainer/HBoxContainer/Resume" to="." method="_on_resume_pressed"]
[connection signal="pressed" from="Tutorial/VBoxContainer/HBoxContainer/Restart" to="." method="_on_restart_pressed"]
[connection signal="pressed" from="Tutorial/VBoxContainer/HBoxContainer/Quit" to="." method="_on_quit_pressed"]

View File

@@ -0,0 +1,27 @@
extends Control
var pause = false :
set(v):
print(pause)
pause = v
visible = pause
get_tree().paused = pause
func _ready():
pause = false
func _input(_event):
if Input.is_action_just_pressed("pause"):
pause = not pause
func _on_resume_pressed():
pause = false
func _on_restart_pressed():
get_tree().reload_current_scene()
func _on_quit_pressed():
get_tree().quit()
func _on_root_gui_pause_asked():
pause = true

View File

@@ -0,0 +1 @@
uid://crt2d4m5ba25i