mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 17:24:44 -04:00
parent
a517f9178a
commit
637a60d9ee
9 changed files with 75 additions and 11 deletions
|
@ -153,6 +153,7 @@ var zoom_level_label : Label
|
|||
var new_image_dialog : ConfirmationDialog
|
||||
var open_sprites_dialog : FileDialog
|
||||
var save_sprites_dialog : FileDialog
|
||||
var save_sprites_html5_dialog : ConfirmationDialog
|
||||
var export_dialog : AcceptDialog
|
||||
var preferences_dialog : AcceptDialog
|
||||
var unsaved_changes_dialog : ConfirmationDialog
|
||||
|
@ -288,6 +289,7 @@ func _ready() -> void:
|
|||
new_image_dialog = find_node_by_name(root, "CreateNewImage")
|
||||
open_sprites_dialog = find_node_by_name(root, "OpenSprite")
|
||||
save_sprites_dialog = find_node_by_name(root, "SaveSprite")
|
||||
save_sprites_html5_dialog = find_node_by_name(root, "SaveSpriteHTML5")
|
||||
export_dialog = find_node_by_name(root, "ExportDialog")
|
||||
preferences_dialog = find_node_by_name(root, "PreferencesDialog")
|
||||
unsaved_changes_dialog = find_node_by_name(root, "UnsavedCanvasDialog")
|
||||
|
|
|
@ -286,6 +286,16 @@ func save_pxo_file(path : String, autosave : bool, project : Project = Global.cu
|
|||
|
||||
file.close()
|
||||
|
||||
if OS.get_name() == "HTML5" and !autosave:
|
||||
file.open_compressed(path, File.READ, File.COMPRESSION_ZSTD)
|
||||
if !err:
|
||||
var file_data = Array(file.get_buffer(file.get_len()))
|
||||
JavaScript.eval("download('%s', %s, '');" % [path.get_file(), str(file_data)], true)
|
||||
file.close()
|
||||
# Remove the .pxo file from memory, as we don't need it anymore
|
||||
var dir = Directory.new()
|
||||
dir.remove(path)
|
||||
|
||||
if autosave:
|
||||
Global.notification_label("File autosaved")
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue