Et on peut sauvegarder et charger la partie.
Et oui mon kiki
This commit is contained in:
Thomas
2025-03-29 22:28:24 +01:00
parent 95c45dcdb8
commit 8edd4bdf45
10 changed files with 98 additions and 17 deletions

View File

@@ -6,12 +6,23 @@ var destination_map = {
signal start
signal save
signal load
var instanciated_destinations = {}
func _ready() -> void:
$MarginContainer/Panel/VBoxContainer/Load.disabled = not FileAccess.file_exists("user://savegame.save")
func _on_button_pressed() -> void:
emit_signal("start")
$MarginContainer/Panel/VBoxContainer/Button.text="continue"
$MarginContainer/Panel/VBoxContainer/Start.text="Continuer"
$MarginContainer/Panel/VBoxContainer/Save.disabled = false
func _on_save_pressed() -> void:
emit_signal("save")
$MarginContainer/Panel/VBoxContainer/Load.disabled = not FileAccess.file_exists("user://savegame.save")
func _on_load_pressed() -> void:
emit_signal("load")
_on_button_pressed()

View File

@@ -48,15 +48,22 @@ vertical_alignment = 1
[node name="HSeparator" type="HSeparator" parent="MarginContainer/Panel/VBoxContainer"]
layout_mode = 2
[node name="Button" type="Button" parent="MarginContainer/Panel/VBoxContainer"]
[node name="Start" type="Button" parent="MarginContainer/Panel/VBoxContainer"]
layout_mode = 2
theme = ExtResource("3_feq31")
text = "start"
text = "Démarrer une nouvelle partie"
[node name="Save" type="Button" parent="MarginContainer/Panel/VBoxContainer"]
layout_mode = 2
theme = ExtResource("3_feq31")
text = "save"
disabled = true
text = "Sauvegarder"
[connection signal="pressed" from="MarginContainer/Panel/VBoxContainer/Button" to="." method="_on_button_pressed"]
[node name="Load" type="Button" parent="MarginContainer/Panel/VBoxContainer"]
layout_mode = 2
theme = ExtResource("3_feq31")
text = "Charger"
[connection signal="pressed" from="MarginContainer/Panel/VBoxContainer/Start" to="." method="_on_button_pressed"]
[connection signal="pressed" from="MarginContainer/Panel/VBoxContainer/Save" to="." method="_on_save_pressed"]
[connection signal="pressed" from="MarginContainer/Panel/VBoxContainer/Load" to="." method="_on_load_pressed"]