From 19574bca7d4458a110dc8b084ba5a052b4d02ab2 Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Fri, 16 Aug 2024 13:59:14 +0300 Subject: [PATCH] Implement the ability to save with blended images with native file dialogs Fixes #1058 --- src/Main.gd | 15 ++++----------- src/UI/Dialogs/SaveSprite.tscn | 2 ++ 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/Main.gd b/src/Main.gd index 3fdcd4d2e..52baa12ad 100644 --- a/src/Main.gd +++ b/src/Main.gd @@ -183,16 +183,6 @@ func _ready() -> void: save_sprite_dialog.current_dir = Global.config_cache.get_value( "data", "current_dir", OS.get_system_dir(OS.SYSTEM_DIR_DESKTOP) ) - var include_blended := CheckBox.new() - include_blended.name = "IncludeBlended" - include_blended.text = "Include blended images" - include_blended.tooltip_text = """ -If enabled, the final blended images are also being stored in the pxo, for each frame. -This makes the pxo file larger and is useful for importing by third-party software -or CLI exporting. Loading pxo files in Pixelorama does not need this option to be enabled. -""" - include_blended.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND - save_sprite_dialog.get_vbox().add_child(include_blended) _handle_cmdline_arguments() get_tree().root.files_dropped.connect(_on_files_dropped) if OS.get_name() == "Android": @@ -467,7 +457,10 @@ func save_project(path: String) -> void: path = "user://".path_join(file_name) include_blended = save_sprite_html5.get_node("%IncludeBlended").button_pressed else: - include_blended = save_sprite_dialog.get_vbox().get_node("IncludeBlended").button_pressed + if save_sprite_dialog.get_selected_options().size() > 0: + include_blended = save_sprite_dialog.get_selected_options()[ + save_sprite_dialog.get_option_name(0) + ] var success := OpenSave.save_pxo_file(path, false, include_blended, project_to_save) if success: Global.open_sprites_dialog.current_dir = path.get_base_dir() diff --git a/src/UI/Dialogs/SaveSprite.tscn b/src/UI/Dialogs/SaveSprite.tscn index 7fffcb0db..ebea77fc5 100644 --- a/src/UI/Dialogs/SaveSprite.tscn +++ b/src/UI/Dialogs/SaveSprite.tscn @@ -5,3 +5,5 @@ size = Vector2i(675, 400) ok_button_text = "Save" access = 2 filters = PackedStringArray("*.pxo ; Pixelorama Project") +option_count = 1 +option_0/name = "Include blended images"