mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-30 23:19:49 +00:00
Connected "files_dropped" signal to a method
This lets the user drag and drop files into Pixelorama, while it runs, to open them. This doesn't work properly and will crash when it can't open the files. It will get merged into master soon.
This commit is contained in:
parent
00a0ab882a
commit
ae89d3e291
12
src/Main.gd
12
src/Main.gd
|
@ -41,6 +41,7 @@ func _ready() -> void:
|
|||
handle_backup()
|
||||
|
||||
handle_running_pixelorama_with_arguments()
|
||||
get_tree().connect("files_dropped", self, "_on_files_dropped")
|
||||
|
||||
|
||||
func _input(event : InputEvent) -> void:
|
||||
|
@ -236,6 +237,17 @@ func _notification(what : int) -> void:
|
|||
show_quit_dialog()
|
||||
|
||||
|
||||
func _on_files_dropped(files : PoolStringArray, screen : int) -> void:
|
||||
for file in files:
|
||||
if file.get_extension().to_lower() == "pxo":
|
||||
_on_OpenSprite_file_selected(file)
|
||||
else:
|
||||
if file == files[0]:
|
||||
$ImportSprites.new_frame = false
|
||||
$ImportSprites._on_ImportSprites_files_selected([file])
|
||||
$ImportSprites.new_frame = true
|
||||
|
||||
|
||||
func on_new_project_file_menu_option_pressed(id : int) -> void:
|
||||
if Global.project_has_changed:
|
||||
unsaved_canvas_state = id
|
||||
|
|
Loading…
Reference in a new issue