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

369 commits

Author SHA1 Message Date
Manolis Papadeas 1d20295f7d Keep images unlocked after editing them - Should close #331
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?
2021-07-25 21:49:37 +03:00
Manolis Papadeas 9bec8f1b09 Preload more resources
Had to remove references to Brushes and Patterns classes from BrushesButton.gd and PatternButton.gd due to GDScript's cyclic reference bug
2021-07-21 18:29:52 +03:00
Manolis Papadeas 0d5e9ce48a Fix crop image crashes on Windows and maybe also fixed buggy behavior?
Cropping images seem to be working fine now, or at least I haven't encountered any bugs so far
2021-07-21 01:24:39 +03:00
Manolis Papadeas 28b8e000f9 Rewrite the crop image method
Should be a bit faster, but I still get weird bugs at random
2021-07-20 22:06:18 +03:00
Manolis Papadeas 43bd054df6 Update translations
Hopefully the final translations for 0.9?
2021-06-30 00:01:39 +03:00
Manolis Papadeas 98d41fca14 Remove Global.find_node_by_name()
Use the built-in find_node() method instead.
2021-06-26 14:01:07 +03:00
Manolis Papadeas ac631e3e3d Transform selected content of multiple selected cels
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.
2021-06-19 19:29:32 +03:00
Laurenz Reinthaler a899d2591d
Use CMD+Shift+H for showing the pixel grid on OSX (#494)
Co-authored-by: Laurenz Reinthaler <reinthalerlaurenz@gmail.com>
2021-06-15 13:03:19 -07:00
Manolis Papadeas 18592ed7c0 Minor UI changes 2021-06-15 01:03:46 +03:00
Manolis Papadeas 79b37a95b3 Fix palette importing not including all colors if they have more than 64 colors 2021-06-14 20:38:46 +03:00
Manolis Papadeas bdd06d42ce Added tool button size option in the Preferences 2021-06-14 02:14:31 +03:00
Manolis Papadeas 20f5a063fd Get palette colors from all selected cels 2021-06-13 18:27:48 +03:00
Manolis Papadeas ec1b29eb5e Let the user change icon colors regardless of theme 2021-06-04 21:44:05 +03:00
Manolis Papadeas 12ce12a292 Replace button icons with single-color textures that change color automatically depending on the theme
There is no longer any need for having specific graphics for each theme, as white colored textures can change their modulation to any color.
2021-06-03 22:42:08 +03:00
Manolis Papadeas 64e9d14a0e Use Texture resources instead of Image for tool cursor icons 2021-05-31 21:39:33 +03:00
Manolis Papadeas 6d2f02b782 Let the user change border color and toggle the marching ants effect in the preferences 2021-05-28 03:46:16 +03:00
Manolis Papadeas bd84fbbe39 Rename the Lighten/Darken tool to Shading tool 2021-05-26 02:17:49 +03:00
Manolis Papadeas 4e8acdf002 Updated Translations.pot and some tool hint tooltips 2021-05-25 02:51:10 +03:00
Igor Santarek c5d1e3b52b
Fix for #341. :) (#488) 2021-05-21 15:55:06 -07:00
Manolis Papadeas 5b6f4ebe3e Added Polygon selection tool
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.
2021-05-18 01:56:55 +03:00
Manolis Papadeas b8d055fe01 Added lasso / free select tool
Temporary icon, probably. Should work without problems, but more testing would be nice.
2021-05-16 03:52:13 +03:00
Manolis Papadeas d13c5c1063 Added ellipse selection tool
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.
2021-05-14 03:48:33 +03:00
Manolis Papadeas b28e89e5c4 Users can now resize the left tool bar
Useful since the number of tools has started to grow a lot, and some monitors may not have enough vertical space for all of them.
2021-05-13 01:15:11 +03:00
Manolis Papadeas 99ce07b3ab Added a new line tool
One of the most requested tools has finally been added!
2021-05-12 04:35:20 +03:00
Manolis Papadeas 0b9eb2bbed Change the project's name before saving the pxo file 2021-05-11 14:51:14 +03:00
Manolis Papadeas 708a1ddc20 Organize the selection tool files in a new folder 2021-04-28 03:06:03 +03:00
Manolis Papadeas afd7cc43c9 Rename move_content methods to transform_content 2021-04-23 23:37:07 +03:00
Darshan Phaldesai dca76afe17
Shader based invert, desaturate and HSV dialogs (#475)
* Shader based invert, desaturate and HSV dialogs

* Bug fixes
2021-04-21 05:31:33 -07:00
Manolis Papadeas d70c6a22c4 New tool: Magic Wand (temporary icon) 2021-04-20 15:53:16 +03:00
Manolis Papadeas fccd37360a New tool: Select by Color (temporary icon)
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.
2021-04-19 18:50:43 +03:00
Manolis Papadeas baba43d274 Change the way of how tool icon blue-orange backgrounds work
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.
2021-04-18 15:36:08 +03:00
Manolis Papadeas 27cb0d2d2f
New selection system (#474)
* 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
2021-04-17 11:30:12 -07:00
Martin Novák 42696e7b37
Replace old palette system with a new one (#447)
* 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.
2021-04-16 11:09:03 -07:00
DragonOfWar 943a69c0e3
Add Rectangle and Ellipse tools (#456)
* Add Shapes Tool (WIP)

* Add Alt button + Fill shape + Other stuff

* Add blue theme button textures

* Fix tool not previewing on right button

* Add config functions

* Fix ellipse bug

* Correctly added thickness

* Keep preview with CTRL

* Fix weird PoolVector behaviour

* Make preview follow mouse when pressing CTRL

* Moved shapes class to a separate script

* Update tooltip

* Enable mirrors

* Separate tools + jittery preview fix + more

* Add missing translation

* Add missing icons and keybindings

* Changed shape draw function buttons

Co-authored-by: DragonOfWar <47753585+KawanWeege@users.noreply.github.com>
2021-03-30 10:07:13 -07:00
Manolis Papadeas a9045e317d Apply mirror view to all tools 2021-03-29 23:00:09 +03:00
Manolis Papadeas cffba7edde Added an option in the Preferences for interface dimming on dialog popup 2021-03-17 19:28:01 +02:00
Manolis Papadeas 82b1535c14 Update CHANGELOG 2021-03-17 18:15:43 +02:00
Manolis Papadeas 810affb1bc Update CHANGELOG & Translations, clear whitespaces 2021-03-15 03:41:02 +02:00
ballerburg9005 de164ea9de
full support for auto tallscreen/widescreen panel layout (#458)
* full support for auto tallscreen/widescreen panel layout

* Update Main.tscn

* Update CanvasPreviewContainer.tscn

* Update UI.tscn

* tallscreen support - better display scale

* tallscreen support - better display scale

* Update UI.tscn

* Update Main.gd

* tallscreen support - better display scale

* tallscreen support - better display scale

* tallscreen support - alternate panel placement comment-784228607

* tallscreen support - code cleanup

* tallscreen support - color picker swap: comment-785032683

* prettier border

* tallscreen support - color picker

* tallscreen support - pullrequestreview-601156079

* tallscreen support - bugfix & review

Co-authored-by: ballerburg9005 <mathias.steiger@gmail.com>
2021-03-06 05:59:26 -08:00
Variable f9c275d0a4
"SpriteSheet as layer" and "Replace Frame" import options (#453)
* 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
2021-02-07 06:43:44 -08:00
Variable dc469dd4b5
Var transparent mode (#444)
* 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
2021-02-02 07:29:19 -08:00
Manolis Papadeas 5b3b91b247 Fix #445 by NOT replacing empty backups 2021-01-30 20:33:00 +02:00
kleonc 499251f44a
Fix potential index out of bounds error (#446) 2021-01-30 09:30:02 -08:00
Manolis Papadeas 27852b2694 Dragging and dropping individual cels in the timeline to change their position is now possible.
Addresses a part of #306
2021-01-29 22:00:48 +02:00
Manolis Papadeas 6edfbad663 Fixed a bug with the Zoom tool, removed Godot's version check from Tools.gd and updated AboutDialog, CHANGELOG and Translations 2021-01-26 16:34:25 +02:00
Variable eff0adbf21
Var pix centralize (#441)
* Added Centralize Image

* Add files via upload

* Added Centralize Image (fixd some lines)

* Added Centralize Image (fixes some lines)

* Fixed and removed some lines

* Fixed and removed some lines

* Removed unnecessary parameters

* Removed unnecessary parameters

* Update DrawingAlgos.gd
2021-01-26 06:03:38 -08:00
kleonc 63838964b3
Renamed enums to follow recommended naming convention (#437) 2021-01-20 06:59:42 -08:00
kleonc eeb97f71e4
One shared offset for rectangular and isometric grids, added "Draw Grid over Tile Mode" toggle (#434)
* One shared offset for rectangular and isometric grids

* One draw call per grid

* Added "Draw Grid over Tile Mode" toggle
2021-01-19 16:17:33 -08:00
kleonc 9c520a65e9
Refactored isometric grid (#430)
* 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.
2021-01-18 12:59:26 -08:00
kleonc db9980a883
Draw Grid only over Canvas. Added PixelGrid. (#427)
* 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.
2021-01-16 10:24:46 -08:00
kleonc b1c0344d0b
Remove unneeded location variables (#425)
Co-authored-by: kleonc <kleonc@users.noreply.github.com>
2021-01-06 07:11:50 -08:00
Manolis Papadeas 8daacbac5e Added "Performance" tab in Preferences that exposes options related to the application's FPS to the user
This also makes the behavior added in #394 toggle-able.
2021-01-05 20:01:50 +02:00
Laurenz Reinthaler 2a7e668976
Add Pan Tool (#399) 2020-12-23 10:41:42 -08:00
Manolis Papadeas 031efc0cdb Make FPS project-specific and store it in the pxo files 2020-12-17 02:20:47 +02:00
Manolis Papadeas 05c9ef70d4 Put frame duration as a member of the Frame class
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.
2020-12-16 22:54:08 +02:00
Manolis Papadeas 35eeaf4e90 Fixed an issue where Pixelorama crashed when a user coming from a new version to an old one and had selected a tool that doesn't exist in an older version 2020-12-13 21:42:45 +02:00
Manolis Papadeas 359f0d473c Added Japanese translation 2020-12-12 15:05:03 +02:00
Manolis Papadeas 15994fb818 Fixed crash when importing spritesheets 2020-12-09 18:18:00 +02:00
Manolis Papadeas de6f78b058 Fix crash when importing an image file as a new frame 2020-12-09 18:07:12 +02:00
Laurenz Reinthaler da214efc53
Change shortcut key from CTRL to CMD on OSX (#393) 2020-12-05 16:10:40 -08:00
Manolis Papadeas 46939bd74d Check the correct tile mode button in View > Tile Mode when changing between projects
Also changed the buttons to radiobuttons
2020-12-03 03:49:53 +02:00
Manolis Papadeas 4d85cf1a10 Symmetry guides now adjust their position when the image is being resized
Fixes #379
2020-11-25 21:59:18 +02:00
AbhinavKDev 96454a2d57
Handiling tile modes in each project (#388)
* Handiling tile modes in each project

Co-authored-by: Manolis Papadeas <35376950+OverloadedOrama@users.noreply.github.com>
2020-11-24 08:53:18 -08:00
Manolis Papadeas d7008362b5 Added a "Mirror View" option in the View menu
Which is used to flip the canvas horizontally and non-destructively. Closes #227
2020-11-23 18:53:21 +02:00
AbhinavKDev de4634e22d
Improved the tiling feature (#378)
* 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
2020-11-13 10:12:20 -08:00
Manolis Papadeas 4be0740170 Fixed crash when loading a pxo older of 0.8.1 and selecting a frame other than the first
Had to do with Project.frame_duration not having as array members as it should.
2020-11-12 02:16:08 +02:00
gschwind 279228daba
Implement shrink option (#376)
* 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.
2020-11-06 17:57:35 -08:00
Manolis Papadeas cff3f9f6b2 Fixed issue where imported projects were not remembering the directory_path and file_name when switching tabs. 2020-10-29 22:35:20 +02:00
Manolis Papadeas 7dd9b36cdc Move "Recent projects" up, just below "Open last project" in the File menu 2020-10-29 22:33:15 +02:00
Manolis Papadeas b5df8a7ac5 Move the notifications a bit to the left 2020-10-29 16:46:58 +02:00
Manolis Papadeas 0d5b4416a4 Changed CJK font and fixed some character issues
- 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.
2020-10-29 00:45:23 +02:00
Manolis Papadeas 4415f86c56 Update CHANGELOG & AboutDialog, trim trailing whitespaces 2020-10-27 23:03:43 +02:00
dasimonde 7126074a0e
Add feature request #276 (#370)
* 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>
2020-10-26 13:51:55 -07:00
dasimonde d85efce73a
Add feature request #358 (#368)
* Add feautre request #358

* Remove the if statement in src/UI/Canvas/TileMode.gd

Co-authored-by: Daniel Simon <dasimon@gmx.org>
2020-10-25 16:10:14 -07:00
Manolis Papadeas ab6bebd6d4 When there are errors in opening and saving files, the errors appear in the form of a popup dialog, instead of a notification or an OS alert. 2020-10-25 18:02:51 +02:00
Manolis Papadeas 4e33476a4d Fixed "Export" option in the File menu not working properly when switching between projects
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.
2020-10-25 00:58:37 +03:00
Manolis Papadeas 96fc2aa12d Fixed issues where fully transparent color could not be picked
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
2020-10-23 20:18:39 +03:00
Manolis Papadeas df7a650137 Fixes #363 2020-10-23 18:11:08 +03:00
Manolis Papadeas cce4fa4cbb Added more options to the Rotate Image dialog
Now all of the image effects (except those related to resizing) have the same affect options.
2020-10-23 17:50:52 +03:00
Rémi Verschelde d41751d39c
Use '~' prefix instead of '%' for random brushes (#362)
Fixes #337.
2020-10-21 19:07:49 +03:00
OverloadedOrama e94bcf50e0 Made pxo saving a bit safer
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.
2020-10-20 03:27:38 +03:00
PinyaColada 852365c38f
Frame properties (#357)
* 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
2020-10-19 17:57:40 +03:00
OverloadedOrama e5c371cf88 Added error code to pxo open/save error messages 2020-10-06 04:37:43 +03:00
OverloadedOrama fbbdcdaa57 Made the frame move buttons get disabled when you can't move frames 2020-10-05 02:37:55 +03:00
OverloadedOrama 63410bdb46 Attempting to fix error code 23 when exporting png files 2020-10-01 21:27:08 +03:00
OverloadedOrama edf7e43bb8 Update size label when changing project or scaling 2020-09-14 17:51:35 +03:00
OverloadedOrama e0fb942c7c An even better fix for loading backups 2020-09-05 22:27:11 +03:00
OverloadedOrama 497f0e03cb Fixes issue when saving a pxo and removing its backup
Supersedes #327
2020-09-05 21:55:12 +03:00
OverloadedOrama aa3637cc41 Fixed crash when loading backups
backup_paths can have more elements that backup_save_paths, which caused crashes if a backup file did not exist.
2020-09-05 19:13:43 +03:00
OverloadedOrama 0a0bf62bcd Each Project has its own export path now
This could be buggy so it needs more testing.
2020-08-28 18:05:49 +03:00
OverloadedOrama e673888529 Import pal palette files by dropping them into the app 2020-08-27 01:37:14 +03:00
Matthew Paul 348d758ef4
Add PAL palette format import (#315)
* Add PAL palette format import

* Move .pal selection into Dialog; Attempt HTML implementation

* Fix issue with HTML5 pal palette import.
2020-08-26 12:36:03 +03:00
OverloadedOrama 8d1c2e96f3 Finished implementing the isometric grid - Closes #305
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.
2020-08-20 00:12:07 +03:00
OverloadedOrama 1ff32f2892 Fixed some leak issues with gdgifexporter
Made scrips extend Reference instead of Node
2020-08-19 01:01:00 +03:00
OverloadedOrama 14d958e55f Moved tile mode drawing logic from Canvas to a new script
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.
2020-08-18 17:03:49 +03:00
OverloadedOrama 35b2c201ae Changed how isometric grid is drawn
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.
2020-08-17 22:54:33 +03:00
Kinwailo 39808082b6
add follow canvas movement and scale option to transparent checker (#311) 2020-08-17 22:30:58 +03:00
OverloadedOrama d49c280179 Create language radiobuttons from script 2020-08-10 03:01:46 +03:00
OverloadedOrama da656df5b7 Added more options to the Gradient Dialog 2020-08-08 19:02:49 +03:00
OverloadedOrama 205e72f356 Gif exporting now works in HTML5 2020-08-07 11:01:27 +03:00
Martin Novák f3bce3857a
Replace godot-gifexporter with godot-gdgifexporter (#295)
Add exporting in a separate thread and a progress bar
Remove background color option from gif export
2020-08-07 08:13:04 +03:00
Michael Alexsander f715b566b1
Fix out-of-bounds error when color picking outside the image (#291) 2020-08-06 12:13:45 +03:00
azagaya 6d23f95d07
Added Scale3X algorithm as an option to scale sprites (#290) 2020-08-02 18:24:00 +03:00
OverloadedOrama 7269b45fc5 Added play button and zoom slider for the small canvas preview
May also be a solution for the age old issue #25.
2020-08-02 00:59:00 +03:00
OverloadedOrama ebc9eab773 Added dialog with options for desaturation
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.
2020-08-01 04:24:11 +03:00
Martin Novák 6f645d996d
Refactor export dialog (#288)
* 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>
2020-07-31 23:26:52 +03:00
OverloadedOrama 2346ca810b Added dialog with options for invert colors 2020-07-31 03:39:46 +03:00
OverloadedOrama 051f3df147 Buttons to reset preferences to default
Similar functionality with Godot's default buttons. The buttons currently aren't visible with the gold & light themes.
2020-07-29 03:16:02 +03:00
OverloadedOrama f88d201e1a Organized Preferences better
As a result, "General" no longer exists.
2020-07-29 01:54:15 +03:00
OverloadedOrama ec81950139 Experimental shader feature: Expose shader's float uniforms to the UI
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.
2020-07-28 04:11:06 +03:00
OverloadedOrama 94aa94a364 Added a preview in OutlineDialog 2020-07-27 04:36:00 +03:00
OverloadedOrama 4870ebc094 Added checkbox in OutlineDialog for affection selection 2020-07-27 04:11:46 +03:00
OverloadedOrama 062ce664ca Unlock the image before getting its size in generate_gradient()
This *may* solve a rare crash related to memory.
2020-07-25 20:17:47 +03:00
OverloadedOrama 186e2259ac [EXPERIMENTAL] Added ability to load a shader as an image effect
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.
2020-07-25 16:26:57 +03:00
OverloadedOrama 2cb07fb848 Added option to affect all projects in the HSVDialog
HSVDialog should be ready now. These options will also appear in the rest of the image effects.
2020-07-24 03:41:10 +03:00
OverloadedOrama 1ce89c6577 Added affecting options to the HSVDialog
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.
2020-07-24 03:22:12 +03:00
OverloadedOrama af915caf7a Refactored adjust_hsv to be 3 times faster
adjust_hsv() now gets executed once instead of thrice. The results should be the same.
2020-07-23 04:39:23 +03:00
OverloadedOrama 0f82be765e Replaced the _min and _max Project variables with Project.selected_pixels
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.
2020-07-20 22:15:34 +03:00
OverloadedOrama 8c965c1858 Added ability to change gradient direction 2020-07-18 19:01:24 +03:00
OverloadedOrama 29e9579eb6 Added basic gradient generation
A new option in the "Image" menu, gradient generation.
2020-07-18 17:23:36 +03:00
OverloadedOrama a5a8bf1fe5 Turn Symmetry Guides visibility on and off if mirroring is enabled
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.
2020-07-16 05:05:40 +03:00
OverloadedOrama e04b79dd4b Added pattern file name as a tooltip for their buttons 2020-07-13 03:44:08 +03:00
OverloadedOrama d31509035f Add a "Use ZSTD Compression" checkbox on Save Sprite dialog 2020-07-11 02:09:17 +03:00
Kinwailo 4a668f71f5
Refactoring tools (#281)
* 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>
2020-07-09 15:22:17 +03:00
OverloadedOrama 0713342c0f Change "err" variable for HTML5 in OpenSave.save_pro_file() 2020-07-05 02:22:48 +03:00
OverloadedOrama 9464c7a953 Importing palettes is now possible in HTML5 2020-07-01 04:48:18 +03:00
OverloadedOrama d02bb52d48 Removed some old code about pen pressure 2020-07-01 03:57:27 +03:00
OverloadedOrama 7e3436d3ba Loading image files is now possible in HTML5
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
2020-06-30 22:29:24 +03:00
OverloadedOrama 637a60d9ee Saving .pxo files in HTML5 is now possible
Addresses #280
2020-06-30 20:25:43 +03:00
OverloadedOrama a517f9178a Fix png files not being recognized when being exported from the HTML5 build 2020-06-30 18:38:26 +03:00
OverloadedOrama fb7c1a1874 Saving .png files is now possible in HTML5
Addresses #280. Huge thanks to https://github.com/Pukkah/HTML5-File-Exchange-for-Godot
2020-06-30 18:32:16 +03:00
OverloadedOrama 6b26bb5b10 Removed custom blend_rect() method from DrawingAlgos 2020-06-30 15:07:09 +03:00
OverloadedOrama b15e846f29 Replace hardcoded shortcut strings in Global.update_hint_tooltips()
Addresses https://github.com/Orama-Interactive/Pixelorama/issues/273#issuecomment-650149617
2020-06-27 16:01:17 +03:00
Manolis Papadeas 4f0c0d77c5
Added "Test" GitHub Actions Workflow (#269)
* 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
2020-06-25 18:18:20 +03:00
OverloadedOrama fa2dfb6bca Change image offset in Resize Canvas 2020-06-24 03:21:44 +03:00
OverloadedOrama 8e2fe8dac3 Ability to import an image file as a pattern
Also moved some pattern importing code from Import.gd to Global.create_pattern_button()
2020-06-24 00:25:54 +03:00
OverloadedOrama 047561b95a Added options for when importing an image as a new frame or layer
The user can now choose which layer they want the new frame to be, and, similarly, which frame they want the new layer to be when importing an image.
2020-06-22 15:57:42 +03:00
OverloadedOrama 76b7014d84 Added UndoRedo support for importing images as frames and layers 2020-06-21 21:39:16 +03:00
OverloadedOrama 40a01f1da3 Added import image as a new layer of the current project
Just realized that I forgot to add undo/redo support of importing images as new frame/layer, oops. Will fix next.
2020-06-21 21:20:39 +03:00
OverloadedOrama f260971056 Added import image as a new frame of the current project
Will also add a way to let the user choose which layer the new cel of the imported image will be.
2020-06-21 21:02:03 +03:00
OverloadedOrama 25d9aca0c4 Drag and drop palette files to open them 2020-06-17 16:47:24 +03:00
OverloadedOrama f7cc9a8104 Added ability to import images as palettes 2020-06-17 03:56:46 +03:00
OverloadedOrama 28818171d4 Call Global.dialog_open when a PreviewDialog pops up/gets hidden 2020-06-17 02:58:24 +03:00
OverloadedOrama 13613703fc Importing spritesheets is possible again 2020-06-16 17:59:56 +03:00
OverloadedOrama 57d4156341 Added a preview dialog that opens every time the user imports an image file
The dialog does not appear on .pxo files. Import options will be added on it soon.
2020-06-13 20:58:43 +03:00
OverloadedOrama 7219a5a274 Added Resize Canvas option to Image menu 2020-06-13 20:22:25 +03:00
OverloadedOrama 53b91a4bf4 Moved image effect code to DrawingAlgos.gd
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.
2020-06-13 18:57:28 +03:00
OverloadedOrama c6b977d48e Set the main viewport's cursor to be cross, and set it as a custom cursor image
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
2020-06-13 18:09:46 +03:00
OverloadedOrama 2e587e3634 Made TopMenuContainer.gd and moved all the menu code there from Main.gd
Main.gd is now easier to read
2020-06-13 17:59:57 +03:00
OverloadedOrama a05f8ac4ab Use Image class' blend_rect method if Godot's version is 3.2.2
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.
2020-06-13 15:30:58 +03:00
OverloadedOrama e6aea97f1b The world_2d of the preview viewports is no longer the same as the main viewport's
A "CanvasPreview" Node2D has been added to every preview viewport, where it draws the current frame. This solves #205.
2020-06-12 02:27:21 +03:00
OverloadedOrama 2371238ec0 Removed Import option from the file menu
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.
2020-06-12 01:11:58 +03:00
Kinwailo 860173d9a1
Change the line2d to plot line pixel when drawing line. (#260) 2020-06-10 14:19:20 +03:00
OverloadedOrama b0338ab09a Changed structure of .pxo 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.
2020-06-10 04:17:39 +03:00
Darshan Phaldesai 49b61db891
Added the ability to draw on Tiling Mode Previews (#259)
Also added hovering brush preview for same
2020-06-09 21:13:34 +03:00
OverloadedOrama 76af8a3214 Change paths in the open/save dialogs when switching project 2020-06-09 20:19:55 +03:00
OverloadedOrama 01ce3a3932 When opening a project and the current tab is empty, open it in that tab
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.
2020-06-07 01:48:35 +03:00
OverloadedOrama 5fda35c2d8 Fixed issues with saving and backups 2020-06-06 02:52:17 +03:00
OverloadedOrama 709a401373 Save backups for all opened projects
current_save_paths and backup_save_paths in OpenSave.gd are arrays now, have paths for every project
2020-06-06 02:16:53 +03:00
OverloadedOrama 9ffce37c0b An asterisk is added to the tab name if there are changes
The window title also changes when switching tabs. And yes, "has_changed_changed" is a stupid method name, I'll find another one sometime later.
2020-06-05 20:15:40 +03:00
OverloadedOrama 6d87901056 Imported image files now open in an new tab
Keep in mind that opening an image file as a new frame might not work properly yet, if the target image has a different size.
2020-06-05 19:51:06 +03:00
OverloadedOrama 1b1c7f844f .pxo files now get opened in a new tab 2020-06-05 18:54:11 +03:00
OverloadedOrama b276999b12 Closing tabs is now possible 2020-06-05 17:50:52 +03:00
OverloadedOrama 4af130bc61 Project brushes change when switching projects
A new Global.file_brushes array is used for the file brushes, and the Project class has its own brushes array for the project brushes
2020-06-05 17:21:35 +03:00
OverloadedOrama 35969b2f67 Moved the _min and _max variables to Project.gd 2020-06-05 16:06:59 +03:00
OverloadedOrama ae381a8714 Change canvas and timeline when a tab is being pressed 2020-06-05 04:30:31 +03:00
OverloadedOrama 709a6d470e Added basic UI for tabs 2020-06-05 02:48:38 +03:00
OverloadedOrama f9bd590d20 Moved size variable from Canvas.gd to Project.gd 2020-06-04 23:20:20 +03:00
OverloadedOrama 4e111a7ac0 Created a Projects class
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.
2020-06-04 21:05:36 +03:00
Manolis Papadeas bb5e70b965
Update Global.gd 2020-06-04 20:30:01 +03:00
Manolis Papadeas b6dec2d500
Merge branch 'master' into refactoring 2020-06-04 20:28:22 +03:00
OverloadedOrama 2e5ff236d7 Renamed the _limit variables
See https://github.com/Orama-Interactive/Pixelorama/issues/232#issuecomment-638718662
2020-06-04 18:20:56 +03:00
Kinwailo 30f8891f21
Move pixel perfect and mirror code to drawers class (#255) 2020-06-04 14:11:24 +03:00
OverloadedOrama 54b628f6cb Made a Frame class, no longer use multiple Canvases for multiple frames
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.
2020-06-03 02:14:24 +03:00
Manolis Papadeas 881e53dadc
Bring refactoring changes to master (#253)
* 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>
2020-06-02 20:00:18 +03:00
Manolis Papadeas d8136a3e17
Merge branch 'master' into refactoring 2020-06-02 19:58:58 +03:00
OverloadedOrama 34bc528e97 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.
2020-06-02 05:14:05 +03:00
OverloadedOrama e229ad1519 Fixed issue where if you moved a frame to the start (move left), it was invisible 2020-06-01 19:03:08 +03:00
OverloadedOrama df0032c515 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.
2020-06-01 18:50:31 +03:00
OverloadedOrama f246ed1a7a Fixed linked cel crash and layer naming 2020-06-01 16:56:23 +03:00
OverloadedOrama a9ca858303 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.
2020-06-01 16:42:53 +03:00
OverloadedOrama 1762383c6b Use enum instead of strings for Global.theme_type
Another potential small performance boost when changing themes.
2020-06-01 03:36:07 +03:00
OverloadedOrama e1788a19ef Ignore warnings
I don't know what else to do about them, they seem trivial anyway
2020-06-01 03:11:00 +03:00
OverloadedOrama b17ec93dbb Remove draw_pixel(), use draw_pixel_blended() instead 2020-06-01 02:49:54 +03:00
OverloadedOrama c06999a57f Refactored DrawingAlgos.draw_brush(), made draw_pixel() method
This also fixes alpha blending and lighting/darkening issues when drawing pixels with mirroring.
2020-06-01 02:32:44 +03:00
OverloadedOrama 9b4956b4f1 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
2020-06-01 00:44:53 +03:00
Kinwailo 69f08e90fd
Refactoring perferences dialog (#251) 2020-05-31 23:04:59 +03:00
OverloadedOrama 9c59dc1c88 Use Global.Mouse_Button instead of strings for comparison
This should be a slight increase in performance
2020-05-31 18:46:47 +03:00
OverloadedOrama 4cc0ccb97b 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)
2020-05-31 18:40:47 +03:00
OverloadedOrama c538140de2 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.
2020-05-31 18:03:44 +03:00
OverloadedOrama 5b7d161ecf Use enums instead of strings for tools
This could be a slight increase in performance
2020-05-31 16:04:33 +03:00
rob-a-bolton 145e3de7c4
Gimp palette import fixes. Support for newer format, and support for unnamed colours (#250) 2020-05-31 13:51:08 +03:00
OverloadedOrama 4fc2888b68 Removed coord clamping from fill_gaps()
This should make line making behave as expected when the mouse is outside of canvas boundaries
2020-05-31 00:42:35 +03:00
OverloadedOrama 7a509a2047 Moved draw_brush() and fill_gaps() from Canvas.gd to DrawingAlgos.gd
draw_brush() is currently very ugly and probably needs inside refactoring
2020-05-30 00:46:58 +03:00
OverloadedOrama 00a0ab882a 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.
2020-05-29 03:16:44 +03:00
OverloadedOrama 379b574257 Split code from PreferencesDialog.gd to HandleLanguages.gd
Also moved PreferencesDialog script & scene to src/Preferences. More Preferences code splitting will follow.
2020-05-28 03:41:28 +03:00
Igor Santarek aae3ae0cf4
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>
2020-05-24 00:22:06 +03:00
OverloadedOrama d2539f44f0 Removed brush_selected signal 2020-05-21 20:33:00 +03:00
OverloadedOrama 1740c11513 Made XDGDataPaths extend Reference
This could clear the "ObjectDB Instances still exist!" and "Resources Still in use at Exit!" errors when you exit Pixelorama.
2020-05-12 04:01:04 +03:00
OverloadedOrama 62a695366a Toggled autosave on by default, and open last project off by default 2020-05-11 16:15:59 +03:00