Issue 336 (#380)

Co-authored-by: Dennis Ploeger <develop@dieploegers.de>
Co-authored-by: dploeger <dploeger@users.noreply.github.com>
This commit is contained in:
Dennis Ploeger
2021-08-30 20:57:25 +02:00
committed by GitHub
parent 3b36031f24
commit 3dc779311c
35 changed files with 389 additions and 254 deletions

View File

@@ -14,13 +14,17 @@ func _on_back_pressed():
emit_signal("back_button_pressed")
func refresh_savegames():
for slot in $ScrollContainer/slots.get_children():
$ScrollContainer/slots.remove_child(slot)
for slot in $CenterContainer/VBoxContainer/\
ScrollContainer/slots.get_children():
$CenterContainer/VBoxContainer/\
ScrollContainer/slots.remove_child(slot)
var saves_list = escoria.save_manager.get_saves_list()
for i in saves_list.size():
var save_data = saves_list[i+1]
var new_slot = slot_ui_scene.instance()
$ScrollContainer/slots.add_child(new_slot)
$CenterContainer/VBoxContainer/ScrollContainer/slots.add_child(
new_slot
)
new_slot.set_slot_name_date(save_data["name"], save_data["date"])
new_slot.connect("pressed", self, "_on_slot_pressed", [i+1])