diff --git a/CHANGELOG.md b/CHANGELOG.md index 6dc2561a2..5bddafb20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] This update has been brought to you by the contributions of: -Darshan Phaldesai (luiq54), Igor Santarek (jegor377), rob-a-bolton, Kinwailo +Darshan Phaldesai (luiq54), Igor Santarek (jegor377), rob-a-bolton, Kinwailo, Michael Alexsander (YeldhamDev), Martin Novák (novhack) ### Added - The Web (HTML5) is now a supported platform of Pixelorama! It is now possible to save .png and .pxo files, as well as load image and palette files in the Web version. Only limitation so far is that the users cannot load .pxo files. Also, this may not work on mobile. @@ -31,6 +31,7 @@ Darshan Phaldesai (luiq54), Igor Santarek (jegor377), rob-a-bolton, Kinwailo - Added color previews next to the themes in Preferences. ### Changed +- The GDNative gif exporter addon has been replaced with a GDScript equivalent. This makes gif exporting possible in all currently supported platforms, and it also adds support for transparency. ([#295](https://github.com/Orama-Interactive/Pixelorama/pull/295)) - Drawing is no longer limited by the canvas boundaries. This means that, if you have a brush largen than 1px, you can draw on the edges of the canvas. All pixels that are being drawn outside of the canvas will still have no effect. - The guides are now the same for all frames. - The "Import" option from the file menu has been removed, users can now import image files from "Open". @@ -62,6 +63,7 @@ Darshan Phaldesai (luiq54), Igor Santarek (jegor377), rob-a-bolton, Kinwailo - Importing corrupted image files and non-palette json files no longer crash the app. - Drawing brushes no longer have clipping issues. ([#281](https://github.com/Orama-Interactive/Pixelorama/pull/281)) - When undoing a removal of a brush, the brush index is no longer incorrect. ([#281](https://github.com/Orama-Interactive/Pixelorama/pull/281)) +- Fix out-of-bounds error when color picking outside the image. ([#291](https://github.com/Orama-Interactive/Pixelorama/pull/291))

## [v0.7] - 2020-05-16 diff --git a/Translations/Translations.pot b/Translations/Translations.pot index 9ae1c0d43..4407f0d6e 100644 --- a/Translations/Translations.pot +++ b/Translations/Translations.pot @@ -229,6 +229,9 @@ msgstr "" msgid "Directory path or file name is not valid!" msgstr "" +msgid "Exporting in progress..." +msgstr "" + msgid "Can't load file '%s'.\n" "Error code: %s" msgstr "" diff --git a/src/Autoload/Export.gd b/src/Autoload/Export.gd index b8c2491d2..a9868529f 100644 --- a/src/Autoload/Export.gd +++ b/src/Autoload/Export.gd @@ -179,9 +179,12 @@ func export_processed_images(ignore_overwrites: bool, export_dialog: AcceptDialo scale_processed_images() if current_tab == ExportTab.ANIMATION and animation_type == AnimationType.ANIMATED: - if gif_export_thread.is_active(): - gif_export_thread.wait_to_finish() - gif_export_thread.start(self, "export_gif", {"export_dialog": export_dialog, "export_paths": export_paths}) + if OS.get_name() == "HTML5": + export_gif({"export_dialog": export_dialog, "export_paths": export_paths}) + else: + if gif_export_thread.is_active(): + gif_export_thread.wait_to_finish() + gif_export_thread.start(self, "export_gif", {"export_dialog": export_dialog, "export_paths": export_paths}) else: for i in range(processed_images.size()): if OS.get_name() == "HTML5": @@ -224,11 +227,15 @@ func export_gif(args: Dictionary) -> void: write_frame_to_gif(processed_images[i], Global.animation_timer.wait_time, exporter, args["export_dialog"]) for i in range(processed_images.size() - 2, 0, -1): write_frame_to_gif(processed_images[i], Global.animation_timer.wait_time, exporter, args["export_dialog"]) - var file: File = File.new() - file.open(args["export_paths"][0], File.WRITE) - file.store_buffer(exporter.export_file_data()) - file.close() + if OS.get_name() == "HTML5": + Html5FileExchange.save_gif(exporter.export_file_data(), args["export_paths"][0]) + + else: + var file: File = File.new() + file.open(args["export_paths"][0], File.WRITE) + file.store_buffer(exporter.export_file_data()) + file.close() args["export_dialog"].toggle_export_progress_popup(false) Global.notification_label("File(s) exported") diff --git a/src/Autoload/HTML5FileExchange.gd b/src/Autoload/HTML5FileExchange.gd index 500f0acc5..5fb424991 100644 --- a/src/Autoload/HTML5FileExchange.gd +++ b/src/Autoload/HTML5FileExchange.gd @@ -197,6 +197,13 @@ func save_image(image : Image, file_name : String = "export") -> void: JavaScript.eval("download('%s', %s, 'image/png');" % [file_name, str(png_data)], true) +func save_gif(data, file_name : String = "export") -> void: + if OS.get_name() != "HTML5" or !OS.has_feature('JavaScript'): + return + + JavaScript.eval("download('%s', %s, 'image/gif');" % [file_name, str(Array(data))], true) + + func load_shader() -> void: if OS.get_name() != "HTML5" or !OS.has_feature('JavaScript'): return