The idea is to make the project less dependant on Global. Global should strictly be used for reusable code in multiple places, not as a second Main. I just hope I'm not breaking anything during this process.
* Symmetry guide color work
* Changed to semi-transparent guides from red, blend slight blue into symmetry guides for variation
Co-authored-by: MrTriPie <MrTriPie>
* Animation tag fix (a)
fixed tag behavior in "Project.gd"
* Animation tag fix (b)
fixed tag behavior in "AnimationTimeline.gd"
* Animation tag fix (c)
fix top part of line not visible
* Animation tag fix (d)
a fix i forgot about earlier
* added a randomizer...
... to auto select colors of new tags
* Fix Tag scrolling without cels when scrolled on it
* removed randomize() cause it's not needed
* Open/Save Sprite Dialogs now have their directory cached so when reopening Pixelorama they will be set to that directory. Load last project and load recent project also syncs with the open/save dialogs and caches that directory
* Sets a projects default file path to the cached file directory (not sure about) and if the export directory is blank, use the cached file directory
* Changed 'file_dialog_dir' to 'current_dir'
Co-authored-by: MrTriPie <MrTriPie>
This lets the user change the strength of the tool. When it has an opacity of 255, the eraser will completely delete the underlying pixels. If it has less than 255, it will simply subtruct that value from the underlying pixel's alpha.
* Add support for creating Ubuntu Touch click packages.
The clickable directory contains the files necessary to create a
click package designed for Ubuntu Touch, a community-driven Linux
distro for mobile phones as an alternative to iOS and Android.
A new CI script has been added to create the packages, which is
copied over from one of my other projects. Please change this to
suit your needs.
A new custom feature "clickable" has been added to the project
settings to allow customizations for the Ubuntu Touch platform.
Signed-off-by: Marquis Kurt <software@marquiskurt.net>
* Make clickable CI follow more closely to desktop builds
* Remove sudo from clickable install step
* Install software-properties-common
* Comment out docker startups in click install
* Change export name for Click version
* Change name and export mode to pack only
* Change means of copying data to clickable dir
* Install sudo to docker
* Add -g to docker add user
* Remove docker user creation
* Remove other chpasswd stuff
* Split CI into two jobs
* Make build-ubports.sh runnable
* Use HiPDI GUI theme on Clickable
* Move clickable folder to Misc, add release CI targets
* Add mobile to clickable settings
* Add pixelorama_data to install data
* Create pixelorama_data subdir in click itself
* Change default save dir for clickable
* Update AppArmor policy
* Update clickable version to test AppArmor
* Revert changes and use user data dir
* Add README pertaining to Ubuntu Touch
* Remove GODOT_MAC_VERSION from UT port workflow
Co-authored-by: Manolis Papadeas <35376950+OverloadedOrama@users.noreply.github.com>
* Added a timer to filter out useless values
This timer will determine if you actually want to view these changes or just want to skip ahead
* a live preview checkbox
* Some dialog improvements
* Minor changes/adjustments
* Fix for multiple cel selection issue
Now it will only apply selection to the selected cels that are **visible and unlocked**
* Fix for loss of selection data
This will hopefully fix the selection data loss on toggling layer buttons
* Fixed issues with Shading tool Saturation and Value not always being right in Hue Shading mode
* Shading tool hue shifting fixes and tweaks
Co-authored-by: MrTriPie <MrTriPie>
* Tweak right side panels to use less empty space
* Add fake grabber to tools panel. Add a bottom margin. Fix a few issues with resizing.
* Fix tallscreen mode. Set a bit smaller animation timeline min height.
* Change Preferences visibility settings
* Update Main.tscn
* Fix crash when changing to tallscreen and then switching themes
Co-authored-by: Manolis Papadeas <35376950+OverloadedOrama@users.noreply.github.com>
Not sure if this actually solves the issue or just makes it more rare, but I haven't been able to reproduce any PoolVector locking issues so far. The problem was that images were remained locked essentially all the time, which seemed to cause issues. Maybe other PoolVectors could not get locked?
Does not work with rotation. It might be a good idea to replace this whole system with one that uses a transformation matrix, to handle rotation and skewing more easily in the future. I'm not a huge fan of this current code.
* Set project name. Also fixed a bug
Added ability to set project name also fixed a bug that "if the aspect ratio button is pressed and a template of different width and height were selected, then the button also applied on them e.g a template of (but it shouldn't)"
Example: write 1 in width, 2 in height, enable aspect ratio, and then try to change template... a template of 256x240 will give 120x240
* Add files via upload
* Adjust save name to project name
* Add files via upload
Not sure if that single if statement counts as branching code, but it's generally a good idea to avoid if statements in shader code, so I used step instead.
Cursor icon is temporary. It works by clicking multiple times on the places you want to create edges, and to complete the polygon you either have to click at the first edge (if you hover the mouse, a circle appears in that position), or you can auto-fill by double clicking.
Basically, when the background color of the screen at certain points is dark, the preview at that spot is white, and when it is bright, the preview is white at that spot. This helps to keep the previews always distinguishable, regardless of the background color.
Icons most likely temporary. A bit problematic when the selection is in negative coords and the preview does not work well with mirroring and mirror view. Same is true for the shape tools.
Related to the PoolVectorArray locking issue (#331). This still doesn't fix the issue itself, but at least Pixelorama does not crash anymore. It is still possible, though, to fail to load a guide when opening a project. Opening it again may solve the issue.
* a minor visibility change.
made the nodes that were not needed in wide-screen "Invicible"
the visibility will now be controlled procedurally
* Added some lines of code in "change_ui_layout()"
The added lines will control node visibility changes to adjust to current screen mode
* added a line to fix tall-screen "zen-mode"
Moves selection with contents by default.
Control + arrow keys = Moves & snaps selection to grid.
Alt + arrow keys = Moves the selection itself without the contents.
Works similar to the rectangle & ellipse drawing tools. Shift for 1:1, Ctrl for expanding from center.
Shift + mouse click = add to selection
Ctrl + mouse click = subtract from selection
Mouse click + Shift = Create a 1:1 (square) selection
Mouse click + Ctrl = Create a selection that expands from center
Mouse click + Shift + Ctrl = Create a 1:1 (square) selection that expands from center
A combination like Shift + Mouse Click + Shift will add to selection while also making a 1:1 selection
When the user clicks on a pixel, all pixels of the same color are being selected. Shift adds to the selection, Ctrl subtracts. The icon and the hint tooltip are temporary.
Instead of having a gazillion icons for each tool and its blue-orange variations, which led us to create 4 different textures for each tool, now we only need one texture for each tool and each theme. The blue-orange background has been made into a different TextureRect for each button.
This makes it easier for people to create new tools. Now, each new tool requires 3 textures (to cover every theme), instead of 12(!). I'm hoping to bring the number down to 1 in a future commit, by automating the theme color converting process.
The MarchingAntsOutline was failing to compile on the Web platform due to the for loop not having constant expressions inside the shader. "Loop index cannot be initialized with non-constant expression"
* Basic move tool
* Added marching ants effect on the selection borders
* Rename SelectionRectangle to SelectionShape, make it have non-rectangular shape and multiple SelectionShapes can exist
- Create multiple selection rectangles
- Merge them together if they intersect
- Move the selections (without contents as of right now)
- Gizmos are being drawn but they are not functional yet
Code is very ugly.
* Sort vectors counter-clockwise to be used as polygon borders
I did this, no idea if it works properly, probably won't be used but I thought I'd keep it saved somewhere
* More experiments I may or may not need
Trying to generate a polygon from the individual selected pixels
* Change default rectangle select behavior and ability to clip polygons using Control
* Fix rectangle selection clipping
* Split polygon into two with selection subtracting
* Move selection with contents with the move tool
Code is still a mess, don't bother looking.
* Move some methods from SelectionShape.gd to Selection.gd
The purpose of this is to generalize some selection code, so that it applies to all polygons, the entire selection. More will follow.
* UndoRedo for border moving
Nothing else in the selections system works properly in UndoRedo right now. Needs:
- UR support for creating selections
- UR support for modifying selections (merging and cutting selections together)
- UR support for removing selection
- UR support for moving content
& for all the rest of the remaining features
* Moving all of the selection shape logic to Selection.gd
Handle all of the polygons there instead of having them as individual nodes. Should be easier to handle undo/redo this way. This commit probably breaks move tool + selection tool and undo/redo. Code is still a mess. For your sanity, I hope you are not reading this. I promise I will clean up.
* Move tool works again
Buggy and messy, of course.
* Remove unneeded code and restore selection move undoredo logic
* Made Selection.gd have one big preview_image for when moving content, instead of each polygon having its own image
Could be further optimized for some specific cases. We could also remove selected_pixels from SelectionPolygon.
* UndoRedo support for creating, deleting, merging and clipping selections
UndoRedo support for moving content not added in this commit. Should work but needs more testing. This PR also removes selected_pixels from the SelectionPolygon class.
* Confirm & cancel selection movement, should support undoredo properly too
Press Enter or do any editing to confirm movement, Escape to cancel. I will most likely add UI buttons for confirm and cancel too.
* Mirror View affects selection
* Restore Cut, Copy, Paste and Clear Selection
Pasting now no longer requires a pre-existing selection and instead copies the selections themselves too.
* Created a new Select menu, which has Select All and Clear Selection as options
Clear Selection now also confirms content moving. TopMenuContainer code has changed to no longer rely on Global for the menu buttons.
* Draw gizmos as rectangles
No functionality yet. They may need to be turned to nodes, so that they can easily resize based on zoom level and check for mouse enter/exit events.
* Made gizmos get drawn in the sides and corners of the big bounding rectangle instead of individual selection parts
Still no functionality yet.
* Restore label text
* Minor optimization when clipping selections
This will execute the for loop less times
* Made a Gizmo class, cursor change on hover, has_focus = false on mouse click
Now I should actually make them resize when dragged, aye?
* Very basic gizmo resizing, still a WIP, does not work properly yet
* Start replacing the array of selected pixels with a BitMap
This should optimize the selection making a lot, and it also allows for easy border drawing without having to deal with polygons, thanks to the MarchingAntsOutline.shader
Still commit is still a WIP, image effects and brushes may not work properly yet.
Because the BitMap has a fixed size, the size of the project, moving the selection outside of canvas boundaries has proven to be a bit tricky. I did implement a hacky way of handling it, but it may be buggy and problematic. I'm still unsure whether this is the best way to handle the situation.
* Selection works with mirror view
* Draw a black rectangle when the user is making a rectangular selection
After they release the mouse, the black rectangle becomes the selection
* Make Selection.gd update when undoing/redoing
* Fix brushes not working properly with non-rectangular selections
* Added invert selection
* Cache has_selection as a variable for a speedup
* Fix conflict issues with the shape tools
* Made the bitmap image squared so the marching ants effect will be the same on both dimensions
There may be a better way to fix the issue, perhaps inside the shader itself.
* Some optimizations to call selection_bitmap_changed() less times
* Restored almost all of the image effects
Left to do:
- Change gradient's behavior. Unsure of how it will work with non-rectangular selections yet, but it should not generate pixels outside of the selection.
- Restore rotation
- Resize bitmap on image resize
- Remove the `pixels` array from the ImageEffect
* Fix Selection.gd not updating when changing project
* Resize the selection bitmap along with image resize
* Restored rotation's old behavior and finally got rid of the selected_pixels array
The rotation does not yet work properly with selections, but at least it now "works".
* Resize selection too when using gizmos
Left to do for gizmos:
- Proper cancel transformation
- Begin transformation
(currently named move_content_start but it should be renamed to something more general) when resizing gizmos
- Keep the original image and selection in memory and resize them. Meaning, gizmos should not resize the already resized data, but only resize the original. This is less destructive as there is no danger of data loss.
- Always resize on InputEventMouseMotion. This is going to be worse for performance, but it will look better for the user.
* Image and bitmap resizing now uses the original data and begin transformation on gizmo click
No matter how many times the user resizes on the current transformation, the original data will not be lost until they either confirm or cancel, so there is no data loss before confirmation/cancel.
* Cancel transformation now works properly when the selection has been resized
* Made gizmos resize on mouse motion, fix issues with negative bounding rectangle and when combined with the move tool
* Resizing can now get out of positive bounds, clearing and inverting now gets limited to the canvas bounds
Resizing currently does not work properly with negative (left & up) canvas boundaries
* Flip image when resizing and the bounding rectangle gets flipped
* Call move_content_confirm() when inverting selection
* Attempt to implement selection resizing that goes outside of the canvas boundaries (not working properly yet)
* Flip selection when resizing to negative bounding rectangle sizes
And fix preview_image vertical flipping
* Fix rotation so that it works (almost) properly with selections
Rotation algorithms now accept and only work with a given image, and the pivot has been added as a parameter
* Experimental gizmo rotation - does not work properly yet
Transforming the selection outside of the canvas is still broken.
* Fix some issues with moving selection out of canvas bounds
* Fix more issues with selection getting resized outside of canvas bounds
* Update marching ants effect properly when switching between projects
And make sure the frequency of the marching ants effect always looks roughly the same on all project sizes
* Made the rotation gizmo part of the gizmos array and resize them based on camera zoom
* Remove unneeded parameter from move_bitmap_values()
* Remove more unneeded parameters
* Move the selection only if the cursor is above it and neither shift nor control are currently pressed
* Gradient generation now works on non-rectangular selections
Although this behavior might not be the intended one
* Copy/paste marching ants effect offset
Useful for when the selection is in negative coords
* Fix issue with clear selection & UndoRedo
* Restore the ability to move selection when it's in negative coords
* Made the marching ants offset a Project variable
This fixes the issue of project switching and keeping the previous project's offset. Again, this is only relevant for when the selection is in negative coords.
* Made the "from current selection" palette preset work with the new selection system
* Fix out of bounds error when using the rectangular select tool on negative coords
* Some code cleanup
* Comment out the rotation gizmo for now, since it does not work properly
* Update marching ants shader params and gizmo sizes when the bitmap changes
* Move some methods around in Selection.gd
* Replace old palette system with a new one
* Replace default json palettes with new resource versions
* Add missing translation strings
* Fix Erevoid's issues 2, 3 and 4
* Rewrite palette grid to improve performance
Add middle click scrolling
* Fix index conversion functions
* Fix palettes editing by copying them to XDG user write path
* Add Windows specific fixes
* Add import support for old json palette format
* Add create/edit palette settings check.
Hide add/delete color buttons when no palette is displayed.
Major speedup for large images. update_mask() is meant for pen pressure only, so there is no reason to calculate it if we don't have pressure sensitivity enabled
The issue occurred when the cursor exited the application window very fast while still on the canvas, thus Global.has_focus was still true, then lost focus. When Pixelorama regained focus, it would draw the tool even if the user clicked outside of the drawing canvas.
* fixed some more bugs
* Removed some more bugs
* Added "Replace Frame" option
It was originally made to use primarily in "Spritesheet (new layer)" but it thought it could also be useful to put it there as an import option
* Update PreviewDialog.tscn
* Update PreviewDialog.gd
* Update OpenSave.gd
* added import option for SpriteSheet and Frame
Now we can add SpriteSheets in current project and Replace frames in current project
* added functions for SpriteSheet and Frames
I added functions that would allow me to add SpriteSheet as new Layer. I also added an option for "Replace frame" (the function "open_image_at_frame()" is originally being used in "open_image_as_spritesheet_layer()" method but i decided to use it as an import option as well)
* Changed contribution name
* Changed contribution name
* Fixed some lines
* fixed sprite lines not updating
* allowed and enabled per_pixel_transparency
* Added a Transparency menu
* Added an Alternate screen for transparency
* Added transparency methods
Added the transparency methods plus modified fullscreen such that it resets transparency on toggling hence, Removing the issue of blackness
* Modified the shader to allow transparency
* Added a material to ViewportContainer
Fixed the bug that darkens image when decreasing opacity
* Update Global.gd
* Update Main.gd
* Update TopMenuContainer.gd
A performance boost for when opening large images. Also fixed an issue with pixels being selected outside of the canvas boundaries, when the selection rectangle was outside the canvas and its size got reduced.
* Cache tile mode rects
* Make TransparentChecker don't calculate tile mode rect on its own
* Minor fixes
- typo
- formatting
- moved unlock() call to the method where matching lock() was called
It now automatically sets the size to the current project's size, has a button to lock aspect ratio, and resizing based on percentage. Some UI changes to CreateNewImage too.
The lock aspect ratio button has been changed from a checkbox to a texture button and the template code has been refactored to use a Template class instead of enums. Only dark icons have been added for now.
* Move get_tile_mode_rect() method to the Project class
* Refactored isometric grid
Now it should be drawn properly in the target rect.
Settings (in pixels):
- cell's AABB size,
- offset from the canvas origin.
* Draw grid only over the Canvas (when in tiling mode)
* Replace some magic numbers with enums.
It's too easy to break something when adding something new in here. Should be a little harder now.
* Added Pixel Grid.
- Pixel grid is shown only when it's enabled and camera is zoomed close enough.
- Settings: pixel_grid_show_at_zoom (as a percentage because that's what's shown in the settings panel), pixel_grid_color. Default values might need changing.
- To distinguish between grid and pixel grid default settings for grid width, grid height are changed.
- Now both grid and pixel grid are drawn above (after) tile mode. Grid is drawn above (after) pixel grid.
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>
- Now the current frame is drawn to a separate Viewport (with transparent background) taking into account only per layer opacity,
- Tiling is drawn by drawing current frame's ViewportTexture with tile mode opacity applied (using premultiply alpha blending).
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.
Fixes #377. The issue was that the shader material was being shared with the background of the cel buttons, and when the cel button transparent background was resized, the canvas transparent background was also affected.
- All colors move towards yellow when lighting, and purple when darkening. The logic has become more complex, so it doesn't just increase (or decrease) the hue when lighting (or darkening). This solves issues with green and blue.
- Added limits to the hue when lighting and darkening, limits to the value when darkening, and to the saturation when lighting.
This behavior should eventually be documented to explain how it works to the users.
When the user switched from one project to another, which had a larger size, the preview of the ImageEffect was trying to set pixels out of bounds, only when the affect option was different than "Current cel"
* Improved tiling feature
* Removed some unwanted code
* Fixed the bug mentioned by overloaded
* Added the requests by overload
* changed the y value which was given x value before
* Add shrink option that allow change default shrink
Shrink option allow to scale the godot application. This path enable
dynamic change of this value in the options.
* Fix the computation of cursor location
For an unknown reason the function get_local_mouse_position return
incorrect current_pixel when shrink is not 1. This path compute the
transformation manually and povide correct values for any shrink value.
- The CJK font (for Chinese & Korean) was changed to DroidSansFallback from NotoSansCJKtc. This results in a much smaller exported `.pck` (over 10MB less)
- Fixed Chinese and Korean characters not displaying properly in the Splash dialog and the About dialog.
* Add request #276
* Remove a warning message
* Some fixes
* Bug fix. Remove Global.save_project_to_recent_list() from src/Main.gd
Co-authored-by: Daniel Simon <dasimon@gmx.org>
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.
More specifically, the color picked sometimes failed to pick transparent color (and picked black instead), swapping between colors when one of them is fully transparent made it fully opaque, and also when picking a color from a palette which was fully transparent made it fully opaque.
Closes #364
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
Creating palettes from sprites has been enhanced - you can now choose if you want to get colors from the selection, current cel, entire frame or all frames, and if you want the colors to have an alpha component.
* Theme edits
Changed all the themes to be more consistent, buttons and panel containers have rounded edges. Note that the spacings have been switched too, so it needs subtle remakes in the placing of each element. Especially the tool buttons. Also check the themes on preferences (need better spacing) and rulers are not included.
* Some UI fixes
* Reduced size of themes
* Fixed more spacing issues and replaced timeline grabber icon
* Removed old theme icons
* Change purple and light rulers
* Fix purple top menu & caramel rulers
Co-authored-by: Erevoid <Erevoid@users.noreply.github.com>
Co-authored-by: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com>
* Created dummyBtn which holds the ButtonGrp
Also added the swatch Buttons to the same group.
* Bug Fixes
Also Updated the EditPalettePopup since it uses the PaletteButtons.
This will be the parent of all (or most) image effect dialog nodes. Currently only parent on FlipImageDialog, will change to be parent of the rest of the effects.
Added the ability to change grid type in Preferences, and made an isometric cell size value which affects just the size of the cells of the isometric grid. Also updated translations.
I mostly did it so I could move tile mode logic into a new node, so I could have control over the drawing order. TileMode.gd also always draws 8 blank rectangles, which are being drawn on top of the grid, in order to hide it if it gets out of boundaries. We are now very close to implementing an isometric grid, #305.
This shouldn't have much of a performance impact, but some more testing is most likely needed.
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 comes with the benefit that we no longer need a Viewport node in the ShaderEffect dialog, which lets us have the Preview TextureRect at a fixed size. Previously, the preview was scaled based on the image's size, which would make applying shaders to large images very inconvenient, since the dialog would be way too big.
Not sure if options for RGBA channels are really needed here, but I kept them from invert colors. We could remove them in the future if they are unneeded.
* Split export code from export dialog to Export.gd autoload
Clean access to child nodes of export dialog
* Fix export variables set in Main.gd
* Fix more wrong variable assignments
Co-authored-by: alexhayoo <65853178+alexhayoo@users.noreply.github.com>
If the loaded shader has uniforms, they will be exposed to the UI, so the users will be able to modify the shader parameters easily. Currently only works with float uniforms.
This new feature allows users to load a .shader file (must be a GLES2 Godot shader) that will modify the image itself. This feature is experimental and possibly buggy, not all shaders are working properly and I'm not sure yet why. As such, this feature may not be included in v0.8 stable.
First option is to affect the selected pixels only. The second it to affect the current cel, or the entire frame (all cels of the frame). Options to affect all frames and all projects will be added next. I also made changes to Canvas.handle_undo() and handle_redo() to make this work.
Once all these options are added successfully in HSVDialog, they will also be added in the rest of the Image effect dialogs.
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
The default image width, height and fill color are being used only when the program first launches. After that, if the user creates an image with changed settings, these settings are being kept.
* 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>
Had to move some palette png code around in order to make it possible to use these image files as palettes. Hopefully loading .pxo files should be next. Addresses #280
* Remove export_presets.cfg from gitignore
* Create export_presets.cfg
* Create godot-ci-export.yml
* Test DLL copying to artifact
* Test repo cloning and copying files
* Attempt to fix directory paths
* Fix directory paths again
* Remove export paths from export_presets.cfg
* Fix inferring script error
* Attempt to fix script error in Global.gd
This and the previous error in Input.gd only happened in the builds generated by GH Actions.
* Attempting to fix another error in Global.gd
* Checkout with submodules
* Added pixelorama folder to Linux build
And renamed "windows" to "windows-64bit" and "linux" to "linux-64bit" directories.
* Renamed artifacts
* Added emojis to step names
* Emojis for job names
* Removed --recurse-submodules from git clone
* Attempt to copy pixelorama folder to Mac's zip
* Revert previous commit
* Update and rename godot-ci-export.yml to godot-ci-test.yml
This helps in previewing how each spritesheet frame will look when it will be imported in Pixelorama. Note that this does not work well with non-square images at the moment.
More specifically, moved scale, crop, invert, desaturate and generate outline code to DrawingAlgos.gd. I am a little worried of DrawingAlgos.gd getting too big though.
Instead of setting the main arrow as a custom cursor every time the cursor gets inside the viewport, set the viewport's default cursor to be the cross, and change the cross's image once in Global.gd
https://github.com/godotengine/godot/issues/31124 has now been fixed in Godot 3.2.2-rc1, so we can use Image.blend_rect() instead of a custom method. This makes exporting large images and drawing with large brush sizes a lot faster.
Once Godot 3.2.2 stable is released, the custom blend_rect method will be completely removed.
The "Open" option will handle importing of .pxo files and image files from now on. The "ImportSprites" file dialog node and script are scheduled to be deleted too. Importing spritesheets option will return soon. Next thing I'm going to work on is a preview window that will appear when importing image files.
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.
Importing a non-palette json file no longer crashes the app. Enabled autowrap for a label in EditPalettePopup because some translated text were pushing the boundaries of the dialog window.
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.
The Canvas is now single node, instead of having multiple canvases for each frame. This should also be a performance optimization, since there are less canvas nodes, so there are less _input() calls. It should also fix a rare Undo/Redo issue with motion drawing and making lines. Could be unstable, needs more testing.
As a side effect, the guides are now the same for all frames, so this should also close #246.
* Refactoring image_menu_id_pressed method in Main.gd (#243)
* Refactoring image_menu_id_pressed method in Main.gd
I've moved the code from each "match" case into a seperate method to make it more readable.
Co-authored-by: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com>
* Refactoring Main.gd. Mostly cutting big methods into smaller ones. (#244)
* Refactoring Main.gd. Mostly cutting big methods into smaller one.
- Reduced size of _ready method in Main.gd
- Moved code from certain parts of old _ready method into seperate methods
- Fixed the translation bug related to CurrentFrame node in TopMenuContainer scene. The CurrentFrame node wasn't updating the language when I was changing language. I've also changed the translation file for this.
- Fixed Global.palette_option_button.selected related warning. Because of some unknown reasons, git didn't push completed line there.
- Moved code from file_menu_id_pressed and view_menu_id_pressed method in Main.gd to separate methods to make it more readable.
* Removed window_title changes from Main.tscn
Co-authored-by: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com>
* Fixed TextureRect images of the circle brushes in BrushesPopup
They all had the pixel brush image in their TextureRect
* Split code from PreferencesDialog.gd to HandleLanguages.gd
Also moved PreferencesDialog script & scene to src/Preferences. More Preferences code splitting will follow.
* Split theme related code from PreferencesDialog into HandleThemes.gd
* Moved shortcuts code from PreferencesDialog
* Created DrawingAlgos.gd and moved a lot of drawing code there
Moved code from Global.gd and Canvas.gd to DrawingAlgos.gd. Will also move the fill_gaps and draw_brush methods of Canvas.gd next. Maybe even refactor the inside of them a bit to make them easier to read.
* Connected "files_dropped" signal to a method
This lets the user drag and drop files into Pixelorama, while it runs, to open them. This doesn't work properly and will crash when it can't open the files. It will get merged into master soon.
* Renamed handle_running_pixelorama_with_arguments() to handle_loading_files()
handle_loading_files() is also used for _on_files_dropped()
* Moved draw_brush() and fill_gaps() from Canvas.gd to DrawingAlgos.gd
draw_brush() is currently very ugly and probably needs inside refactoring
* Removed coord clamping from fill_gaps()
This should make line making behave as expected when the mouse is outside of canvas boundaries
* Drawing is no longer limited by the canvas boundaries
his 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.
* Use enums instead of strings for tools
This could be a slight increase in performance
* Fixed line making with Shift and don't let color picker pick colors outside of canvas
* Changed Global node variables to arrays for left/right
Instead of having 2 variables for left & right nodes, use an array instead. This will help with better looking code, automation and less repetitive code, as seen in ToolButtons.gd. Move related refactoring will follow.
* More Global left/right variables became Arrays
Global.update_left_custom_brush() and its right counterpart have also now become Global.update_custom_brush(mouse_button : int)
* Use Global.Mouse_Button instead of strings for comparison
This should be a slight increase in performance
* Refactoring perferences dialog (#251)
* Added ItemList to themes
* Language and theme checkboxes are now radio buttons
* Even more Global left/right variables became arrays
ColorAndToolOptions has now the same code for left and right tool options, with more similar refactoring coming soon to places like Canvas and DrawingAlgos
* Refactored Canvas.gd
* Refactored DrawingAlgos.draw_brush(), made draw_pixel() method
This also fixes alpha blending and lighting/darkening issues when drawing pixels with mirroring.
* Remove draw_pixel(), use draw_pixel_blended() instead
* Ignore warnings
I don't know what else to do about them, they seem trivial anyway
* Use enum instead of strings for Global.theme_type
Another potential small performance boost when changing themes.
* Use a new Layer class to handle layer information
This replaces the old Global.layers nested array mess, and makes the code easier to read and to understand.
* Fixed linked cel crash and layer naming
* Created a new Cel class, to handle cel information
Like the Layer class, it is used in place of Canvas.layers nested array mess. It hasn't been tested thoroughly yet, so there may be crashes.
* Fixed issue where if you moved a frame to the start (move left), it was invisible
* Added AnimationTag class
Replaces nested Global.animation_tags arrays. Also replaced array.duplicate(true) with looping through the array and creating a new class for each array element, because duplicate(true) does not create new classes, unfortunately, which was causing issues with undo/redo.
Co-authored-by: Igor Santarek <jegor377@gmail.com>
Co-authored-by: Kinwailo <lokinwai@gmail.com>
Replaces nested Global.animation_tags arrays. Also replaced array.duplicate(true) with looping through the array and creating a new class for each array element, because duplicate(true) does not create new classes, unfortunately, which was causing issues with undo/redo.
ColorAndToolOptions has now the same code for left and right tool options, with more similar refactoring coming soon to places like Canvas and DrawingAlgos
Instead of having 2 variables for left & right nodes, use an array instead. This will help with better looking code, automation and less repetitive code, as seen in ToolButtons.gd. Move related refactoring will follow.
his 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.
This lets the user drag and drop files into Pixelorama, while it runs, to open them. This doesn't work properly and will crash when it can't open the files. It will get merged into master soon.
Moved code from Global.gd and Canvas.gd to DrawingAlgos.gd. Will also move the fill_gaps and draw_brush methods of Canvas.gd next. Maybe even refactor the inside of them a bit to make them easier to read.