move file dialog to unloaded scene

This commit is contained in:
Fabien Freling 2023-12-20 22:41:41 +01:00
parent 8b1fe0a9be
commit b2c9bbf9a2
4 changed files with 22 additions and 23 deletions

View file

@ -2,12 +2,6 @@ extends Control
# Called when the node enters the scene tree for the first time.
func _ready():
$FileDialog.mode = FileDialog.FILE_MODE_OPEN_FILE
$FileDialog.access = FileDialog.ACCESS_FILESYSTEM
$FileDialog.use_native_dialog = true
$MarginContainer/Unloaded/Button.pressed.connect(_on_button_pressed)
Global.state_changed.connect(_update_state)
if Global.current_state == Global.State.UNLOADED:
pass
@ -17,17 +11,6 @@ func _ready():
var current_scene = s.instantiate()
$MarginContainer.add_child(current_scene)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _on_button_pressed():
$FileDialog.show()
print("button pressed")
func _on_file_dialog_file_selected(path):
Global.load_db(path)
func _update_state(old: Global.State, new: Global.State):
print("updated state")
pass