#22 ajout de menu, écran de pause, écran de fin et remaniement du dossier gui
This commit is contained in:
19
gui/game/win/scripts/win.gd
Normal file
19
gui/game/win/scripts/win.gd
Normal file
@@ -0,0 +1,19 @@
|
||||
extends Control
|
||||
|
||||
func _ready():
|
||||
visible = false
|
||||
|
||||
func win(decontamination_coverage : float):
|
||||
visible = true
|
||||
get_tree().paused = true
|
||||
%WinTitle.text = "Score : " + str(roundi(decontamination_coverage * 100)) + "%"
|
||||
|
||||
func _on_restart_pressed():
|
||||
get_tree().reload_current_scene()
|
||||
|
||||
func _on_quit_pressed():
|
||||
get_tree().quit()
|
||||
|
||||
|
||||
func _on_planet_day_limit_exceed(planet : Planet):
|
||||
win(planet.decontamination_coverage)
|
||||
1
gui/game/win/scripts/win.gd.uid
Normal file
1
gui/game/win/scripts/win.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://b3wuxv04clyed
|
||||
94
gui/game/win/win.tscn
Normal file
94
gui/game/win/win.tscn
Normal file
@@ -0,0 +1,94 @@
|
||||
[gd_scene load_steps=8 format=3 uid="uid://v41hfc7haaye"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/game/ressources/default_theme.tres" id="1_cl67j"]
|
||||
[ext_resource type="Script" uid="uid://b3wuxv04clyed" path="res://gui/game/win/scripts/win.gd" id="1_sehw2"]
|
||||
[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/game/ressources/fonts/spincycle_ot.otf" id="2_sehw2"]
|
||||
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/game/ressources/default_label_settings.tres" id="3_0b3c6"]
|
||||
[ext_resource type="Texture2D" uid="uid://bewr0t1wi8pff" path="res://gui/game/pause/assets/icons/rotate.svg" id="4_8p3aj"]
|
||||
[ext_resource type="Texture2D" uid="uid://dex283rx00fjb" path="res://gui/game/pause/assets/icons/logout.svg" id="5_j3wid"]
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_eq457"]
|
||||
font = ExtResource("2_sehw2")
|
||||
font_size = 50
|
||||
|
||||
[node name="Win" type="Control"]
|
||||
process_mode = 3
|
||||
z_index = 101
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_sehw2")
|
||||
|
||||
[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_cl67j")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Tutorial"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
theme = ExtResource("1_cl67j")
|
||||
theme_override_constants/separation = 9
|
||||
alignment = 1
|
||||
|
||||
[node name="WinTitle" type="Label" parent="Tutorial/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Score : 2%"
|
||||
label_settings = SubResource("LabelSettings_eq457")
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="ThanksTitle" type="Label" parent="Tutorial/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Thanks for playing"
|
||||
label_settings = ExtResource("3_0b3c6")
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="ThanksText" type="Label" parent="Tutorial/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "We need your feedback! Give us your thoughts on the game on our Discord or in the comments section of the Itch page."
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="HBoxContainer2" type="HBoxContainer" parent="Tutorial/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="LinkButton" type="LinkButton" parent="Tutorial/VBoxContainer/HBoxContainer2"]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("1_cl67j")
|
||||
theme_override_font_sizes/font_size = 24
|
||||
text = "Join our Discord"
|
||||
uri = "https://discord.gg/VTFKvEvgfz"
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="Tutorial/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="Restart" type="Button" parent="Tutorial/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Restart"
|
||||
icon = ExtResource("4_8p3aj")
|
||||
|
||||
[node name="Quit" type="Button" parent="Tutorial/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Quit"
|
||||
icon = ExtResource("5_j3wid")
|
||||
|
||||
[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"]
|
||||
Reference in New Issue
Block a user