Implement save overwrite confirmation (#368)
* Implement save overwrite confirmation + fixed pause game not pausing game execution. * docs: Automatic update of API docs Co-authored-by: StraToN <StraToN@users.noreply.github.com>
This commit is contained in:
@@ -13,121 +13,121 @@ atlas = ExtResource( 4 )
|
||||
region = Rect2( 120, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=2]
|
||||
atlas = ExtResource( 4 )
|
||||
region = Rect2( 24, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=3]
|
||||
atlas = ExtResource( 5 )
|
||||
atlas = ExtResource( 2 )
|
||||
region = Rect2( 0, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=4]
|
||||
atlas = ExtResource( 5 )
|
||||
[sub_resource type="AtlasTexture" id=3]
|
||||
atlas = ExtResource( 2 )
|
||||
region = Rect2( 24, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=4]
|
||||
atlas = ExtResource( 2 )
|
||||
region = Rect2( 48, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=5]
|
||||
atlas = ExtResource( 5 )
|
||||
atlas = ExtResource( 4 )
|
||||
region = Rect2( 48, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=6]
|
||||
atlas = ExtResource( 6 )
|
||||
atlas = ExtResource( 7 )
|
||||
region = Rect2( 0, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=7]
|
||||
atlas = ExtResource( 6 )
|
||||
atlas = ExtResource( 7 )
|
||||
region = Rect2( 24, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=8]
|
||||
atlas = ExtResource( 2 )
|
||||
region = Rect2( 0, 0, 24, 70 )
|
||||
atlas = ExtResource( 7 )
|
||||
region = Rect2( 48, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=9]
|
||||
atlas = ExtResource( 2 )
|
||||
region = Rect2( 24, 0, 24, 70 )
|
||||
atlas = ExtResource( 7 )
|
||||
region = Rect2( 72, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=10]
|
||||
atlas = ExtResource( 2 )
|
||||
region = Rect2( 48, 0, 24, 70 )
|
||||
atlas = ExtResource( 7 )
|
||||
region = Rect2( 96, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=11]
|
||||
atlas = ExtResource( 4 )
|
||||
region = Rect2( 48, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=12]
|
||||
atlas = ExtResource( 7 )
|
||||
region = Rect2( 0, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=13]
|
||||
atlas = ExtResource( 7 )
|
||||
region = Rect2( 24, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=14]
|
||||
atlas = ExtResource( 7 )
|
||||
region = Rect2( 48, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=15]
|
||||
atlas = ExtResource( 7 )
|
||||
region = Rect2( 72, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=16]
|
||||
atlas = ExtResource( 7 )
|
||||
region = Rect2( 96, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=17]
|
||||
atlas = ExtResource( 4 )
|
||||
region = Rect2( 144, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=18]
|
||||
[sub_resource type="AtlasTexture" id=12]
|
||||
atlas = ExtResource( 4 )
|
||||
region = Rect2( 168, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=19]
|
||||
[sub_resource type="AtlasTexture" id=13]
|
||||
atlas = ExtResource( 4 )
|
||||
region = Rect2( 192, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=20]
|
||||
[sub_resource type="AtlasTexture" id=14]
|
||||
atlas = ExtResource( 4 )
|
||||
region = Rect2( 216, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=21]
|
||||
[sub_resource type="AtlasTexture" id=15]
|
||||
atlas = ExtResource( 4 )
|
||||
region = Rect2( 240, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=22]
|
||||
[sub_resource type="AtlasTexture" id=16]
|
||||
atlas = ExtResource( 4 )
|
||||
region = Rect2( 264, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=23]
|
||||
[sub_resource type="AtlasTexture" id=17]
|
||||
atlas = ExtResource( 4 )
|
||||
region = Rect2( 288, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=24]
|
||||
[sub_resource type="AtlasTexture" id=18]
|
||||
atlas = ExtResource( 4 )
|
||||
region = Rect2( 312, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=25]
|
||||
[sub_resource type="AtlasTexture" id=19]
|
||||
atlas = ExtResource( 4 )
|
||||
region = Rect2( 0, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=26]
|
||||
[sub_resource type="AtlasTexture" id=20]
|
||||
atlas = ExtResource( 4 )
|
||||
region = Rect2( 336, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=27]
|
||||
[sub_resource type="AtlasTexture" id=21]
|
||||
atlas = ExtResource( 4 )
|
||||
region = Rect2( 360, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=28]
|
||||
[sub_resource type="AtlasTexture" id=22]
|
||||
atlas = ExtResource( 4 )
|
||||
region = Rect2( 384, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=29]
|
||||
[sub_resource type="AtlasTexture" id=23]
|
||||
atlas = ExtResource( 4 )
|
||||
region = Rect2( 72, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=30]
|
||||
[sub_resource type="AtlasTexture" id=24]
|
||||
atlas = ExtResource( 4 )
|
||||
region = Rect2( 96, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=25]
|
||||
atlas = ExtResource( 4 )
|
||||
region = Rect2( 24, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=26]
|
||||
atlas = ExtResource( 5 )
|
||||
region = Rect2( 0, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=27]
|
||||
atlas = ExtResource( 5 )
|
||||
region = Rect2( 24, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=28]
|
||||
atlas = ExtResource( 5 )
|
||||
region = Rect2( 48, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=29]
|
||||
atlas = ExtResource( 6 )
|
||||
region = Rect2( 0, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=30]
|
||||
atlas = ExtResource( 6 )
|
||||
region = Rect2( 24, 0, 24, 70 )
|
||||
|
||||
[sub_resource type="SpriteFrames" id=31]
|
||||
animations = [ {
|
||||
"frames": [ SubResource( 1 ) ],
|
||||
@@ -135,65 +135,65 @@ animations = [ {
|
||||
"name": "idle_down_left",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [ SubResource( 2 ) ],
|
||||
"loop": true,
|
||||
"name": "idle_down_right",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [ SubResource( 3 ), SubResource( 4 ), SubResource( 5 ) ],
|
||||
"loop": true,
|
||||
"name": "speak_down_right",
|
||||
"speed": 6.0
|
||||
}, {
|
||||
"frames": [ SubResource( 6 ), SubResource( 7 ), SubResource( 6 ), SubResource( 7 ), SubResource( 7 ) ],
|
||||
"loop": true,
|
||||
"name": "speak_up",
|
||||
"speed": 3.0
|
||||
}, {
|
||||
"frames": [ SubResource( 8 ), SubResource( 9 ), SubResource( 10 ), SubResource( 9 ), SubResource( 10 ) ],
|
||||
"frames": [ SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 3 ), SubResource( 4 ) ],
|
||||
"loop": true,
|
||||
"name": "speak_down",
|
||||
"speed": 6.0
|
||||
}, {
|
||||
"frames": [ SubResource( 11 ) ],
|
||||
"frames": [ SubResource( 5 ) ],
|
||||
"loop": true,
|
||||
"name": "idle_right",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [ SubResource( 12 ), SubResource( 13 ), SubResource( 14 ), SubResource( 15 ), SubResource( 16 ) ],
|
||||
"frames": [ SubResource( 6 ), SubResource( 7 ), SubResource( 8 ), SubResource( 9 ), SubResource( 10 ) ],
|
||||
"loop": true,
|
||||
"name": "speak_right",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [ SubResource( 17 ), SubResource( 18 ), SubResource( 19 ), SubResource( 18 ) ],
|
||||
"frames": [ SubResource( 11 ), SubResource( 12 ), SubResource( 13 ), SubResource( 12 ) ],
|
||||
"loop": true,
|
||||
"name": "walk_down",
|
||||
"speed": 6.0
|
||||
}, {
|
||||
"frames": [ SubResource( 20 ), SubResource( 21 ), SubResource( 22 ), SubResource( 23 ), SubResource( 24 ) ],
|
||||
"frames": [ SubResource( 14 ), SubResource( 15 ), SubResource( 16 ), SubResource( 17 ), SubResource( 18 ) ],
|
||||
"loop": true,
|
||||
"name": "walk_right",
|
||||
"speed": 6.0
|
||||
}, {
|
||||
"frames": [ SubResource( 25 ) ],
|
||||
"frames": [ SubResource( 19 ) ],
|
||||
"loop": true,
|
||||
"name": "idle_down",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [ SubResource( 26 ), SubResource( 27 ), SubResource( 28 ), SubResource( 27 ) ],
|
||||
"frames": [ SubResource( 20 ), SubResource( 21 ), SubResource( 22 ), SubResource( 21 ) ],
|
||||
"loop": true,
|
||||
"name": "walk_up",
|
||||
"speed": 6.0
|
||||
}, {
|
||||
"frames": [ SubResource( 29 ) ],
|
||||
"frames": [ SubResource( 23 ) ],
|
||||
"loop": true,
|
||||
"name": "idle_up",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [ SubResource( 30 ) ],
|
||||
"frames": [ SubResource( 24 ) ],
|
||||
"loop": true,
|
||||
"name": "idle_left",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [ SubResource( 25 ) ],
|
||||
"loop": true,
|
||||
"name": "idle_down_right",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [ SubResource( 26 ), SubResource( 27 ), SubResource( 28 ) ],
|
||||
"loop": true,
|
||||
"name": "speak_down_right",
|
||||
"speed": 6.0
|
||||
}, {
|
||||
"frames": [ SubResource( 29 ), SubResource( 30 ), SubResource( 29 ), SubResource( 30 ), SubResource( 30 ) ],
|
||||
"loop": true,
|
||||
"name": "speak_up",
|
||||
"speed": 3.0
|
||||
} ]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id=32]
|
||||
|
||||
@@ -48,6 +48,7 @@ position = Vector2( 3.5636, 0 )
|
||||
[node name="Hotspots" type="Node2D" parent="."]
|
||||
|
||||
[node name="r_door" type="Area2D" parent="Hotspots"]
|
||||
pause_mode = 1
|
||||
script = ExtResource( 5 )
|
||||
__meta__ = {
|
||||
"_editor_description_": ""
|
||||
@@ -68,6 +69,7 @@ position = Vector2( 1225.47, 353.99 )
|
||||
script = ExtResource( 7 )
|
||||
|
||||
[node name="item" type="Area2D" parent="Hotspots"]
|
||||
pause_mode = 1
|
||||
position = Vector2( -217.19, 0 )
|
||||
script = ExtResource( 5 )
|
||||
global_id = "r1_wall_item1"
|
||||
@@ -104,6 +106,7 @@ __meta__ = {
|
||||
}
|
||||
|
||||
[node name="item2" type="Area2D" parent="Hotspots"]
|
||||
pause_mode = 1
|
||||
position = Vector2( 189.644, 0 )
|
||||
script = ExtResource( 5 )
|
||||
global_id = "r1_wall_item2"
|
||||
|
||||
@@ -12,3 +12,6 @@ CANCEL,Cancel,Annuler
|
||||
OK,OK,OK
|
||||
ENTER_SAVE_NAME,Enter the save name:,Entrez un nom de sauvegarde
|
||||
APPLY,Apply,Appliquer
|
||||
CONFIRM_OVERWRITE,Overwrite the savegame?,Écraser la sauvegarde ?
|
||||
YES,Yes,Oui
|
||||
NO,No,Non
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
@@ -2,6 +2,7 @@ extends Control
|
||||
|
||||
|
||||
func _ready():
|
||||
self.pause_mode = Node.PAUSE_MODE_PROCESS
|
||||
hide()
|
||||
|
||||
|
||||
|
||||
12
game/ui/commons/save/overwrite_confirm_popup.gd
Normal file
12
game/ui/commons/save/overwrite_confirm_popup.gd
Normal file
@@ -0,0 +1,12 @@
|
||||
extends PopupDialog
|
||||
|
||||
signal confirm_yes
|
||||
|
||||
func _on_no_pressed():
|
||||
hide()
|
||||
|
||||
|
||||
func _on_yes_pressed():
|
||||
emit_signal("confirm_yes")
|
||||
hide()
|
||||
|
||||
75
game/ui/commons/save/overwrite_confirm_popup.tscn
Normal file
75
game/ui/commons/save/overwrite_confirm_popup.tscn
Normal file
@@ -0,0 +1,75 @@
|
||||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://game/ui/commons/fonts/caslonantique.tres" type="DynamicFont" id=1]
|
||||
[ext_resource path="res://game/ui/commons/save/overwrite_confirm_popup.gd" type="Script" id=2]
|
||||
|
||||
[node name="overwrite_confirm_popup" type="PopupDialog"]
|
||||
margin_left = 429.0
|
||||
margin_top = 281.0
|
||||
margin_right = 863.0
|
||||
margin_bottom = 442.0
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
custom_constants/margin_right = 30
|
||||
custom_constants/margin_top = 30
|
||||
custom_constants/margin_left = 30
|
||||
custom_constants/margin_bottom = 30
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"]
|
||||
margin_left = 30.0
|
||||
margin_top = 30.0
|
||||
margin_right = 404.0
|
||||
margin_bottom = 131.0
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer"]
|
||||
margin_right = 374.0
|
||||
margin_bottom = 21.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "CONFIRM_OVERWRITE"
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
||||
anchor_left = 1.0
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = -224.0
|
||||
margin_top = -56.0
|
||||
margin_right = -30.0
|
||||
margin_bottom = -20.0
|
||||
custom_constants/separation = 10
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="yes" type="Button" parent="HBoxContainer"]
|
||||
margin_right = 92.0
|
||||
margin_bottom = 36.0
|
||||
size_flags_horizontal = 3
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "YES"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="no" type="Button" parent="HBoxContainer"]
|
||||
margin_left = 102.0
|
||||
margin_right = 194.0
|
||||
margin_bottom = 36.0
|
||||
size_flags_horizontal = 3
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "NO"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[connection signal="pressed" from="HBoxContainer/yes" to="." method="_on_yes_pressed"]
|
||||
[connection signal="pressed" from="HBoxContainer/no" to="." method="_on_no_pressed"]
|
||||
@@ -13,7 +13,7 @@ func _ready():
|
||||
func _on_slot_pressed(p_slot_n: int):
|
||||
slot_pressed = p_slot_n
|
||||
if escoria.save_manager.save_game_exists(p_slot_n):
|
||||
pass
|
||||
$overwrite_confirm_popup.popup()
|
||||
else:
|
||||
$save_name_popup.popup()
|
||||
|
||||
@@ -56,3 +56,7 @@ func _on_save_name_popup_savegame_name_ok(p_savename: String):
|
||||
|
||||
func _on_save_name_popup_savegame_cancel():
|
||||
pass
|
||||
|
||||
|
||||
func _on_overwrite_confirm_popup_confirm_yes():
|
||||
$save_name_popup.popup()
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
[gd_scene load_steps=5 format=2]
|
||||
[gd_scene load_steps=6 format=2]
|
||||
|
||||
[ext_resource path="res://game/ui/commons/load_save_slot/load_save_slot.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://game/ui/commons/save/save_game.gd" type="Script" id=2]
|
||||
[ext_resource path="res://game/ui/commons/fonts/caslonantique.tres" type="DynamicFont" id=3]
|
||||
[ext_resource path="res://game/ui/commons/save/save_name_popup.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://game/ui/commons/save/overwrite_confirm_popup.tscn" type="PackedScene" id=5]
|
||||
|
||||
[node name="save_game" type="Control"]
|
||||
anchor_right = 1.0
|
||||
@@ -49,6 +50,9 @@ __meta__ = {
|
||||
|
||||
[node name="save_name_popup" parent="." instance=ExtResource( 4 )]
|
||||
|
||||
[node name="overwrite_confirm_popup" parent="." instance=ExtResource( 5 )]
|
||||
|
||||
[connection signal="pressed" from="back" to="." method="_on_back_pressed"]
|
||||
[connection signal="savegame_cancel" from="save_name_popup" to="." method="_on_save_name_popup_savegame_cancel"]
|
||||
[connection signal="savegame_name_ok" from="save_name_popup" to="." method="_on_save_name_popup_savegame_name_ok"]
|
||||
[connection signal="confirm_yes" from="overwrite_confirm_popup" to="." method="_on_overwrite_confirm_popup_confirm_yes"]
|
||||
|
||||
Reference in New Issue
Block a user