fix
This commit is contained in:
parent
9f885bc84b
commit
8eadc217b4
@ -11,6 +11,8 @@ func _ready():
|
||||
first_child = false # Set flag to false after processing the first child
|
||||
|
||||
func populate_paste():
|
||||
var current_selection = $VBoxContainer/Paste.get_item_text($VBoxContainer/Paste.selected)
|
||||
|
||||
$VBoxContainer/Paste.clear()
|
||||
var dir = DirAccess.open("user://saves/")
|
||||
var file_names = []
|
||||
@ -25,8 +27,12 @@ func populate_paste():
|
||||
dir.list_dir_end()
|
||||
|
||||
file_names.sort() # Sort the file names
|
||||
var index=0
|
||||
for f in file_names:
|
||||
$VBoxContainer/Paste.add_item(f)
|
||||
if f==current_selection:
|
||||
$VBoxContainer/Paste.selected=index
|
||||
index+=1
|
||||
else:
|
||||
print("An error occurred when trying to access the path.")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user