1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00

If we have cmdline_args, ensure the images are opened last

This way, cmdline_args loading overwrites load_last_project()
This commit is contained in:
OverloadedOrama 2020-05-03 21:45:05 +03:00
parent 991eb5a615
commit 8b682570b2

View file

@ -160,13 +160,6 @@ func _ready() -> void:
Global.left_color_picker.get_picker().move_child(Global.left_color_picker.get_picker().get_child(0), 1)
Global.right_color_picker.get_picker().move_child(Global.right_color_picker.get_picker().get_child(0), 1)
if OS.get_cmdline_args():
for arg in OS.get_cmdline_args():
if arg.get_extension().to_lower() == "pxo":
_on_OpenSprite_file_selected(arg)
else:
$ImportSprites._on_ImportSprites_files_selected([arg])
Global.window_title = "(" + tr("untitled") + ") - Pixelorama"
Global.layers[0][0] = tr("Layer") + " 0"
@ -219,6 +212,16 @@ func _ready() -> void:
if Global.open_last_project:
load_last_project()
if OS.get_cmdline_args():
for arg in OS.get_cmdline_args():
if arg.get_extension().to_lower() == "pxo":
_on_OpenSprite_file_selected(arg)
else:
if arg == OS.get_cmdline_args()[0]:
$ImportSprites.new_frame = false
$ImportSprites._on_ImportSprites_files_selected([arg])
$ImportSprites.new_frame = true
func _input(event : InputEvent) -> void:
Global.left_cursor.position = get_global_mouse_position() + Vector2(-32, 32)