Save Manager

And a couple of corrections.
This commit is contained in:
Shibe 2020-08-03 11:41:50 +04:00
parent 03495a738b
commit d2fcda4520
3 changed files with 359 additions and 2 deletions

View file

@ -0,0 +1,197 @@
[gd_scene load_steps=7 format=2]
[ext_resource path="res://assets/textures/gui/bevel/TrashIcon.png" type="Texture" id=1]
[ext_resource path="res://src/gui_common/thrive_theme.tres" type="Theme" id=2]
[ext_resource path="res://assets/misc/icon.png" type="Texture" id=3]
[ext_resource path="res://assets/textures/gui/bevel/trashButtonHover.png" type="Texture" id=4]
[ext_resource path="res://src/saving/SaveListItem.cs" type="Script" id=5]
[ext_resource path="res://assets/textures/gui/bevel/trashButton.png" type="Texture" id=6]
[sub_resource type="StyleBoxEmpty" id=1]
content_margin_left = 7.0
[node name="SaveListItem" type="HBoxContainer"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 2.0
margin_top = 2.0
margin_right = 2.0
margin_bottom = 2.0
size_flags_horizontal = 3
theme = ExtResource( 2 )
script = ExtResource( 5 )
__meta__ = {
"_edit_use_anchors_": false
}
SaveNamePath = NodePath("VBoxContainer/HBoxContainer/SaveName")
ScreenshotPath = NodePath("Screenshot")
VersionPath = NodePath("VBoxContainer/HBoxContainer/Version")
TypePath = NodePath("VBoxContainer/HBoxContainer4/Type")
CreatedAtPath = NodePath("VBoxContainer/HBoxContainer2/CreatedAt")
CreatedByPath = NodePath("VBoxContainer/HBoxContainer2/Creator")
CreatedOnPlatformPath = NodePath("VBoxContainer/HBoxContainer4/Platform")
DescriptionPath = NodePath("VBoxContainer/HBoxContainer3/Description")
SelectedPath = NodePath("VBoxContainer/HBoxContainer/HBoxContainer/SelectBox")
LoadButtonPath = NodePath("VBoxContainer/HBoxContainer/HBoxContainer/Load")
[node name="Screenshot" type="TextureRect" parent="."]
margin_right = 255.0
margin_bottom = 720.0
rect_min_size = Vector2( 128, 128 )
size_flags_horizontal = 3
texture = ExtResource( 3 )
expand = true
stretch_mode = 6
[node name="VBoxContainer" type="VBoxContainer" parent="."]
margin_left = 259.0
margin_right = 1280.0
margin_bottom = 720.0
size_flags_horizontal = 3
size_flags_stretch_ratio = 4.0
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
margin_right = 1021.0
margin_bottom = 43.0
[node name="Label1" type="Label" parent="VBoxContainer/HBoxContainer"]
margin_top = 10.0
margin_right = 62.0
margin_bottom = 33.0
text = "NAME_LABEL"
[node name="SaveName" type="Label" parent="VBoxContainer/HBoxContainer"]
margin_left = 66.0
margin_top = 10.0
margin_right = 160.0
margin_bottom = 33.0
text = "LOADING_PLACEHOLDER"
[node name="Label2" type="Label" parent="VBoxContainer/HBoxContainer"]
margin_left = 164.0
margin_top = 10.0
margin_right = 251.0
margin_bottom = 33.0
custom_styles/normal = SubResource( 1 )
text = "VERSION_LABEL"
[node name="Version" type="Label" parent="VBoxContainer/HBoxContainer"]
margin_left = 255.0
margin_top = 10.0
margin_right = 270.0
margin_bottom = 33.0
text = "..."
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer"]
margin_left = 274.0
margin_right = 1021.0
margin_bottom = 43.0
size_flags_horizontal = 3
alignment = 2
[node name="SelectBox" type="CheckBox" parent="VBoxContainer/HBoxContainer/HBoxContainer"]
margin_left = 538.0
margin_right = 628.0
margin_bottom = 43.0
text = "SELECT"
[node name="Delete" type="TextureButton" parent="VBoxContainer/HBoxContainer/HBoxContainer"]
margin_left = 632.0
margin_right = 674.0
margin_bottom = 43.0
texture_normal = ExtResource( 6 )
texture_hover = ExtResource( 4 )
texture_disabled = ExtResource( 1 )
[node name="Load" type="Button" parent="VBoxContainer/HBoxContainer/HBoxContainer"]
margin_left = 678.0
margin_right = 747.0
margin_bottom = 43.0
text = "LOAD"
[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer"]
margin_top = 47.0
margin_right = 1021.0
margin_bottom = 70.0
[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer2"]
margin_right = 109.0
margin_bottom = 23.0
text = "CREATED_AT_LABEL"
[node name="CreatedAt" type="Label" parent="VBoxContainer/HBoxContainer2"]
margin_left = 113.0
margin_right = 128.0
margin_bottom = 23.0
text = "..."
[node name="Label3" type="Label" parent="VBoxContainer/HBoxContainer2"]
margin_left = 132.0
margin_right = 169.0
margin_bottom = 23.0
custom_styles/normal = SubResource( 1 )
text = "BY_LABEL"
[node name="Creator" type="Label" parent="VBoxContainer/HBoxContainer2"]
margin_left = 173.0
margin_right = 188.0
margin_bottom = 23.0
text = "..."
[node name="HBoxContainer4" type="HBoxContainer" parent="VBoxContainer"]
margin_top = 74.0
margin_right = 1021.0
margin_bottom = 97.0
[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer4"]
margin_right = 54.0
margin_bottom = 23.0
text = "TYPE_LABEL"
[node name="Type" type="Label" parent="VBoxContainer/HBoxContainer4"]
margin_left = 58.0
margin_right = 73.0
margin_bottom = 23.0
text = "..."
[node name="Label2" type="Label" parent="VBoxContainer/HBoxContainer4"]
margin_left = 77.0
margin_right = 288.0
margin_bottom = 23.0
custom_styles/normal = SubResource( 1 )
text = "CREATED_ON_PLATFORM_LABEL"
[node name="Platform" type="Label" parent="VBoxContainer/HBoxContainer4"]
margin_left = 292.0
margin_right = 307.0
margin_bottom = 23.0
text = "..."
[node name="HBoxContainer3" type="HBoxContainer" parent="VBoxContainer"]
margin_top = 101.0
margin_right = 1021.0
margin_bottom = 124.0
[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer3"]
margin_right = 119.0
margin_bottom = 23.0
text = "DESCRIPTION_LABEL"
[node name="Description" type="Label" parent="VBoxContainer/HBoxContainer3"]
margin_left = 123.0
margin_right = 138.0
margin_bottom = 23.0
text = "..."
[node name="DeleteConfirmDialog" type="ConfirmationDialog" parent="."]
margin_left = 1079.0
margin_right = 1279.0
margin_bottom = 720.0
size_flags_horizontal = 5
size_flags_vertical = 5
popup_exclusive = true
window_title = "Delete this Save?"
dialog_text = "Deleting this save cannot be undone, are you sure you want to permanently delete this?"
[connection signal="toggled" from="VBoxContainer/HBoxContainer/HBoxContainer/SelectBox" to="." method="OnSelectedCheckboxChanged"]
[connection signal="pressed" from="VBoxContainer/HBoxContainer/HBoxContainer/Delete" to="." method="DeletePressed"]
[connection signal="pressed" from="VBoxContainer/HBoxContainer/HBoxContainer/Load" to="." method="LoadThisSave"]

View file

@ -0,0 +1,144 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://src/saving/SaveManagerGUI.cs" type="Script" id=1]
[ext_resource path="res://src/gui_common/thrive_theme.tres" type="Theme" id=2]
[ext_resource path="res://src/saving/SaveList.tscn" type="PackedScene" id=3]
[sub_resource type="StyleBoxEmpty" id=1]
content_margin_left = 7.0
[node name="SaveManagerGUI" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
theme = ExtResource( 2 )
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
SaveListPath = NodePath("CenterContainer/VBoxContainer/SaveList")
SelectedItemCountPath = NodePath("CenterContainer/VBoxContainer/BottomBox/SelectedCount")
TotalSaveCountPath = NodePath("CenterContainer/VBoxContainer/BottomBox/SaveCount")
TotalSaveSizePath = NodePath("CenterContainer/VBoxContainer/BottomBox/SavesSpaceUsed")
LoadButtonPath = NodePath("CenterContainer/VBoxContainer/TopBox/LoadButton")
DeleteSelectedButtonPath = NodePath("CenterContainer/VBoxContainer/TopBox/DeleteSelected")
DeleteOldButtonPath = NodePath("CenterContainer/VBoxContainer/TopBox/DeleteOld")
[node name="CenterContainer" type="CenterContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
size_flags_horizontal = 3
size_flags_vertical = 3
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"]
margin_left = 139.0
margin_top = 85.0
margin_right = 1139.0
margin_bottom = 635.0
rect_min_size = Vector2( 1000, 550 )
size_flags_vertical = 3
[node name="TopBox" type="HBoxContainer" parent="CenterContainer/VBoxContainer"]
margin_right = 1000.0
margin_bottom = 24.0
alignment = 1
[node name="LoadButton" type="Button" parent="CenterContainer/VBoxContainer/TopBox"]
margin_left = 212.0
margin_right = 281.0
margin_bottom = 24.0
disabled = true
text = "LOAD"
[node name="VSeparator" type="VSeparator" parent="CenterContainer/VBoxContainer/TopBox"]
margin_left = 285.0
margin_right = 289.0
margin_bottom = 24.0
[node name="Refresh" type="Button" parent="CenterContainer/VBoxContainer/TopBox"]
margin_left = 293.0
margin_right = 391.0
margin_bottom = 24.0
text = "REFRESH"
[node name="DeleteSelected" type="Button" parent="CenterContainer/VBoxContainer/TopBox"]
margin_left = 395.0
margin_right = 575.0
margin_bottom = 24.0
disabled = true
text = "DELETE_SELECTED"
[node name="DeleteOld" type="Button" parent="CenterContainer/VBoxContainer/TopBox"]
margin_left = 579.0
margin_right = 787.0
margin_bottom = 24.0
disabled = true
text = "CLEANUP_OLD_SAVES"
[node name="SaveList" parent="CenterContainer/VBoxContainer" instance=ExtResource( 3 )]
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 28.0
margin_right = 1000.0
margin_bottom = 522.0
size_flags_vertical = 3
SelectableItems = true
[node name="BottomBox" type="HBoxContainer" parent="CenterContainer/VBoxContainer"]
margin_top = 526.0
margin_right = 1000.0
margin_bottom = 550.0
[node name="Back" type="Button" parent="CenterContainer/VBoxContainer/BottomBox"]
margin_right = 67.0
margin_bottom = 24.0
text = "BACK"
[node name="VSeparator2" type="VSeparator" parent="CenterContainer/VBoxContainer/BottomBox"]
margin_left = 71.0
margin_right = 75.0
margin_bottom = 24.0
[node name="Label" type="Label" parent="CenterContainer/VBoxContainer/BottomBox"]
margin_left = 79.0
margin_right = 200.0
margin_bottom = 23.0
text = "TOTAL_SAVES_LABEL"
[node name="SaveCount" type="Label" parent="CenterContainer/VBoxContainer/BottomBox"]
margin_left = 204.0
margin_right = 217.0
margin_bottom = 23.0
text = "0"
[node name="Label3" type="Label" parent="CenterContainer/VBoxContainer/BottomBox"]
margin_left = 221.0
margin_right = 354.0
margin_bottom = 23.0
custom_styles/normal = SubResource( 1 )
text = "SPACE_USED_LABEL"
[node name="SavesSpaceUsed" type="Label" parent="CenterContainer/VBoxContainer/BottomBox"]
margin_left = 358.0
margin_right = 371.0
margin_bottom = 23.0
text = "0"
[node name="Label2" type="Label" parent="CenterContainer/VBoxContainer/BottomBox"]
margin_left = 375.0
margin_right = 477.0
margin_bottom = 23.0
custom_styles/normal = SubResource( 1 )
text = "SELECTED_LABEL"
[node name="SelectedCount" type="Label" parent="CenterContainer/VBoxContainer/BottomBox"]
margin_left = 481.0
margin_right = 494.0
margin_bottom = 23.0
text = "0"
[connection signal="pressed" from="CenterContainer/VBoxContainer/TopBox/LoadButton" to="." method="LoadFirstSelectedSave"]
[connection signal="pressed" from="CenterContainer/VBoxContainer/TopBox/Refresh" to="." method="RefreshList"]
[connection signal="OnSelectedChanged" from="CenterContainer/VBoxContainer/SaveList" to="." method="OnSelectedChanged"]
[connection signal="pressed" from="CenterContainer/VBoxContainer/BottomBox/Back" to="." method="OnBackButton"]