From 8eadc217b422940b52e58ffee2263582bacf602a Mon Sep 17 00:00:00 2001 From: James Date: Thu, 7 Dec 2023 01:36:15 +0000 Subject: [PATCH] fix --- ToolSelect.gd | 6 ++++++ sim.tscn | 1 + 2 files changed, 7 insertions(+) diff --git a/ToolSelect.gd b/ToolSelect.gd index 49c9ecd..76d9b6f 100644 --- a/ToolSelect.gd +++ b/ToolSelect.gd @@ -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.") diff --git a/sim.tscn b/sim.tscn index f2997b6..c815d82 100644 --- a/sim.tscn +++ b/sim.tscn @@ -147,6 +147,7 @@ layout_mode = 2 size_flags_horizontal = 10 [node name="Decay" type="CheckBox" parent="ScreenOverlay/HUD/HBoxContainer/Right"] +visible = false layout_mode = 2 text = "Decay"