It's Cel's property and thus it changes when frame_changed is called (also layer_changed calls frame_changed on its own).
Co-authored-by: kleonc <kleonc@users.noreply.github.com>
Instead of having a frame_duration[] array in the Project class. This makes the code much more readable and understandable, using less lines of code and, by avoiding an extra array, we also avoid potential out-of-bound array crashes.
The functionality for the user has not changed, and by testing so far I didn't find any issues.
Export.was_reported was keeping its value when switching projects, instead of being project-specific. Also fixed issue where imported images were not remembering the directory_path and file_name when switching projects.
It now first attempts to serialize the project data and turn them to JSON, and then opens the file. This is a lto safer because, if a crash happens in the serialization, the file is not already open, and therefore it does not get corrupt. Earlier, if a crash happened, the file would be empty. This meant that if that file existed previously, all of the data would be lost.
* Sync for my local files to my repository
* This is frame properties update, it works but I can't be stored while
saving or loading and that makes crashes just the beggining :)
* I forgot this files :P
* Frame Properties update.
* Updating frame properties
* Update Translations.pot
* Changes to CanvasPreview and CelButton change
Instead of drawing individual lines, execute draw_isometric_tile() multiple times. What this method does is basically draws a single isometric tile, which then gets repeated for the entire canvas size. Also moved all the grid logic to a new script, which gets updated less often that Canvas.gd, for optimization purposes.
Works better than the previous method, although it might be a bit slower, and currently does not work well if the canvas size is not divisible by the grid size. For now, it only gets affected by the grid width. Changing grid height has no effect.
This will allow us to create more selection tools in the future, that aren't necessarily rectangular (See #129) and even enhance the current rectangle selection tool (See #56)
Current issues spotted so far:
Drawing is slower for large images, and bucket filling is also considerably slower even on a 64x64 image. Optimizations are required.
Also fixed issue with "Show Guides" view menu option and having multiple projects with guides. Only think remaining is to make the Symmetry Guides look different than regular guides. Closes #133.
Two special guides - one horizontal and one vertical - that let you change the axis of symmetry for mirroring. On the next commit(s) I will make them visible only if mirroring is toggled on. Almost solves #133
* Refactoring tools
* Remove unused code
* Fixed some inferring errors and added translations
* Attempt to fix some Script Errors found in the CI workflow
* Fix bucket crash.
* Fix static type convert.
Co-authored-by: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com>
The structure of the .pxo files is now consisted of a JSON-structured metadata part, where all the data that can be stored as text are, and a binary part, that contain all the actual image data for each cel and project brush.
This makes it easier for users to understand the .pxo structure, easier to add more changes without having to check versions for backwards compatibility, easier to be opened by third-party apps and it allows us to make an "Export JSON metadata" option, that will export just the metadata in JSON format, without the binary image data.
It's backwards compatible and .pxo files from as far as v0.5 are still supported.
If the current project is empty (only 1 layer and frame, no tags and the image has no content - is invisible) and the user is opening a project, then the opened project will not open a new tab of its own, and will use the currently opened one instead.
A Project class contains project-specific data like name, undo_redo, frames, layers, tags and brushes. These variables have been moved from Global. This is the first step towards multiple tab support, where each tab will be a different Project.