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
|
first_child = false # Set flag to false after processing the first child
|
||||||
|
|
||||||
func populate_paste():
|
func populate_paste():
|
||||||
|
var current_selection = $VBoxContainer/Paste.get_item_text($VBoxContainer/Paste.selected)
|
||||||
|
|
||||||
$VBoxContainer/Paste.clear()
|
$VBoxContainer/Paste.clear()
|
||||||
var dir = DirAccess.open("user://saves/")
|
var dir = DirAccess.open("user://saves/")
|
||||||
var file_names = []
|
var file_names = []
|
||||||
@ -25,8 +27,12 @@ func populate_paste():
|
|||||||
dir.list_dir_end()
|
dir.list_dir_end()
|
||||||
|
|
||||||
file_names.sort() # Sort the file names
|
file_names.sort() # Sort the file names
|
||||||
|
var index=0
|
||||||
for f in file_names:
|
for f in file_names:
|
||||||
$VBoxContainer/Paste.add_item(f)
|
$VBoxContainer/Paste.add_item(f)
|
||||||
|
if f==current_selection:
|
||||||
|
$VBoxContainer/Paste.selected=index
|
||||||
|
index+=1
|
||||||
else:
|
else:
|
||||||
print("An error occurred when trying to access the path.")
|
print("An error occurred when trying to access the path.")
|
||||||
|
|
||||||
|
1
sim.tscn
1
sim.tscn
@ -147,6 +147,7 @@ layout_mode = 2
|
|||||||
size_flags_horizontal = 10
|
size_flags_horizontal = 10
|
||||||
|
|
||||||
[node name="Decay" type="CheckBox" parent="ScreenOverlay/HUD/HBoxContainer/Right"]
|
[node name="Decay" type="CheckBox" parent="ScreenOverlay/HUD/HBoxContainer/Right"]
|
||||||
|
visible = false
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
text = "Decay"
|
text = "Decay"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user