mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 17:19:50 +00:00
Renamed handle_running_pixelorama_with_arguments() to handle_loading_files()
handle_loading_files() is also used for _on_files_dropped()
This commit is contained in:
parent
ae89d3e291
commit
c84c6a19d7
|
@ -11,6 +11,7 @@ Igor Santarek (jegor377)
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
- Ability to remove the current palette
|
- Ability to remove the current palette
|
||||||
|
- You can now drag & drop files into the program while it's running to open them.
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
## [v0.7] - 2020-05-16
|
## [v0.7] - 2020-05-16
|
||||||
|
|
34
src/Main.gd
34
src/Main.gd
|
@ -40,7 +40,10 @@ func _ready() -> void:
|
||||||
|
|
||||||
handle_backup()
|
handle_backup()
|
||||||
|
|
||||||
handle_running_pixelorama_with_arguments()
|
# If the user wants to run Pixelorama with arguments in terminal mode
|
||||||
|
# or open files with Pixelorama directly, then handle that
|
||||||
|
if OS.get_cmdline_args():
|
||||||
|
handle_loading_files(OS.get_cmdline_args())
|
||||||
get_tree().connect("files_dropped", self, "_on_files_dropped")
|
get_tree().connect("files_dropped", self, "_on_files_dropped")
|
||||||
|
|
||||||
|
|
||||||
|
@ -219,25 +222,7 @@ func handle_backup() -> void:
|
||||||
load_last_project()
|
load_last_project()
|
||||||
|
|
||||||
|
|
||||||
func handle_running_pixelorama_with_arguments() -> void:
|
func handle_loading_files(files : PoolStringArray) -> void:
|
||||||
# If user want to run Pixelorama with arguments in terminal mode then handle that
|
|
||||||
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 _notification(what : int) -> void:
|
|
||||||
if what == MainLoop.NOTIFICATION_WM_QUIT_REQUEST: # Handle exit
|
|
||||||
show_quit_dialog()
|
|
||||||
|
|
||||||
|
|
||||||
func _on_files_dropped(files : PoolStringArray, screen : int) -> void:
|
|
||||||
for file in files:
|
for file in files:
|
||||||
if file.get_extension().to_lower() == "pxo":
|
if file.get_extension().to_lower() == "pxo":
|
||||||
_on_OpenSprite_file_selected(file)
|
_on_OpenSprite_file_selected(file)
|
||||||
|
@ -248,6 +233,15 @@ func _on_files_dropped(files : PoolStringArray, screen : int) -> void:
|
||||||
$ImportSprites.new_frame = true
|
$ImportSprites.new_frame = true
|
||||||
|
|
||||||
|
|
||||||
|
func _notification(what : int) -> void:
|
||||||
|
if what == MainLoop.NOTIFICATION_WM_QUIT_REQUEST: # Handle exit
|
||||||
|
show_quit_dialog()
|
||||||
|
|
||||||
|
|
||||||
|
func _on_files_dropped(files : PoolStringArray, _screen : int) -> void:
|
||||||
|
handle_loading_files(files)
|
||||||
|
|
||||||
|
|
||||||
func on_new_project_file_menu_option_pressed(id : int) -> void:
|
func on_new_project_file_menu_option_pressed(id : int) -> void:
|
||||||
if Global.project_has_changed:
|
if Global.project_has_changed:
|
||||||
unsaved_canvas_state = id
|
unsaved_canvas_state = id
|
||||||
|
|
Loading…
Reference in a new issue