1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-31 07:29:49 +00:00

Remember last choice in import options (#754)

* Remember last choice in import options

Implements 2nd point of  "Minor UX improvements #735"

* formatting
This commit is contained in:
Variable 2022-09-20 22:28:35 +05:00 committed by GitHub
parent 028a4c9f8a
commit 03813b41c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -5,6 +5,7 @@ var current_save_paths := [] # Array of strings
var backup_save_paths := [] # Array of strings
var preview_dialog_tscn = preload("res://src/UI/Dialogs/PreviewDialog.tscn")
var preview_dialogs := [] # Array of preview dialogs
var last_dialog_option: int = 0
onready var autosave_timer: Timer

View file

@ -53,6 +53,10 @@ func _on_PreviewDialog_about_to_show() -> void:
import_options.add_item("New brush")
import_options.add_item("New pattern")
# Select the option that the preview dialog before it had selected
import_options.select(OpenSave.last_dialog_option)
import_options.emit_signal("item_selected", OpenSave.last_dialog_option)
var img_texture := ImageTexture.new()
img_texture.create_from_image(image, 0)
texture_rect.texture = img_texture
@ -227,6 +231,7 @@ func synchronize() -> void:
func _on_ImportOption_item_selected(id: int) -> void:
current_import_option = id
OpenSave.last_dialog_option = current_import_option
frame_size_label.visible = false
spritesheet_tab_options.visible = false
spritesheet_lay_opt.visible = false