move file dialog to unloaded scene
This commit is contained in:
parent
8b1fe0a9be
commit
b2c9bbf9a2
4 changed files with 22 additions and 23 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue