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

1890 commits

Author SHA1 Message Date
Emmanouil Papadeas 893b2a8c7f Make palette swatches use TransparentChecker.tscn 2023-12-23 22:03:44 +02:00
Emmanouil Papadeas 1b9e0c1ea0 Hide transparent background in cel buttons if they are empty
Since changing the self_modulate no longer seems to have any effect. Changing the alpha in the shader itself would be a bad idea, since it would require every button background to have its own material, instead of sharing the same one.
2023-12-23 21:57:18 +02:00
Emmanouil Papadeas 165217acc3 Fix palette swatch highlight not being shown 2023-12-23 21:44:38 +02:00
Emmanouil Papadeas 06b405dae8 Implements palette sorting 2023-12-23 19:00:24 +02:00
Emmanouil Papadeas 9bf8eb13c4 Align tool buttons to the center 2023-12-23 13:30:01 +02:00
Emmanouil Papadeas 65ab504e22 Add a MarginContainer in the onion skinning settings dialog 2023-12-23 13:26:38 +02:00
Emmanouil Papadeas 0cb98f6e2e
Revert palette file format back to JSON (#967)
* Some static typing and use notification to check if the theme has changed in swatches

* Use Vector2i for scrolling, hide scrollbars in the node properties

* More static typing improvements

* More static typing & docstring improvements, remove some methods from Palettes.gd

* [WIP] Go back to json for palettes instead of tres

* Revert back to using dictionaries for palette colors instead of array

Reverts part of the previous commit

* Read width & height from files, don't store the name

* Fix palette renaming

* Copy non-json palettes into json files

* Fix palette duplication

* Add a new _fill_imported_palette_with_colors() to avoid duplicate code in import file methods

* Fix palette file importing when not initialising

* Export palettes as images

* Replace "tres" with "json" filter in the open sprite dialog

* When exporting a palette as an image, automatically set the file name to the palette name

* Replace default palette files with json

* Remove the Global.palette_panel variable, use signals instead.

* Static typing in signals

* Fix warning in Palettes.gd

* Fix formatting

* Add missing comments to the palette files

* Update Palettes.gd

* A few more static typing improvements
2023-12-23 00:28:35 +02:00
Variable 54604fa0af
Allow Internal extensions (#963)
* Moved tools to Extension

* removed accidental change

* code re-arrangement

* some improvements

* Restored tools and some improvements

* typo

* re-arranged tools

* formatting
2023-12-20 16:23:20 +02:00
Emmanouil Papadeas 65c2a770d7 Set is_quitting_on_save = false after saving while quitting
Just in case a project gets saved while quitting, and for the next project, the user cancels.
2023-12-18 21:30:30 +02:00
Emmanouil Papadeas 42e8c8cb50 When saving, don't include ".pxo" in the project name 2023-12-18 20:56:38 +02:00
Emmanouil Papadeas 10ca31b916 Add "include blended images" in SaveSpriteHTML5.tscn, and use save_project() for both desktop and web platforms 2023-12-18 20:55:40 +02:00
Emmanouil Papadeas 89b17177a1 Show multiple save confirmation dialogs on quit for each project that has changes 2023-12-18 20:23:55 +02:00
Emmanouil Papadeas be2245ca76 Put add/remove swatch color on the same horizontal container as the palette select and add/edit palette buttons
This allows for horizontal placement of the palette panel without any wasted space
2023-12-16 23:13:11 +02:00
Emmanouil Papadeas 9034b32d44 Use a MenuBar node in the top menu container
I didn't know this was a new node in Godot 4, very cool
2023-12-16 22:25:06 +02:00
Emmanouil Papadeas 0996d0405e Fix create and edit palette dialogs being very long 2023-12-16 22:07:11 +02:00
Emmanouil Papadeas b42c2d4cae Fix crash reported in #960 2023-12-15 18:54:10 +02:00
Variable 8d09713774
ExtensionApi Improvements (#959)
* Improved signal api

* added two more signals

* Improved debug messaging system

* fix typo
2023-12-14 03:44:50 +02:00
Variable 17ee10a131
[ExtensionsAPI] Implement an Import API (#957)
* Added ImportAPI

* Delete src/UI/Dialogs/PreviewDialog.gd

* Delete src/UI/Dialogs/PreviewDialog.tscn
2023-12-12 16:04:49 +02:00
Emmanouil Papadeas 6b5ba2bf0f Fix brush and palette importing not working 2023-12-10 14:23:14 +02:00
Emmanouil Papadeas a5e73e1fcd Fix layers not being rendered on certain devices
Looks like some kind of textureSize() bug with sampler2DArrays when accessing the z member. I have only confirmed this bug on an AMD GPU. Nevertheless, it should be fixed now with this workaround.
2023-12-10 02:59:30 +02:00
Emmanouil Papadeas 495c3b8ebe Don't call project_changed() whenever a reference image gets imported 2023-12-07 16:09:00 +02:00
Emmanouil Papadeas 91bf44c4fb Make the RGB buttons pressed by default in Invert Colors & Desaturate dialogs 2023-12-07 00:21:58 +02:00
Emmanouil Papadeas df0cbe0bc2 Add margins to the palette container 2023-12-06 22:32:24 +02:00
Emmanouil Papadeas 30827461fd Add margins to the tool options 2023-12-06 21:55:13 +02:00
Emmanouil Papadeas dc06e3aa06 Change dark theme colors and remove unneeded items 2023-12-06 20:34:50 +02:00
Emmanouil Papadeas f801b5bc07 Minor UI improvements
Replaced the "FX" text with a texture in the timeline's FX button, added left and right margins in the DockableContainer
2023-12-06 17:34:03 +02:00
Emmanouil Papadeas aacd41f2e5 More z-index layer ordering fixes 2023-12-06 15:11:04 +02:00
Emmanouil Papadeas b40fef2c97 Fix the layer order being wrong 2023-12-06 04:29:35 +02:00
Emmanouil Papadeas 8ca0e12b90 Attempt to fix the "add layer" button not working when pressed 2023-12-06 04:16:53 +02:00
Emmanouil Papadeas c8bead14b2 Fix crash when the palette directory doesn't exist 2023-12-06 03:57:26 +02:00
Emmanouil Papadeas 359f509d57 Make the opacity slider affect layer opacity instead of cel opacity
And move cel opacity inside the cel properties.
2023-12-06 03:44:55 +02:00
Emmanouil Papadeas c0a8202145 Add cel properties and z-index to individual cels 2023-12-06 03:22:33 +02:00
Emmanouil Papadeas f893e68d59 Move even more code away from Global and Project to AnimationTimeline
This time related to layer buttons
2023-12-05 02:04:34 +02:00
Emmanouil Papadeas 80e351a2a1 Move some code away from Global and Project to AnimationTimeline 2023-12-05 01:46:42 +02:00
Emmanouil Papadeas d60c686368 Fix typo 2023-12-05 01:13:46 +02:00
Emmanouil Papadeas f40ef6f329 Some more LayerButton.gd code improvements 2023-12-05 01:11:51 +02:00
Emmanouil Papadeas 5ece616a9a Only use one LayerButton scene instead of using inheritence
And make some code improvements in LayerButton.gd
2023-12-05 01:08:26 +02:00
Emmanouil Papadeas a627cff107 Only have one CelButton scene instead of using inheritance 2023-12-05 00:40:16 +02:00
Emmanouil Papadeas 41fdba266a Organize layer and cel class files by putting them in folders 2023-12-05 00:33:26 +02:00
Emmanouil Papadeas 29f4f52600
Change the file format of pxo to be a ZIP (#952)
* Save pxos as zip files in disguise

* Load pxo files as zip

* Add a checkbox in save dialog to let users include the final blended images in the pxo or not
2023-12-05 00:12:05 +02:00
Emmanouil Papadeas 9a85de74b5
Make the color picker be always visible in the UI instead of a popup (#953)
* Initial work of a color picker that is always visible

* Make the new color picker fully functional

* Minor UI fixes

* Change the UI a bit so the color picker buttons look like they used to

To save horizontal space

* Add sliders as a separate panel and rename some file names

* Move the left/right color buttons next to the hex text edit

* Add color picker sliders to the same panel as the rest of the color picker, as an expandable/collapsible area

* Change default layout

* Some minor UI improvements

* Remove guides from ColorPicker.tscn

* Reduce the lines of code that calculate the average color

* Make Pixelorama remember if the color picker is expanded and its color mode

* Update tallscreen.tres

* Update tallscreen.tres

* Pixelorama now also remembers the last used picker shape

* Add some extra comments in the code

* Fix typo

* Add some translation strings
2023-12-05 00:10:42 +02:00
Emmanouil Papadeas d2734ab044 Add a basic stabilizer
Not as powerful as other art software, but should be enough for pixel art
2023-12-04 14:55:38 +02:00
Emmanouil Papadeas 1b22e75034 Some timeline UI improvements 2023-12-01 21:13:28 +02:00
Emmanouil Papadeas 8c34532cda Store layer effect data in pxo files 2023-12-01 03:12:55 +02:00
Emmanouil Papadeas 4f1705c1e1 Update project.godot and fix formatting 2023-12-01 02:18:35 +02:00
Emmanouil Papadeas 5b1c79df05 Make undo/redo support echo again
Thanks to Godot 4.2!
2023-12-01 02:12:02 +02:00
Emmanouil Papadeas 4b84803456 Loop through frames when clicking on go to previous/next frame buttons on the timeline 2023-11-29 02:47:33 +02:00
Emmanouil Papadeas ab3fb9a975 Fix bug where using shortcuts to switch between frames also moved the selection, causing deletions 2023-11-26 14:04:11 +02:00
Emmanouil Papadeas e58993d1e3 Fix crash when linking and then unlinking cels, use set_image() and update() instead of create_from_image() 2023-11-25 17:08:41 +02:00
Emmanouil Papadeas 56264fda3b Fix not being able to transform if the selection size is bigger than the project size
Also introduces a new `return_cropped_copy()` method in SelectionMap to avoid duplicate code.
2023-11-25 00:18:44 +02:00
Emmanouil Papadeas bc8a9de4db Optimize layer blending modes and make them work on all GPUs (hopefully) - Fixes #938 2023-11-25 00:10:19 +02:00
Emmanouil Papadeas 88a2ef593e Fix project tab title not updating when loading a file and replacing an empty project 2023-11-23 16:34:25 +02:00
Emmanouil Papadeas e4373ded07 Set the default clear color to its correct value when Pixelorama first starts and no theme/clear color option has already been set in the preferences before
Also removes a piece of unnecessary code.
2023-11-22 17:54:33 +02:00
Emmanouil Papadeas 4024858292 Set the minimum size of the layer buttons container to be the same as the size of the layer options container 2023-11-22 17:44:38 +02:00
Emmanouil Papadeas 29a5994cec Fix canvas preview play button minimum size 2023-11-22 17:22:57 +02:00
Emmanouil Papadeas 768869b519 Limit outline width step to 1 and allow lesser/greater values for shader-generated sliders 2023-11-22 17:18:37 +02:00
Emmanouil Papadeas d5c520643b Fix layer button hierarchy lines being drawn in the wrong position 2023-11-22 17:12:30 +02:00
Emmanouil Papadeas d84c2dd6f3 Fix crash when deleting a layer that is being renamed 2023-11-22 15:18:55 +02:00
Emmanouil Papadeas 74273d5b59 Fix frame duration being set to x1.01 instead of x1.0 by default 2023-11-22 03:59:21 +02:00
Emmanouil Papadeas 08b03ae0e5
Implement layer effects (#940)
* Basic logic for layer effects

* Add an FX button and the ability to add effects, no way to remove or change properties of effects yet

* Basic and ugly UI for adding and removing effects, no property changing yet

* Swap effects

* Fix preload shader paths

* Change parameters for layer effects

* Change gradient parameter in layer effect shaders, and other fixes

* Use CollapsibleContainers for the shader properties

* Set the correct gradient interpolation mode and color space in the UI

* Make effects of group layers apply to children

* Change `apply_fx` to `apply_effects`, formatting, some extra doc comments

* Apply effects to other canvases, when merging layers and when exporting

* Display humanized names of the shader unifrms

* Some UI improvements to the LayerEffectsSettings

* Add an Enabled button in the layer effects window, and change checkboxes to checkbuttons

* Change BaseLayer.apply_effects() to take a cel as a parameter instead

* Make layer effect buttons be affected by the modulate icon color

* Add option in the View menu whether layer effects are displayed in the canvas or not

* Rename `apply_effects()` to `display_effects()`

* Add translation strings

* Add nearest filter to the gradient map

* Don't change Main.tscn

* Fix more translations

* Change the default cursor shape of the generated UI elements of the layer effects

* Add undo/redo and effect application (apply effect destructively)

There are some errors due to the usage of anonymous lambda methods in undo/redo, but it seems to be working well regardless.

* Make layer effect application work on all cels
2023-11-22 01:06:25 +02:00
Variable d532aee550
Added Measurements to move tool (and other fixes) (#932)
* fixed mouse guide, added measurements

* typo

* code improvements

* change width

* fixed accidental uneven indentation

* minor fixes

* formatting

* formatting

* fixed ui of canvas preview container

* centered labels of tool names

* changed text overrun behaviour of Mode to Ellipsis

* use grid container

* Revert "use grid container"

This reverts commit 8ac9ac2aae.

* Revert "changed text overrun behaviour of Mode to Ellipsis"

This reverts commit eec1482e5f.

* Revert "centered labels of tool names"

This reverts commit 9720e37ef8.

* Revert "fixed ui of canvas preview container"

This reverts commit 9809fa3336.
2023-11-21 16:54:03 +02:00
Variable 60d4b1fd81
Make cloned frames only select a cel if it's coresponding original cel was selected as well (#942)
* cloned frames only keep original selected cels as selected

* Fixed PasteTagPopup dialog, fixed tag created immediately after starting pixelorama not placed correctly

* formatting

* typo
2023-11-21 16:48:48 +02:00
Variable 07fe676f4f
Exposed get_enclosed_image() to API (#944)
* Exposed get_enclosed_image() to API

* minor adjustments

* did the suggested changes
2023-11-20 14:43:40 +02:00
Variable 5d858eb0ec
revised project api (#945) 2023-11-20 14:30:26 +02:00
Variable b71353cd75
fixed some typos (#943) 2023-11-19 14:04:19 +02:00
Emmanouil Papadeas 417102da22 Fix selection resizing when transforming content 2023-11-17 18:54:21 +02:00
Emmanouil Papadeas 16a2f524b3 Slightly optimize the start of transformations with selections 2023-11-17 17:24:19 +02:00
Emmanouil Papadeas 78ab0bf3db Remove comments left over by the previous commit
Oops
2023-11-15 04:04:41 +02:00
Emmanouil Papadeas e6d5329254 [Undo/Redo] Compress SelectionMaps stored in memory, get rid of a lot of selection_map_copy instances 2023-11-15 03:53:52 +02:00
Emmanouil Papadeas 2c5ece53dd [Undo/Redo] Compress images when replacing cels and merging layers 2023-11-14 17:08:09 +02:00
Emmanouil Papadeas 9279a8e0ab Save compressed images in undo/redo memory when scaling and centering frames 2023-11-14 03:57:02 +02:00
Emmanouil Papadeas 5d7da079cc Fix shader-based rotation not working 2023-11-14 03:27:05 +02:00
Emmanouil Papadeas e22794e611 Compress mirror image in undo/redo 2023-11-14 03:18:08 +02:00
Emmanouil Papadeas 4f5f37a522 For the move tool, only store the difference vector in undo/redo
Instead of storing copies of entire images. This is a bit slower on the CPU side, mostly on larger canvases, but it is a massive RAM optimization. Perhaps it could be move optimal to use a shader here.
2023-11-14 00:58:53 +02:00
Emmanouil Papadeas e62548517f Compress image data saved in undo/redo for image effects, buckets and selection transformations 2023-11-14 00:48:02 +02:00
Emmanouil Papadeas e2fce61980 Change some statements in ExtensionsApi's PanelAPI to check for class names instead 2023-11-12 02:02:02 +02:00
Variable 7fbc3aa210
documenting global.gd autoload (#937)
* added some docs to global

* more docs

* completed preference docs

* removing typos

* added more docs

* some more docs

* some doc revisions

* typo

* removed typos

* added more docs

* completed global doc

* fix typos

* changed some stuff

* replaced (Preference Variable) with "Found in preferences"
2023-11-12 01:16:51 +02:00
Emmanouil Papadeas 94b3e75f30 Mark dialogs as popup_windows
So they can close when the user clicks outside the window on Godot 4.2
2023-11-11 03:12:49 +02:00
Emmanouil Papadeas 397e9e7c17 Fix recent projects submenu not working on Godot 4.2.beta5 2023-11-11 01:55:14 +02:00
Emmanouil Papadeas 90ef7c0d16 Resize image effect preview images to (1, 1) when the dialogs are being hidden
So that they do not waste RAM for no reason anymore
2023-11-10 23:15:24 +02:00
Emmanouil Papadeas 786cc39e89 Fix memory leak when applying image effects 2023-11-10 22:51:15 +02:00
Emmanouil Papadeas 970d1d3c23 Fix issue where nothing would be drawn in the canvas if the first cel is a GroupCel 2023-11-09 02:07:08 +02:00
Emmanouil Papadeas ffd9d2bca8 Update tile mode opacity when changed from the preferences, and remove unused variables 2023-11-08 19:01:31 +02:00
Emmanouil Papadeas c8a69e2913 Fix some UI issues in FrameTagDialog 2023-11-08 16:22:53 +02:00
Emmanouil Papadeas be83c94693 Change OS.has_feature("standalone") to "template" instead
Which is the new name for the tag for exported builds in Godot 4
2023-11-08 15:57:01 +02:00
Variable 45736cf624
Added Godot generated documentation to the ExtensionsApi and some classes (#925)
* ExtensionsAPI.gd to ExtensionsApi.gd

* added docs to outer Api

* added empty line

* added docs to GeneralAPI

* added docs to MenuAPI

* added docs to DialogAPI

* added docs to PanelAPI

* added docs to ThemeAPI

* added docs to ToolAPI

* added docs to SelectionAPI

* added docs to the remaining APIs

* fix typo

* formatting

* linting

* linting

* documented AnimationTag class

* documented BaseCel class

* more accurate instructions to generate api

* improve/clean docs a bit

* documented BaseLayer class

* linting

* added some more docs

* Update BaseLayer.gd

* typo

* added some more info
2023-11-08 01:22:55 +02:00
Emmanouil Papadeas 79ff486c7b Put all of the image effect shaders in an Effects folder 2023-11-07 00:52:25 +02:00
Emmanouil Papadeas ec57e5173d Make the canvas preview use the same material as the main canvas except when its animation is being played
This is both an optimization and it restores live changes of the canvas preview when the user is drawing, without any extra performance cost, since the material is the same.

The only case when the canvas preview is using a different material is when its animation preview is being played, so it can show a different frame than the main canvas.
2023-11-06 22:51:21 +02:00
Emmanouil Papadeas 5b67880a9b Fix tool shortcuts not working with Control
Addresses #935
2023-11-06 02:42:33 +02:00
Emmanouil Papadeas 0e5cc58058 Fix random brushes not working 2023-11-06 01:28:54 +02:00
Emmanouil Papadeas 8a87f721b8 Fix the sides of the textures of layers drawn on the canvas being repeated when using the Move tool 2023-11-02 16:06:52 +02:00
Emmanouil Papadeas f62d7d4f6a Make "Shift + Delete" the default shortcut for removing frames 2023-11-01 17:46:21 +02:00
Emmanouil Papadeas a13881ef58 Make animation button visible on DropShadow dialog 2023-11-01 17:44:20 +02:00
Emmanouil Papadeas 8ffcfd7bd9 Fix global increment/decrement actions of shape tools and change "Fill Shape3D" to "Fill Shape" 2023-11-01 17:33:53 +02:00
Emmanouil Papadeas 7404bf23de Fix ellipses with sizes larger than 11px sometimes producing gaps
Their thickness seemed incorrect too, this commit also fixed that
2023-11-01 17:30:29 +02:00
Emmanouil Papadeas af8ba560ac Fix ellipses having gaps with sizes bigger than 2px
Not a complete fix, sometimes ellipses still have gaps on sizes 12px and bigger
2023-11-01 15:41:15 +02:00
Emmanouil Papadeas b8e83becc9 Fix missing button shortcuts 2023-11-01 14:41:05 +02:00
Emmanouil Papadeas 1e70a15055 Fix selection transformations and move tool not updating the canvas 2023-11-01 02:55:44 +02:00
Emmanouil Papadeas 58e694abec Optimize canvas drawing by only calling queue_redraw when the image has changed 2023-10-31 14:06:59 +02:00
Variable 1d35198a25
Ask user if they wish to delete Extensions permanently or not (#919)
* don't delete extensions permanently

* some further improvements to the previous commit

* add a tab to make log reading easier

* move to bin on uninstall

* attemp fix formatting

* attemp fix formatting

* attemp fix formatting

* attempt fix formatting

* attempt fix formatting

* attempt fix formatting

* attempt fix formatting

* Ask user if they prefer their extensions fried or disintegrated

* removed accidental change

* formatting

* fix uninstall dialog not apearing

(missed it due to a small blunder)
2023-10-29 13:55:22 +02:00
Variable 9e8d210623
Improve cel3d Gizmos (#929)
* improved gizmos

* removed accidental unused variable

* typo
2023-10-27 19:26:24 +03:00
Emmanouil Papadeas 16a4ae6899 Fix origin of 3D shapes exported from 0.x being scaled
Continuation of #927
2023-10-25 00:42:13 +03:00
Variable c3a651f01d
Fix cel3d compatibility when transferring project from 0.x to 1.0 (#927)
* part 1/2

* part 2/2

* increased pxo version

* improvements

* formatting

* formatting (missed this one on last commit)

* fix capsule and text 3d

* formatting

* fixed capsule shape

* Fixed text mesh and exposed some new parameters

* fix some typos

* Fixed some bugs

* minor typo

* formatting

* thin lines on hover, thick lines on select

* add proposed changes
2023-10-24 13:26:24 +03:00
Emmanouil Papadeas 895636272b Fix canvas not immediately updating when adding/removing 3D objects 2023-10-23 01:54:36 +03:00
Emmanouil Papadeas ff8f06bd47 Fix blend mode option button selecting the wrong option when changing cels 2023-10-23 00:52:01 +03:00
Emmanouil Papadeas a84b92c5a8 Some timeline UI changes, translation and documentation for the blend modes 2023-10-22 17:53:45 +03:00
Emmanouil Papadeas 8de9697be0
Layer blend modes (#911)
* Preview blend modes

No support for exporting and layer merging yet. Also need to fix the move tool preview.

* Preview blend modes on tile mode

* Raise layer limit to 1024

* Export images with layer blending modes

* Save blend modes in pxo files

* Merge layers with blending modes

* Fix crash when adding a new layer

* Preview blending in the other canvases

* Update DrawingAlgos.gd

* Move tool preview

* Re-arrange blend menu and add lighten, darken, linear burn and exclusion

* Add divide blend mode

* Add hue, saturation, color & luminosity blend modes

* Undo/redo when changing blend modes
2023-10-22 01:57:45 +03:00
Emmanouil Papadeas 6247ab2252 Fix crash when pasting 2023-10-21 16:35:38 +03:00
Variable 5e64491bee
Re-implement the ability to add custom export formats from extensions and allow preview display (#924)
* Fixed ExportApi

* Added ability for custom exporters to show their preview

* renamed a function

* Formatting

* Linting
2023-10-18 16:06:19 +03:00
Variable a5151bf739
Added new signals (#922)
* Added new signals

* fixed some kinks
2023-10-15 14:32:58 +03:00
Variable 90dd325b08
If "Save & Exit" is pressed while quitting, don't close the software if the project failed to save (#920)
* Dont quit if project failed to save

* Formatting

* spell Formatting
2023-10-14 14:25:34 +03:00
Variable fd5adef1d9
Allow user to move Palettes to Trash/Recycle Bin instead of deleting them permanently (#914)
* move paletes to bin instead of deleting them permanently

* changed emit_signal to deleted.emit()

* allow user to choose between permanent and temporary deletion

* added translation for "Move to bin"

* changed delete dialog to a confirmation dialog

* added "Delete Permanently"
2023-10-11 19:20:05 +03:00
Emmanouil Papadeas 078c212bd6 Fix some typos in the code 2023-10-04 18:25:49 +03:00
Emmanouil Papadeas fef8f02fb4 Change color spaces in gradients 2023-10-04 18:19:28 +03:00
Emmanouil Papadeas 331c46c8ee Fix undo/redo history not working when the tool changes 2023-10-02 17:20:24 +03:00
Emmanouil Papadeas e9e80e2a06 Check whether the extension being installed got copied succesfully 2023-09-09 00:03:42 +03:00
Emmanouil Papadeas 0bb6d1ddf5 Use static methods of DirAccess in some places in HandleExtensions.gd 2023-09-08 20:57:25 +03:00
Emmanouil Papadeas 07d3eb4f4b Use nearest filter in the Preview dialog 2023-09-06 03:39:59 +03:00
Emmanouil Papadeas 8fb29e050e Fix formatting 2023-09-05 02:39:01 +03:00
Emmanouil Papadeas 1901078d98 Some static typing and docstring improvements 2023-09-05 02:36:25 +03:00
Emmanouil Papadeas ea71adf308 Implement webp and jpeg exporting 2023-09-05 00:10:40 +03:00
Emmanouil Papadeas 91bfef16b3
Port to Godot 4 (#900)
* Initial conversion

* Hide some dialogs

* Update addons

* Fix errors in scripts

Temporarily commented out adding new file import types and certain Control methods that are not available in the Window class, such as get_global_mouse_position()

* Update shaders

* Fix some more errors and signals, rename "pressed" to "button_pressed"

* Even more error fixes and renaming corrections

* Fixed more errors, Pixelorama almost runs

* Update ValueSlider.gd

* Remove lock() and unlock(), more ImageTexture.create_from_image() static usage

* More static function using

* Re-add some of the dialog signals, fix window transparency

* Change instances of popup_hide to visibility_changed

* More more errors and warnings

* Fix more errors and warnings

* Get rid of errors in the output when opening Pixelorama in Godot

* Properly connect most signals without using strings

* Fix some scenes

* Don't load Main.tscn

* Emit signals directly instead of using strings

* Fix Keychain menu nodes

* Get rid of self. on most instances, as setters and getters are now always called

* Some more static typing

* Disable texture filters

* Fix zooming

* Fix int as enum warnings

* Fix tools and rename doubleclick to double_click

* Update tool scenes

* Fix tabs

* Fix create new image

* Use static typing on flood fill to speed it up

* Update static-checks.yml

* Reverts #729 for a speedup, hopefully the bug won't get re-introduced

* Fix TransparentChecker warning

* Re-add Default template

* Fix 3D cels

* Fix rotation

Project converted bug. Should be fixed by https://github.com/godotengine/godot/pull/79264

* Fix UITransparency alignment issue, thanks Variable

* Add missing OptionButton items

Hopefully that should be all of them

* Fix the appearance of CollapsibleContainer

* Change instances of world to world_3d

* Fix tool button backgrounds

* Fix Splash dialog

* Fix brush selection

* Update Main.gd

* Fix About Dialog

* Fix more zooming issues

* Fix canvas preview zooming

* Use signals for queue_redraw on project change

* Fix layer button's look

* Fix gradients

* Some gradient fixes and code cleanups, dithering is still broken

* Fix bucket

* Fix the rest of the undo_redo.add_(un)do_method() cases

* Fix guides

* Fix guide text

* Some small changes in Main

* Update Tools.gd

* Fix palette importing

* Get rid of TODOGODOT4s

* Fix the rest of the dialogs

* Update the rest of the scenes

* Fix onion skinning and frame tag dialogs

* Fix file brushes being imported twice

* Fix palette swatch crashing on double click

* Use nearest filter for some of the windows

* Remove old .tres font files

* Fix language switching

* Get rid of Keychain.action_get_first_key() on the extra shortcuts of tools

* Get rid of Keychain.MenuInputActions and directly set shortcuts to the menu items

This temporarily removes echoing support for undo and redo, this will be re-added once https://github.com/godotengine/godot/pull/36493 or https://github.com/godotengine/godot/pull/64317 is merged.

* Clean shortcut-related duplicate code in TopMenuContainer

* Remove DroidSansFallback now that system fonts can be used as fallback

* Remove 3.x settings from project.godot

* Format

* Format gdgifexporter

* Reset Keychain to its original state

* Remove textures from the dark and gray themes

* Remove all textures from the dark theme

* Better static typing in DrawingAlgos

* Use Vector2i for project size

* [Risky commit] Use Vector2i instead of Vector2 for tools

I tested it and everything seems to be working the same as before, but more testing would be appreciated.

* Format after previous commit

* Fix line angle constraint being rotated 180 degrees

This is not a regression from the previous commit(s), Godot 4 probably reversed the logic of `angle_to_point()`.

* Fix input map action not found errors when pressing Shift or Control

* Make AnimatePanel bigger, add spring interpolation

* Fix some layouts/extensions/preferences loading errors

* Fix dithering

* Update layout resources

Probably doesn't change anything at all, but I suppose it might be a good thing to do

* Small changes

* Disable filter in ResizeCanvas dialog

* Fix some preferences default button states

* Fix tile mode always having masking on

* Use integers in tile mode

* Fix checkboxes in preferences not working

* More statically typed arrays!

No need to have these # Array of X comments anymore!

* Fix "apply all" for multiple preview dialogs

* Update theme.tres

* Add HeaderSmall theme type variation

* Fix dynamics buttons

* Don't allow sub-zero zoom values

* Let zoom_out_max always remain Vector2(0.01, 0.01)

This fixes zooming on large canvases

* Bump version to v1.0-dev

* Fix ambient light not working on 3D cels

* Fix .obj loading

* Don't allow greater than max values in the zoom slider

* Set maximum zoom value to always be (500, 500)

* Set zoom slider minimum value to 1

* Some UI changes, mostly related to buttons and the timeline

* Change window titles to what they were before

* [COMPATIBILITY BROKEN WITH v0.x] Fix loading 3D cels

* Avoid changing Cel3DObject's file_path if it's the same

* Make preferences window bigger

* Fix png exporting

* Fix reference image initial size and filter setting

* Fix perspective line reverse scaling on zoom and facing 180 degrees away from cursor

* Format and some linting

* Remove most Images from the rest of the themes

* Remove all textures from all themes

* Fix drawing when the mouse gets released outside the canvas boundaries

* Format Keychain

* Implement #890

* Fix recorder

* Fix layout deletion

* Better static typing and fix empty_clicked signal-connected methods not having arguments

* Fix layout and extension directory creation if they don't already exist

* Change all instances of "HTML5" to "Web"

OS.get_name() now returns "Web" instead of "HTML5" in Godot 4

* Fix JavaScript detection

Opening files in the Web version does not yet work for some reason

* Fix formatting

* Fix lint errors

* Remove unneeded lines from rotation shaders

* Clean some rotation shader related code

* Remove ErrorManager from #891, as it's no longer needed in Godot 4

* Some docstrings

* More Vector2i and Recti replacing their float counterparts

* Remove the hardcoded shortcut from ValueSlider

Note that the brush size shortcut may not change properly because Keychain isn't updated to support Godot 4's input map properly yet.

* Fix bugs from the rebase, integer zooming is currently broken

* Format

* Fix bug where some imported images would fail to load when using smart slice

* Fix integer zooming (I think)

* Fix errors after #898

* Fix some UI issues with PreviewDialog

* Use ctrl/command instead of just ctrl in the shortcuts of the InputMap - gets rid of the need for _use_osx_shortcuts() in Main.gd

* Update Keychain and addons/README.md

* Update CI to Godot 4.1.1 (probably will not work)

* Remove XDGDataPaths.gd

* Make windows non-exclusive

* Attempt to fix macOS CI

* Attempt to fix CI

* Attempt to fix CI

* Minor fix in the dark theme, more will follow

* Silence enumerator/integer warning

* Attempt to fix macOS CI

* Another attempt to fix macOS CI

* Attempt to fix Windows & macOS CI

* fix: Recorder directory create (#903)

* Update Keychain so that the brush size shortcuts can be changed

This update generally lets users use modifier buttons (control, alt, shift, meta) with mouse buttons

* Change OSX to macOS

* Detect if multi-threading is enabled when exporting gifs

* Fix color picker not working on the top color mode

* Make some public methods private in Export.gd

* Remove Global.window_title variable

* Fix frame UI in the timeline breaking after 100 frames

* Static typing improvements for the timeline

* Better static typing for grids

* Fix typo

* Fix pixel grid not appearing

* Move preference updating code to Global using setters

This should make the code a bit more readable, as the logic for each property update can be found directly under the variable declaration, and not hidden in PreferencesDialog's preference_update() method. This also allows for changing these properties outside the preferences, if that will ever be needed. In theory it's also faster as we don't have to do all these string comparisons anymore, but I doubt this will be noticeable in practice.

* Remove RestoreDefaultButton.tscn

* Implement changing font size in the preferences

* Resize HeaderSmall font size along with the default font size

* A step towards fixing image loading in the Web version

Doesn't completely fix the issue, it requires a fix from Godot's side as well

* Implement missing input event actions for buttons

TODO: Add default shortcuts

* Do not change language and theme if they are already the defaults

Reduces the initial loading time a bit

* Remove update_hint_tooltips() as it's no longer needed, only keep it for tools

This was needed in order for hint tooltips to be successfully translated while taking the shortcuts into account. Godot 4 already it correctly for us now. Tools still need it because they contain multiple shortcut data in their tooltips.

* Change ExportDialog's PathDialog's file mode to be "open directory" and make them bigger

* Fix Vector2i + Vector2 errors in grid center snapping

* Update tooltips when the shortcut profile changes

* Fix copy-paste mistake

* Update tooltips during startup if the shortcut profile is not the default

* Fix gif warning label size in ExportDialog

* Fix BBCode in ExportDialog

* Fix some Godot 4.2 warnings

* Some CI fixes

* Static typing improvements and more inline functions

* Format

* Even more static typing, inline methods, docstrings etc

* Some more static typing improvements and inline setters

* Remove unneeded project type specifying

* Fix splash dialog error

* Fix enumerator warning

* Don't preload the font in the rules and guides

* Fix some integer division warnings

Sometimes we indeed need them to be floats

* Change some Rect2s to Rect2is

* Minor static typing improvements

* Update README, CHANGELOG, Translations

* Only load translation files when needed, reduces loading time a bit

* Update Keychain so it doesn't load languages during startup

* Lazy load all tool scenes, breaks compatibility with the extension API

Decreases initial loading time

* Format

* Very minor loading time speedups

* Remove unneeded project type specifying

* Even more static typing and docstring improvements

* Fix extension loading

* Palette docstrings

---------

Co-authored-by: ppphp <kevinniub@gmail.com>
2023-09-04 16:29:06 +03:00
Emmanouil Papadeas b2c157fa07 Release v0.11.2-stable 2023-08-31 11:38:47 +03:00
Emmanouil Papadeas 016bd67ef9 Update contributors, translators, donors 2023-08-30 15:18:00 +03:00
Emmanouil Papadeas 0cd1ef2c27 Fix snapping distance slider hint tooltip in the Preferences 2023-08-30 15:11:47 +03:00
Variable 5d1b0ccb25
Rectangular grid center snapping (#905)
* implement center snapping

* typo

* allow snap distance in center snapping

* better description of snapping distance

* Update Translations.pot
2023-08-28 14:17:05 +03:00
Emmanouil Papadeas c5970b2edb
Fix mistake caused by a previous commit when re-arranging project tabs 2023-08-26 04:52:08 +03:00
Variable 2dfab468ff
remove old (pre 0.8) .pxo loading code (#904) 2023-08-25 10:04:36 +03:00
OverloadedOrama 5afbc1a4ec Attempt to fix #901 2023-08-20 21:45:35 +03:00
TheLsbt f515dbe57e
Add a silhouette option to reference images (#898)
* Added a silhoutte system to refrence images

* Added translations

* Fixed dialogs visibility

* SilhouetteShader.tres -> Silhouette.gdshader

* Update ReferenceImage.gd

Fixed the linter issue (mabey)

* Update PreferencesDialog.tscn

Copied the code from the Pixelorama's PrefrenceDialog.tscn to my fork.

* Update ReferenceImage.gd

Created a variable at the top of the script.

---------

Co-authored-by: TheLSBT1 <theflowcorporationofficial@gmail.com>
2023-08-15 01:56:43 +03:00
Emmanouil Papadeas 3c8c72401d Release v0.11.1-stable 2023-08-12 13:35:06 +03:00
Emmanouil Papadeas 332a06fb5e Add px suffix in PreviewDialog and new string in Translations.pot 2023-08-07 15:25:33 +03:00
Emmanouil Papadeas 87acad1b0a Change hint tooltip of "merge distance" in the preview dialog 2023-08-07 15:18:03 +03:00
Emmanouil Papadeas 346a416094 [skip ci] Change hint tooltip string of integer zoom 2023-08-06 20:29:40 +03:00
Variable edc6ba5944
Fix a bug in integer zoom (#896)
* Update CameraMovement.gd

* improvement to correction in fit to frame
2023-08-06 18:54:01 +03:00
Emmanouil Papadeas 74e3ff9f0b Add strings for translation 2023-08-06 18:03:56 +03:00
Variable 63091dc90c
Added integer zoom (#894)
* Temporary prevent main.tscn (remove later)

* Added integer zoom

* formatting

* add hint

* updated label text
2023-08-06 16:19:44 +03:00
Variable 42428595c5
Spritesheet Autoslicer (#893)
* Added autoSlicer

* Fixed the remaining things (Autoslicer fully functional)

* Update RegionUnpacker.gd

* Formatting

* formatting

* formatting

* neatify

* Update RegionUnpacker.gd

* formatting

* formatting

* Update RegionUnpacker.gd

* Update README.md

* Added region unpacker class

* Optimized the region unpacker, this should now be twice as fast

addon version: f01526e50db98eea6d4d69db3c241d360887af7f

* change Smart Slicer to 5745b26a6e0b7e10bc4a46d07b5f9f0dd8f26c96

5745b26a6e

* Delete addons/SmartSlicer/Shader directory

* removed shader

* Update SmartSlicer Version

278b1c5a80b2c8b89279e405156d556732ce98d2

* Formatting (This is torture LOL)

2578b74ba84289aa109ae715b4a6c90fd5e23126

* Delete addons/SmartSlicer/addons/SmartSlicer/Classes directory

* Formatting

Version remains same

* Delete SmartSlicePreview.gd

* use _draw instead of line2d

and moved SmartSlicerPreview.gd for better organization

* Formatting

* More formatting

* Fix bugs related to import

* fix crash on attempting to open empty image

as new spritesheet tab (smart)

* removed accidental print

* fix empty image warnings
2023-08-06 14:56:39 +03:00
Emmanouil Papadeas 17fc3d0fcb Support bmp and tga image files in the Web version 2023-08-01 21:16:54 +03:00
Emmanouil Papadeas 996fb17304 Fix error caused by #891 2023-07-31 02:23:03 +03:00
Variable eec986b466
Error elaborator (#891)
* elaborate error messages

* removed accidental change

for some reason godot changes main.tscn gets changed when i open it

* Update Main.tscn

removed accidental change part 2

* formatting

* formatting

* formatting

* lint ignore
2023-07-29 19:19:17 +03:00
Emmanouil Papadeas 51268362c6 Add palette file types as filters to the Open file dialog 2023-07-19 21:01:30 +03:00
Matteo Piovanelli 8fd306b734
Compress image data that is memorized for undo/redo operations (#890)
* Compress image data that is memorized for undo/redo operations

* Fixed formatting issues
2023-07-18 20:39:36 +03:00
Emmanouil Papadeas e195e32e00 Update translators 2023-07-16 15:24:14 +03:00
Emmanouil Papadeas 19f82021b8 Fix crash on generating a palette from the current project, and non-pixel cels exist 2023-07-09 15:48:49 +03:00
Emmanouil Papadeas 6e46cf0c8d Minor code/scene changes
Renames "Centralize" to "Center", as it is a more appropriate verb.
2023-07-08 17:47:24 +03:00
Emmanouil Papadeas 8ab4d05327 Don't save the project's name inside the pxo
Instead, get it from the file's name
2023-07-08 17:28:44 +03:00
Variable fa892e1fee
[ExtensionsAPI] New SelectionAPI and more project methods (#885)
* Added more project methods

* Added selection methods

* added resize selection

* formatting

* bug-fix
2023-07-06 02:52:27 +03:00
Variable 26aa9bda38
Move Centralize Image to the frame menu (#884)
* moved centralize to frame menu

And make it effect on selected frames

* Formatting (1 of 2)

* Formatting (2 of 2)
2023-07-05 02:00:36 +03:00
Emmanouil Papadeas a099e2195d Add offset image to Keychain 2023-07-04 14:52:48 +03:00
Emmanouil Papadeas 1372d12a8f Fix ease type and interpolation not remembering their selected options 2023-07-04 13:58:20 +03:00
Emmanouil Papadeas 08064098b8 Add an offset image effect
Some functionality as the move tool, but with more precision, wrap around ability and of course animation.
2023-07-04 03:29:58 +03:00
Emmanouil Papadeas 81c0b49c59 Add animatable properties to the Gradient effect 2023-07-04 00:20:55 +03:00
Emmanouil Papadeas eac7def5b4 Add allow greater and lesser to the image effect animatable property sliders 2023-07-03 22:51:52 +03:00
Emmanouil Papadeas 6dc07d0ca2 Rename get_animated_values to get_animated_value 2023-07-03 22:45:45 +03:00
Emmanouil Papadeas 605461e968 Add image effect animatable property translation strings 2023-07-03 22:26:31 +03:00
Emmanouil Papadeas 56f7b9ccde Add a new Timeline category in the Preferences
Revert 21b4f3369f, but make that behavior toggle-able in the Preferences. Also exposes the onion skinning colors for the past and future frames, and renames "Blue-Red Mode" to "Color mode".
2023-07-02 22:18:39 +03:00
Variable ae56cae587
ImageEffect Animation 2.0 (#879)
* Better Animate System

* checkbutton to checkbox

* fixed value and saturation sliders being divided by 360 (when they should be divided by 100)

* minor code cleanup

* moved frame index code to ImageEffect.gd

* code cleanup

* more cleanup

* preview animation is now possible

* fixing things

* only hide when affect == FRAME

* formatting

* formatting

* formatting

* renamed Animate.png and a minor improvement

* removed unintentional changes
2023-07-01 00:01:14 +03:00
Hamster 3dd4806154
Set alignment of the LineEdit in Export Dialog to Left (#880) 2023-06-22 00:12:20 +03:00
Variable 3513ea73e1
Rearrange image menu (#878)
* Update Image menu Enum

* Rearrange Image menu
2023-06-17 00:16:56 +03:00
Emmanouil Papadeas 9e8f0a95f9 Call change_cel() in Project.reverse_frames() 2023-06-16 19:38:39 +03:00
Emmanouil Papadeas e9a18f8ea6 Make frame properties be for all selected frames
And fix issue where the clone, remove and reverse frames always only affected the selected frames and not the frame where the right click occurred (bug introduced some commits ago, it's not present in v0.11).
2023-06-16 19:14:00 +03:00
Emmanouil Papadeas 1d1b8d5984 Clean up duplicate layer code in Project.gd 2023-06-16 18:32:08 +03:00
Emmanouil Papadeas e6c5f88c0b Add a reverse frames menu option in the right click frame menu
Is enabled only when multiple frames are selected.
2023-06-16 18:28:05 +03:00
Emmanouil Papadeas 7ce3bd534a Auto-enlarge the canvas if the imported image is larger than the canvas size 2023-06-16 17:16:32 +03:00
Emmanouil Papadeas 180aab6360 Remove and copy frame options on the right click menu of the frames now affect all of the selected frames
This behavior is consistent with the clone and remove texture buttons
2023-06-16 16:18:57 +03:00
Emmanouil Papadeas 494673e7bc Add export dialog options for including the tag names in the file names, and the ability to change the separator character
The frame number digit count is now 4, so for example exported files are being named as "name_0001.png", "name_0002.png", ... "name_0010.png" and so on. The tag name is now not included in the file name by default.
2023-06-16 04:16:19 +03:00
Variable b75903286c
[Continuation] Auto select cloned frames, reuse tag animations (#861)
* Duplicated frames

* Added Clone Tag feature

* fix remaining tag issues

* Update AnimationTimeline.gd

formatting

* formatting

* formatting

* add icon and other remaining stuff

* formatting

* formatting

* Update AnimationTimeline.gd

* Update AnimationTimeline.gd

* some bug fixes

* some bug fixes

* make empty tags appear as (Untitled)

* linting

* Delete copy_frame.png

* Delete copy_tag.png

* Add files via upload

* removed separate button and use tag button

* UI improvements to

"Paste content from tag"

* remove some lines that appeared 

during resolving conflicts

* Update AnimationTimeline.gd

* moved paste tag code to it's own script

to reduce lines to 1000 in animation timeline.gd

* formatting

* Add files via upload

* test lint disabling

* Update AnimationTimeline.gd

* increase max file lines to 2000

* Removed accidental changes by commit:.....

1902938b98

(Due to my bad habit of dragging and dropping files instead of using git)
2023-06-15 18:28:13 +03:00
Emmanouil Papadeas 98cef503c2 Fix various typos 2023-06-15 18:00:29 +03:00
20kdc 51998092d9
Update opacity across selected frames (#865)
* Update opacity across selected frames

* Opacity frames update: Remove unnecessary frame poking
2023-06-15 13:48:29 +03:00
Variable a176622b18
Fix Ok button Text of Save and Export Dialog (#876)
to "Save" (also changes to "Save & Quit" when needed) and "Export"
2023-06-14 00:10:36 +03:00
Emmanouil Papadeas 8d5122f54c Release v0.11-stable 2023-06-13 18:05:37 +03:00
Emmanouil Papadeas 6f2e2e89ba [skip ci] Add a release date for v0.11 2023-06-13 17:53:06 +03:00
Emmanouil Papadeas 90ac3f60cb Update splash screen artworks to v0.11
Congratulations on all the winners! For roroto's animation, the apng importer is now being used.
2023-06-13 15:01:16 +03:00
Emmanouil Papadeas e7ff9a6c2e Update AboutDialog.gd 2023-06-04 23:09:28 +03:00
Emmanouil Papadeas e073790ca2 Update donors 2023-05-28 16:36:54 +03:00
Variable 10245ea056
[Targeted for 0.11.0] Export options to extension (#869)
* Added Export Options

* some improvements

* Improvements

* linting

* don't add format if it's already added

* Fix some more bugs

* fixed accidental change

* add accidentally deleted signal
2023-05-27 17:29:53 +03:00
Variable c3b0e45205
Export Gif Message (#868) 2023-05-24 12:20:36 +03:00
Variable 35e5340bd6
[Targeted for 0.11.0] Additions to ExtensionsAPI (#867)
* clear layer option button before adding new items

* removed some unneeded things and add new things

* Update ExtensionsAPI.gd

* typos
2023-05-23 19:02:34 +03:00
Variable e6cb05fe0d
limit onion sliders to 10 (#866) 2023-05-19 16:15:21 +03:00
Variable 74fea47a8c
[Targeted for 0.11.0] Make Onion skin update live with the "Move" tool (#862)
* Make onion skin consistent with move tool

* Update OnionSkinning.gd
2023-05-18 14:43:11 +03:00
Emmanouil Papadeas 361fe36d7a Make the horizontal bar of the timeline's frame buttons visible
This is useful for users that do not have a mouse wheel, such as touchscreen users. Changing themes also changes the theme for the frame buttons automatically as well.
2023-05-18 14:40:25 +03:00
Emmanouil Papadeas 1669cc1a42 [skip ci] Fix some typos in the code 2023-05-18 14:10:15 +03:00
Variable 243bb1d9aa
fix tag bug (#863) 2023-05-18 14:01:59 +03:00
Variable fdb962ba3b
Changes to PanelAPI (#858)
1) Added tab is now set by layout instead of specifying an "alongside_node"
2) Added tab is now shown in the Panels submenu
2023-05-18 13:58:41 +03:00
Variable 67a94ccc10
[Targeted for 0.11.0][Bug FIX] Mirror preview fix (#860)
* fix mirror previews

* Fix incorredt selection resizing of selection

in mirror mode

* Fix mirror previews (selection tools)

* typo
2023-05-18 13:55:08 +03:00
Emmanouil Papadeas fb4b26a060 Change occurrences of canvas_preview.frame to canvas_preview.frame_index 2023-05-17 17:34:53 +03:00
Variable 55bc6e5a8b
[Targeted for 0.11.0] Some more fixes to cel dimming in 3d cel (#856)
* hacky way to fix 3d cel dimming

* a fix
2023-05-15 16:26:50 +03:00
Variable 29b03b0332
[Targeted for 0.11.0] Fix Onion skin settings don't save between runs (#857)
* Onion skin settings don't save between runs

* formatting

* Change some spinboxes to valuesliders

* removed un-needed signals
2023-05-14 13:31:15 +03:00
Emmanouil Papadeas 308a3a2416 Fix bug where undoing after pasting, did not make the previous selection appear 2023-05-12 13:28:53 +03:00
Emmanouil Papadeas 362f4109d4 Fix issue where resizing pasted content resulted in errors 2023-05-12 13:24:49 +03:00
Emmanouil Papadeas 23720afd05 Hacky fix for a bug that makes panel tabs visible if a panel's visibility is toggled 2023-05-11 17:32:08 +03:00
Emmanouil Papadeas 298f495993 Fix a bug from #855 2023-05-11 00:35:39 +03:00
Variable e65e69f14d
Make cloned 3D cel have the same selected object as the orignal (#855)
* Update 3DShapeEdit.gd

do not set selected to null

* clone cel recieves selected cel from it's parent

* Add one more yield
2023-05-10 13:45:38 +03:00
Emmanouil Papadeas a2e184c05d Call canvas.sprite_changed_this_frame on the 3DShapeEdit tool
Fixes the dimming status of the cel button in the timeline
2023-05-09 18:47:57 +03:00
Emmanouil Papadeas 390eca554c Remove the default cube from 3D cels 2023-05-09 16:39:35 +03:00
Emmanouil Papadeas 08996fe6de Add a Cel3DButton scene for 3D cels instead of using PixelCelButton
Mostly to remove the popup menu that appears when you right click a cel
2023-05-09 16:37:32 +03:00
Emmanouil Papadeas e5aeedf3e8 Raise the vertical minimum size of the canvas preview panel 2023-05-09 14:39:14 +03:00
Emmanouil Papadeas 018673690c Minor UI change for the canvas zoom and rotation sliders 2023-05-09 13:01:24 +03:00
Emmanouil Papadeas 3052d2756e Optimize linked cels emitting the texture_changed signal, if multiple cels are selected 2023-05-09 01:29:03 +03:00
Emmanouil Papadeas 6b94b55f04 Fix linked cels remain dimmed even if they have content 2023-05-08 17:43:11 +03:00
Emmanouil Papadeas 5436298947 [3D cels] Do not display the object outline if it's behind the camera 2023-05-08 17:40:11 +03:00
Manolis Papadeas aa47133f9f Emit project_changed and cel_changed signals when opening a project that replaces the old one 2023-05-06 20:31:52 +03:00
Variable d266c87269
Fix top color picking (#854)
* fix tool

* fix default color picking
2023-05-06 14:50:37 +03:00
Emmanouil Papadeas 6dac85486a Prevent 3D gizmos from overlapping with each other 2023-05-06 14:49:59 +03:00
Emmanouil Papadeas f1b4b77745 Fix recorder not saving all layers and add more static typing 2023-05-06 14:33:44 +03:00
Emmanouil Papadeas 09c3ea1c2a Fix 3D layer current_object_id being sometimes wrong when loading pxo files
Previously, it was set to the size of the object_properties dictionary, but if the user has deleted objects, the object id would be higher than the size of the dictionary, since current_object_id never decreases.
2023-05-05 15:15:02 +03:00
Emmanouil Papadeas cf55332f18 Fix 3D Shape Edit text field cursor position changing when typing text 2023-05-05 12:43:23 +03:00
Emmanouil Papadeas e91921e832 Fix typo 2023-05-05 01:34:22 +03:00
Emmanouil Papadeas 2ed3605f0f Update contributors, translators and donors 2023-05-03 14:12:33 +03:00
Variable 44c2df98e0
Signal api (#851)
* New SignalAPI

* more project methods

* re-order

* Update ExtensionsAPI.gd

* some fixes

* fixes

* more fixes

* Fixes

* typo

* added a required `project_changed`

* Update ExtensionsAPI.gd

* Update ExtensionsAPI.gd
2023-05-01 12:50:15 +03:00
Emmanouil Papadeas 860370bd4e Add a get_class_name() method in the cel classes
I wish Godot had a method for this already
2023-04-30 14:52:01 +03:00
Emmanouil Papadeas 162d0bd2a5 Fix selection tile mode crashing when enabling it 2023-04-28 16:38:14 +03:00
Variable 7b189cc45e
TileMode for selection, (plus some other fixes) (#834)
* Tilemode selections

* Selection TileMode

* Fixed some bugs with the ORIGINAL tile mode

Image brushes needed to be adjusted

* remove behaviour checkbutton

* fixed remaining things

* formating

* formatting

* formatting

* formatting

* fix crash on rotating image

* Fix Color getting transparent on double chicking

same swatch twice

* typo

* typo

* Update RotateImage.gd

* Use sheckbox instead of option button

* make checkbox directly under select menu
2023-04-27 12:22:32 +03:00
Emmanouil Papadeas 7c14af7129 Add Cel3D in ExtensionsAPI 2023-04-26 10:52:20 +03:00
Emmanouil Papadeas 118e2e7671 Move set_nodes() logic to parent class ImageEffect
Also fixes a crash when trying to change the affected cels option in image effects that do not have animation options
2023-04-20 22:29:03 +03:00
Emmanouil Papadeas 0fe315d605 Remove separator from the image menu
Temporary, easy fix bug where assigning a shortcut to an image effect, actually assigned it to the one above.
2023-04-20 16:49:31 +03:00
Emmanouil Papadeas 91b1186d6f Remove unneeded shader parameters
Also changed the parameter names in HSV to reduce some lines of code
2023-04-20 16:21:09 +03:00
Emmanouil Papadeas 483e7df52e ValueSlider arrow buttons now respect snap_by_default 2023-04-20 16:11:16 +03:00
Emmanouil Papadeas ec2dcae8f7 Add a Posterize image effect, with optional dithering
Seems to produce the same result as GIMP's Posterize color filter. Should be useful for reducing the colors of an image, and it could work together with 3D lighting. Thanks to https://godotshaders.com/shader/color-reduction-and-dither/ for the shader.
2023-04-20 16:08:06 +03:00
Emmanouil Papadeas 9607981567 Do not call CameraMovement._input() if the cursor is not on the canvas
Slight optimization, as only one camera can now receive input at a time.
2023-04-19 21:35:29 +03:00
Emmanouil Papadeas 1a9691052e Only redraw the second canvas and canvas preview when necessary
Should optimize things ever further. Hopefully I didn't break anything.
2023-04-19 20:51:08 +03:00
Emmanouil Papadeas 0ffd34a4d6 Small optimization in CanvasPreview
On large canvases (like 4096x4096), simply moving the mouse around was laggy. It turns out that texture_to_draw = current_cels[i].image_texture was causing the lag, but I'm not sure why. It could be that texture_to_draw was a Texture and not an ImageTexture.

There is still some room for optimization, both the second canvas and canvas preview are being drawn on _input(), which is unnecessary.
2023-04-19 20:35:27 +03:00
Emmanouil Papadeas 72a7b277fb Use a ValueSliderV2 in the gradient dialog, and reverse the radius logic
The larger the radius value, the larger the circle, as it should be
2023-04-19 03:44:28 +03:00
Emmanouil Papadeas b1f355702e Add camera FOV and size to the 3D layers
Orthogonal projection is now more usable
2023-04-18 21:04:13 +03:00
Emmanouil Papadeas 1187b0bc49 Load cleanEdge shader when the rotate image or scale image dialog is shown
This should save some time on initial loading, but it introduces a slight loading time when opening the scale or rotate dialog for the first time in a session
2023-04-18 20:08:00 +03:00
Emmanouil Papadeas d04aa5ee56 Add snapping distance slider in the preferences 2023-04-18 17:20:13 +03:00
Emmanouil Papadeas 9d848c4f68 More ValueSliders in the Preferences 2023-04-18 17:03:51 +03:00
Emmanouil Papadeas 1325aaa13f Use ValueSliderV2s for grid preferences 2023-04-18 16:38:55 +03:00
Emmanouil Papadeas 02aa91a394 Fix camera jitter when zooming in the canvas 2023-04-17 18:09:49 +03:00
Emmanouil Papadeas 1196fb5b0b Use ValueSliders for the canvas zoom and rotation
Should also clean the code a little bit
2023-04-17 02:07:48 +03:00
Emmanouil Papadeas 5c8cf56f8f Make snapping distance change based on the zoom
Should work similarly to GIMP now
2023-04-16 21:15:40 +03:00
Emmanouil Papadeas 23198a84aa Small canvas preview UI changes and translation string additions 2023-04-15 13:46:42 +03:00
Chris Tsoychlakis db29ec9f0f
fixed mirrored drawing (#843)
* fixed mirrored drawing

* fix mirrored drawing
2023-04-14 15:56:08 +03:00
Variable d40b9744ed
fix canvas preview only showing first layer (#844) 2023-04-12 13:24:19 +03:00
Emmanouil Papadeas 2bca2db27a Add more licenses to the AboutDialog 2023-04-08 00:34:38 +03:00
Emmanouil Papadeas 6700a72e73 Sort contributors and donors in AboutDialog in alphabetical order 2023-04-07 03:01:02 +03:00
Emmanouil Papadeas d68032fbda Fix previous commit to only show the notification once 2023-04-07 02:16:52 +03:00
Emmanouil Papadeas 272ea63615 Only show the "File(s) exported" notification on successful export 2023-04-07 02:09:49 +03:00
Emmanouil Papadeas 60997723e2 Create a parent scene for the image effects
This helps with shared nodes, such as the preview, the affect selection, cels etc options, and the animation properties
2023-04-04 04:19:18 +03:00
Emmanouil Papadeas 8ce68700dd 3D object optimizations 2023-04-02 01:36:02 +03:00
Emmanouil Papadeas 4943ab5eab Add pxo version to pxo files, starting from 2
Its value should increase every time there is a compatibility-breaking or a major change between previous pxo files, similar to extensionsAPI version.
2023-04-01 02:16:24 +03:00
Emmanouil Papadeas 91aea32864
Implement 3D layers (#840)
* Implement 3D layers

* Remove unneeded files

* Fix bug where a single hidden layer would ignore all of the layers on top when exporting

* Fix pxo loading

* Remove junk nodes from 3DShapeEdit

Seems like they were created when I copied from the old 3D Options.tscn panel to the new 3D Shape Edit tool.

* Make light gizmos half the size, and hide gizmos when rotating

* Fix crash when using the 3D shape edit tool on a group layer

* Remove unneeded code in Canvas.gd

* Add torus in the Cel3DObject.Type enumerator

Torus isn't currently supported in Godot 3.5, but it is in 3.6 and 4.0, so this is just future-proofing. May break compatibility with .pxo files that were exported with 3D layers before this change.

* Toggle 3D object visibility

* Change texts and some variable names

* Fill translation strings

* Fix crash on group blending, and make the code in Export.blend_layers() more general

* Fix errors when attempting to draw on a 3D cel

Can occur when multiple cels are selected, some of them 3D and some of them pixel

* Make scene properties and objects be per-cel instead of per-layer

Breaks compatibility with previous .pxo files that had 3D layers. Also introduces serialize() and deserialize() methods to BaseCel

* Use if not layer is get_script() in GroupLayer.blend_children()

* Flip the condition in GroupLayer.blend_children()

* Fix bug where locked/invisible layers could get drawn

Regression from c2f6bf0f3f

* Move gizmo code to 3DShapeEdit's draw_start(), move some undo/redo logic to 3DShapeEdit

* Move all of the undo/redo code to 3DShapeEdit, simplify code in Cel3D

* Store Cel3D image data to pxo, for easy usage by external software

This makes importing projects with 3D layers to other software, such as Godot using godot_pixelorama_importer easier.

* Make the linter happy

* Fix bug where the previously selected object would remain selected when it got removed with undo
2023-03-31 21:58:56 +03:00
Emmanouil Papadeas 5f290ae343 Change resize SpinBox to ValueSlider in ExportDialog 2023-03-30 18:20:55 +03:00
Emmanouil Papadeas 78fda42743 Remove unneeded lines in AnimationTimeline.gd 2023-03-29 15:24:30 +03:00
Emmanouil Papadeas 5c9f0d8c18 Fix bug where, if the bottom-most layer is invisible, selection can't transform content on other layers 2023-03-27 03:42:16 +03:00
Emmanouil Papadeas 6b587688f1 Fix bug where clicking on previous/next frame when only one frame exists makes the cel unselected
Apparently this bug exists at least since v0.10
2023-03-27 00:24:40 +03:00
Emmanouil Papadeas 2ce9f72c51 Use a ValueSliderV2 in the drop shadow dialog 2023-03-26 21:33:33 +03:00
Emmanouil Papadeas 4e9b4c33f7 Fix LayerButton drag and drop passing wrong parameter to BaseLayer.accepts_child()
It was passing the index of the layer as an integer instead of a BaseLayer class. Also made some code stylistic changes.
2023-03-25 18:42:50 +02:00
Variable b384e706a9
Animate image effect properties (#836)
* Added auto animation system

* Animation to dialog

* Added Animated properties

* animate ranges

* formatting

* Fix missing commit

* Formatting
2023-03-25 16:59:02 +02:00
Emmanouil Papadeas acf376865f Fix crash when there is no pixel layer in the timeline, only a group layer 2023-03-24 17:37:40 +02:00
Emmanouil Papadeas acb32844a1 Replace the Locked Aspect Ratio mode in the crop tool with a lock button next to the size sliders 2023-03-24 01:17:30 +02:00
Variable 2ad1391ca1
Spritesheet Animation Canvas Preview (#835)
* spritesheet preview

* formatting
2023-03-23 15:25:33 +02:00
Emmanouil Papadeas 4e7d5d34cf Keep aspect ratio when resizing a selection with gizmos, if the button is pressed next to the ValueSliders
Also fixes a bug with the inconsistent behavior caused by resizing a selection with gizmos without pressing Shift, while the keep ratio button was pressed.
2023-03-21 16:36:25 +02:00
Emmanouil Papadeas 99b014ef7f Fix segmentation fault when resizing canvas to a large size
For some reason, cel_texture.texture.get_data() seemed to cause a segmentation fault, and then a crash, when the image size was large. Also added some extra static typing to the drag and drop methods, but they are unrelated to the crash.
2023-03-21 02:06:57 +02:00
Emmanouil Papadeas d4ebf9c585 Use Vector2s for min and max values in ValueSliderV2
This lets us have different min/max values for x and y.
2023-03-21 01:45:09 +02:00
Emmanouil Papadeas a5496daa5b Add a ValueSliderV2 to the Pencil's spacing options 2023-03-20 20:28:01 +02:00
Emmanouil Papadeas 05fa436b12 Disable ValueSliderV2's ratio button when set to not editable
And use a NinePatchRect for the ratio guides, for proper scaling.
2023-03-20 01:59:15 +02:00
Emmanouil Papadeas e174f6e942 Add a new custom node, ValueSliderV2
ValueSliderV2 is a container for two ValueSliders and an optional lock ratio button, that helps with handling Vector2 values in the UI.
2023-03-20 00:56:43 +02:00
Emmanouil Papadeas 5ed91c6d8a Fix ValueSlider's text color from staying grayed out even if the slider is editable 2023-03-19 00:36:37 +02:00
Emmanouil Papadeas df00e43b84 Do not allow the ValueSlider's global shortcut to affect it if it's hidden 2023-03-18 14:29:11 +02:00
Emmanouil Papadeas b5388093ef Add a minimum size to CanvasPreviewContainer
Fixed issues with the UI system, when changing the tab to Reference Images and then back to Canvas Preview
2023-03-17 01:24:20 +02:00
Emmanouil Papadeas c43f28b323 Manage layout dialog UI changes 2023-03-17 01:20:17 +02:00
Emmanouil Papadeas e3a163b8c7 Update Default layout 2023-03-17 00:55:34 +02:00
Emmanouil Papadeas 1a769293fc Dim cel buttons based on whether the cel is transparent/empty or not
Should replace #817, but in a more optimized way, as it does not rely on _input().
2023-03-17 00:02:01 +02:00
Variable ad3a0155b6
Set tilemask automatically (#833)
* AutoCreate Tile Masks

* removed a print()

* Disable masking by default

* changed visibility

* Remove Godot's needless changes in Main.tscn

Godot pls

---------

Co-authored-by: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com>
2023-03-16 20:07:03 +02:00
mrtripie 0ad86816e5
Crop Tool (#830)
* Added intial crop tool

* [skip ci] Removed unneeeded LINE_WIDTH constant from CropRect

* Added DimensionsLabel

* Cleaned up CropRect._draw

* Hide the CropRect after switching to a different tool

* Sets the crop values to the entire canvas size on setup

* [skip ci] Added crop tool tooltip

* Made Crop tools synced with eachother by placing the crop settings on CropRect

* Added new modes, refactored, added rule of thirds lines and darkened background

* [skip ci] reset optimization

* Renames

* [skip ci] Tweaked the darkened background

* Fixed bug with top/bottom/left/right sliders after rect refactor

* Changing width/height on locked aspect ratio bug

* Aspect ratio sliders rounding/setting a min of 1 px height/width

* Fixed bugs with drawing the crop rect, especially with locked aspect ratio

* Save the mode to config_cache

* Added size lock and renamed mode

* Added tooltip for size lock. Not sure if I did the translation file right

* removed signal that wasn't used

* Formatting

* Removed old TODO comment from one of my previous PRs that isn't true anymore

* Fixed definition order for linter

* Changed locked size modes moving to offset by @Variable-ind, reordered methods

---------

Co-authored-by: MrTriPie <MrTriPie>
2023-03-16 19:50:45 +02:00
Variable e008c39286
Added color Averaging (#822) 2023-03-15 15:05:18 +02:00
Emmanouil Papadeas ad61ddc2c0 Fix crash when opening the rotate image dialog for the second time for large canvases 2023-03-14 15:34:06 +02:00
Emmanouil Papadeas 4bf7829b0a Fix swatch getting transparent on double click 2023-03-14 15:24:15 +02:00
Emmanouil Papadeas 30d279c494 Fix image brushes being drawn outside the selection 2023-03-14 14:59:22 +02:00
Variable 0cb0f9c1bd Added recent sizes to new project (#819)
* Added recen sizes to new project

* Formatting

* Limit list size to 10
2023-03-14 13:58:40 +02:00
Emmanouil Papadeas de7ef580f9 Fix dynamics hint tooltip and add some missing dynamic-related translation strings 2023-03-09 15:22:29 +02:00
Variable d9efe97bfa
Recorder extension to core (#823)
* Add files via upload

* add fps counter

* formatting

* Update Recorder.gd

* Some improvements

* typo

* another typo

* formatting
2023-03-07 16:21:03 +02:00
Variable e88ba2cb73
Further improvements to Dynamics (#828)
* Image bruch now obeys dynamics as well

* Added a signal that resets dynamics

* formatting

* change uncheck.png

* added preview for pressure

* Added the requested changes
2023-02-28 17:07:48 +02:00
Variable f2f2f11661
Some improvements to the dynamics (#826)
* fix  dynamics

* removed empty line

* Added icon

* added check/uncheck icons

* make thresholds ui simpler

* Rename dynamics.png to lowercase and add MaxMinEdit class to project.godot

---------

Co-authored-by: Emmanouil Papadeas <manoschool@yahoo.gr>
2023-02-20 21:51:26 +02:00
Variable 0da30c015c
Move perspective lines with mouse (plus code improvements) (#821)
* Code Improvements to Perspective editor

* formatting

* fixed a bug

* Some drastic changes

* Delete src/UI/Tools directory

* Delete src/UI/UI/PerspectiveEditor directory

* Some drastic changes

* i messed up so here's the fix

* Added easy movement and rotation

* formatting

* useless script

* fix some things and add tracker disabler

* formatting

* fix incorrect length on redo

* remove useless code
2023-02-18 02:33:46 +02:00
Emmanouil Papadeas c60675b4e7 [WIP] Added dynamics, such as pen pressure (finally!) and mouse velocity affecting alpha and brush size
Alpha currently produces ugly results when drawing on top of opaque colors. See the comment in Draw.gd like 445 for more details.
2023-02-17 15:29:55 +02:00
Emmanouil Papadeas fdb24c008e Fix guide snapping segment detection
The previous method was not working for perspective guides rotated at 315 degrees, due to the test line being parallel to it. Thanks to Variable for the solution.
2023-02-13 01:21:29 +02:00
Emmanouil Papadeas 12fbeca724 Improve grid snapping
Thanks to Variable
2023-02-13 00:51:09 +02:00
Emmanouil Papadeas 83a0d93837 Update get_spacing_position() to make it more effective
Thanks to Variable
2023-02-13 00:17:55 +02:00
Emmanouil Papadeas 6f6ff98923 Implement perspective guide snapping 2023-02-12 21:32:35 +02:00
Variable 7f026aa371
Implement a spacing option for the pencil tool (#813)
* Added Code for cursor snapping

* Added the Snap option

* typo

* Fix snapvector not updating properly

* formatting

* better snapping system

This makes the stroke snapping more accurate by preferring the snap point nearest to the cursor

* changed Snap mode to spacing

* Code Improvements

* more changes

* Update Pencil.gd

* formatting

* fix max line length

---------

Co-authored-by: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com>
2023-02-12 17:46:47 +02:00
Variable 7307743f83
Added the Perspective editor (#806)
* Added Perspective Editor

* removed unintended changes

* Removed unintended changes

* removed un-intended changes

* Delete Axes.tscn

* Delete Axis.gd

* Removed MouseGuides from editor

I will add them separately

* Added MouseGuides

* Some changes

* Fixed some things

* added mouse guide

* make MouseGuides remember last setting

* don't move if dialog is open

* Dont move tracker guides if dialog is open

* UI improvement to editor

* Update VanishingPoint.gd

* UI Improvement

* Minor Color Improvements

* fixed a bug

This was causing a crash

* Some UI Changes

* Improve UI some more

* fix typo

* Added Undo/Redo and improved UI

* Formatting

* formatting

* formatting

* formatting

* Fix Definition out of order

* Fix Definition out of order

* formatting

* formatting

* fix Duplicate error

* Fix some things

* Some UI Changes

* Some code refinement

* Removed un-needed lines

* Some code refinement

* Some more UI Changes

* Changes, Changes and Changes

* Delete LineButton.gd

* Delete LineButton.tscn

* Delete PerspectiveEditor.gd

* Delete PerspectiveEditor.tscn

* Delete PointCollapseContainer.gd

* Delete PerspectiveLine.tscn

* Delete PerspectiveLine.gd

* Changed boundary separators to ColorRects

* make the guide update more frequently

* make default color have full alpha

* Dim the boundaries based on luminance

* typo

* Formatting

* Formatting

* formatting i forgot to do

* Delete VanishingPoint.gd

* Delete VanishingPoint.tscn

* Fixed rouge collapsible container

---------

Co-authored-by: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com>
2023-02-12 15:20:53 +02:00
Emmanouil Papadeas c6d6c6184c Do not automatically set the UI scale to 0.75
It seems that people who had their UI automatically scaled to 0.75 did not like this and wanted to find a way to resize the UI.
2023-02-09 01:40:51 +02:00
Emmanouil Papadeas ea746538cf Workaround to make the Dithering shader work in WebGL 1.0
Not the best way to do this, but it works.
2023-02-06 14:29:27 +02:00
Emmanouil Papadeas 6ae8d9afed Make the GradientEditor node expand horizontally 2023-02-03 02:02:13 +02:00
Emmanouil Papadeas a18c7082fa [skip ci] Add SNAP_TO in the ViewMenu enum 2023-02-02 03:45:36 +02:00
Emmanouil Papadeas 8a38eef30d [skip ci] Fix various typos 2023-02-02 03:06:23 +02:00
Emmanouil Papadeas a381e8a7de Fix ValueSlider's tint_progress not being reset after text has been confirmed 2023-02-01 02:12:09 +02:00
Emmanouil Papadeas a66a0d4954 Remove unused pressure sensitivity options in the preferences 2023-01-31 01:11:23 +02:00
Emmanouil Papadeas 53dea9c8d0 Fix dithered gradients having wrong colors
Pass a nx1 image instead of the GradientTexture, that contains all of the gradient's selected colors, where n is the number of colors.
2023-01-29 01:02:40 +02:00
Emmanouil Papadeas f26484f854 Add repeat options to the gradients, unify their code into two shaders
Have only two shaders, one for simple gradient and the other for dithered gradient generation. The gradient shape gets passed as a uniform to the shader. Gradients can now get repeated, and the size option for linear gradients is back.
2023-01-28 18:45:49 +02:00
Emmanouil Papadeas 201992fa72 Add multi-color support for gradients, remove step gradients
Gradients are no longer limited to two colors, but can now instead have as many as we want, with each color having its own offset. Step gradients have now been removed; to generate the same effect, you can now generate a linear gradient with constant interpolation. Cubic interpolation in gradients is now also possible.

The dithering shaders were by far the biggest challenge and they had to be re-written in order for them to support multiple colors, with each one having a difference offset. I have noticed that some colors may disappear when Constant interpolation is used, though, so it can be buggy sometimes. Thanks to https://godotshaders.com/shader/dither-gradient-shader/ for the reference.

ValueSliders are now also used in the gradient window.
2023-01-27 04:23:48 +02:00
Emmanouil Papadeas 42d6f12530 Implement rectangular grid and guide snapping
Snap to the rectangular grid and guides (excluding symmetry guides). Can be toggled from the View menu. Currently affects the following tools: Pencil, Eraser, Shading, Line, all shape tool and all selection tools. Although maybe this should not affect the Magic Wand and Select By Color? The snapping distance is currently unaffected by the zoom (should change), and it will be exposed as a parameter in the preferences at a later commit.
2023-01-25 04:37:03 +02:00
Emmanouil Papadeas f2a4af9c1f Fix issue where you could move selection gizmos when an overlay window is opened 2023-01-23 19:06:10 +02:00
Emmanouil Papadeas a9692ca859 Fix bug where the tool changes while having an image brush selected
The indicator appeared as a white square until the mouse moved, and errors appeared in the debugger.
2023-01-23 19:05:36 +02:00
Emmanouil Papadeas 640282f00c Minor guide code cleanup
This commit removes the unnecessary point_in_rectangle() method, as Rect2.has_point() can be used instead. I was not aware that this built-in method existed back then.
2023-01-23 01:16:50 +02:00
Emmanouil Papadeas 7143e6ca8e [skip ci] Change the focus mode of the Window menu 2023-01-22 02:03:09 +02:00
Variable 043a4de373
Upgrade the look of the brushes popup (#815)
* Upgrade the brushes popup

* upgrade brushes popup

* Formatting

* fix name of 1st brush not written

* use grid container instead of vbox

and added categories

* Some UI Changes

* typo

* Fix autowrap

* fix node paths

* formatting

* more formatting

* more formatting

And hopefully the final commit

* sigh... more formatting
2023-01-21 17:01:07 +02:00
Variable ef6ae86c8d
Make the color picker pick any visible color on the canvas, regardless of layer (#816)
* Pick top color by default

* revert accidental commit

* Pick top color by default

* formatting

* formatting
2023-01-20 16:09:49 +02:00
Emmanouil Papadeas 0a615298f5 Fix issue with selection resizing from the tool options + minor code cleaning
Removed the temp_bitmap variable completely, as it's not really needed.
2023-01-19 02:13:22 +02:00
Emmanouil Papadeas 5cb0eddae5 Transformation preview should now work for all selected cels
Prior to this commit, the transformation (moving/scaling content with selections) of only one of the selected cels would appear, and the rest would only have a visible effect on transformation confirm.
2023-01-18 04:44:37 +02:00
Emmanouil Papadeas 403539bb47 Fix issue with content being pasted in sub-pixel positions 2023-01-17 04:06:06 +02:00
Emmanouil Papadeas 5e749db0d5 Remove selection resizing code from SelectionTool and minor code cleanup 2023-01-17 03:22:55 +02:00
Emmanouil Papadeas 09ff22707b Use enums to check the rotation algorithm instead of strings in RotateImage.gd 2023-01-16 22:05:24 +02:00
Emmanouil Papadeas 7001f3a28b Remove NotificationLabel.tscn, use class_name for notification labels 2023-01-15 17:08:42 +02:00
Variable facabc1143
Fix previews (#811)
* Fix move tool preview (without selection)

* typo

* Dont snap if transformation hasn't started

* Added a can_layer_get_drawn() check

* Formatting

* remove useless line

* Formatting (Again cause i am DUMB)

* Formatting (Again cause i am DUMB)

* Better Code
2023-01-14 18:09:46 +02:00
Emmanouil Papadeas 7dc0af21e7 Create ValueSlider and CollapsibleContainer child nodes through code
This lets us create ValueSlider and CollapsibleContainer nodes properly via the add node button, instead of instancing their scenes. They have also become more a bit more themeable. Eventually, ValueSlider.tscn and CollapsibleContainer.tscn will be deleted.
2023-01-13 05:19:35 +02:00
Emmanouil Papadeas 20db211c13 Minor cleanEdge rotation optimization 2023-01-12 18:25:43 +02:00
Emmanouil Papadeas cd12b1b1b3 Animate the collapsible container arrow when the button is clicked 2023-01-11 19:37:52 +02:00
Emmanouil Papadeas 08e00d3c31 [GLES 3 only] Add OmniScale for scaling and rotation 2023-01-11 17:54:33 +02:00
Emmanouil Papadeas 8423ce7d42 Fix typo in NearestNeighbour's file name 2023-01-11 16:41:08 +02:00
Emmanouil Papadeas 01fc5cd9bd Fix wrong variable name in ExtensionsAPI 2023-01-10 21:10:05 +02:00
Variable e1facda618
Added Class System to ExtensionsAPI (#808)
* Added Class System to Api

* formatting

* removed extends

* update extension version

* Added Some New Fail-Safes

* fix typo

* Formatting

* Update ExtensionsAPI.gd

* Typo

* formatting

* formatting
2023-01-10 19:26:13 +02:00
Variable 512c85ac64
Added supported_api_versions parameter (#807)
* Added supported_api_versions parameter

* formatting

* changed a line
2023-01-08 19:17:42 +02:00
Emmanouil Papadeas 2d9bc7e660 Fix crash when attempting to draw on a GroupCel when the animation is playing 2023-01-07 20:32:02 +02:00
Variable 449ee60d49
Folders rearrangement (#804)
* Moved Reference Images to it's Folder

* Moved the rest to their respective folders

* formatting

* Fix formatting

I removed the `PackedScene` static typing declaration to reduce the number of characters in the line to less than 100. It's not really needed anyway, as Godot should be able to figure out that it's a PackedScene, since it's a tscn file, simply by using `:=`.

* reverting some changes

* Removed some un-expected things

* Fixed TransparentChecker Code

* fix typo

* Revert it

I didn't realize it was intended

* Removed unneded changes

* removed some unexpected changes

Co-authored-by: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com>
2023-01-05 17:54:22 +02:00
Variable d7e33f4431
Api Improvements (#802)
* Api Improvements

Proper Removal of Tools
A new `get_current_cel_info()` method

* a new show_error() method

usefull for displaying messages like "Incompatible API" etc...

* typo

* formatting

* added an improvement
2023-01-04 06:21:15 -08:00
Emmanouil Papadeas ee8d321902 Make cel_changed a Global signal instead
Otherwise we would have to connect the signal for every opened project. If a feature/extension requires it, we could add a reference to the project as a parameter for the cel_changed signal, but since that can get retrieved with Global.current_project, it's probably not needed.
2023-01-03 00:52:23 +02:00
Emmanouil Papadeas 824860a2b5 Add a change_cel() method to Project, instead of using a signal
Using a signal to change the cel was not a good idea, because it was not being emitted with the undo/redo system. The signal should also fire *after* the cel changes, and this is what happens in this commit. Should be useful for future features and extensions to check whether a cel has been changed.
2023-01-02 22:09:47 +02:00
Emmanouil Papadeas 40ab13da35 Add a cel_changed signal in Project to replace _frame_changed and _layer_changed
A small refactor. A very minor performance boost when selecting cels, but also a minor performance decrease when selecting frame buttons. Selecting layer buttons should be pretty much the same. I think the code should be a bit more readable now, plus we got rid of that yield() in Project.gd so that's a bonus.
2023-01-02 18:59:23 +02:00
Emmanouil Papadeas 36355eabdf Change the current frame label's default text 2023-01-02 16:41:49 +02:00
Emmanouil Papadeas 47ef98ec76 Add a get_current_cel() method in Project 2023-01-02 15:30:45 +02:00
Emmanouil Papadeas 3c4b9ad5b4 Use signals for zoom_changed and rotation_changed in CameraMovement 2023-01-02 14:40:48 +02:00
Variable 5113963f64
Allow floating point for Horizontal and Vertical Rulers (#800)
* Allow floating point for HRuler

* Allow floating point for VRuler

* Formatting

* Format again

Co-authored-by: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com>
2023-01-01 20:04:15 +02:00
Variable cbeef73fac
Selection modes (#798)
* Fix a typo

this is required because this is "Paint" Selection
(so it's not supposed to cancel selection if we click outside the canvas)

* Added Selction Modes

Default, Add, Subtract, Intersect

* removed whitespace

* better options

* Removed Separators from headers

* formatting

* more formatting that i didnt notice

* Solved Shortcut conflict

* remove whitespace
2022-12-31 20:13:27 +02:00
Emmanouil Papadeas 222e7a1ea8
Implement cleanEdge rotation and scaling (#794)
* Implement clear4x rotation

* Don't use pixelated uvs on the final result, only on the preview, and fix pivot positioning

* Update to cleanEdge algorithm

* Add cleanEdge scaling
2022-12-25 01:11:34 +02:00
20kdc 4658b1cfb6
APNG Loading (#797)
* APNG loader: Import addon to take over APNG handling

* APNG loader: Transition code to using the AImgIO addon

* APNG loader: Can now open APNGs.

* AImgIO: Update to fix bugs

* APNG loader: HTML5

* APNG loader: gdformat/gdlint addon

* APNG loader: OpenSave formatting fix

* APNG Loader: Add ignore line to OpenSave because it's too big

* Fix GIFAnimationExporter bug caused by the switch to the addon
2022-12-23 20:08:46 +02:00
Emmanouil Papadeas 7e15fc9d15 Remove duplicate project-specific variables from Export
Removed `directory_path`, `file_name`, `file_format` and `was_exported` from Export.gd. These variables already exist on Project.gd, no need to have them twice.
2022-12-18 03:33:53 +02:00
Emmanouil Papadeas c50239ff18 Disable the recent files option of the File menu on the Web version 2022-12-18 02:21:30 +02:00
Emmanouil Papadeas 9377ce00b0 Use ValueSliders for ShaderEffect and add a transparency background 2022-12-17 02:37:18 +02:00
Emmanouil Papadeas ab35d324fd Silence editor errors coming from ValueSlider
The errors came as a result of 9828c483.
2022-12-17 00:45:54 +02:00
Emmanouil Papadeas 9828c4838e Change ValueSlider's text color
And use the previous color only when they're disabled.
2022-12-16 21:34:58 +02:00
Emmanouil Papadeas bf7844b149 Make the notifications always appear on the bottom left of the main canvas 2022-12-16 19:44:40 +02:00
Variable 1df003b2df
Paint selection brush (#792)
* Added the PaintSelect tool

The shortcut keys are not configured

* Some Optimization attempts

* remove typo

* Re-Designed Tool Icon
2022-12-14 18:34:13 +02:00
Emmanouil Papadeas 6148791069 Update AboutDialog.gd 2022-12-09 18:33:36 +02:00
Variable 4f7486defb
Reference UI improvements (#789)
* Added the filter parameter

* Improved the reference image panel UI

* Disable Os open path for HTML

* fix typo

* Aviod crash on image not found
2022-12-08 02:20:54 +02:00
Variable 2bf290faa4
Decorative changes to reference and tool headers (#788)
* Added a header to reference pannel

Also fixed it's anchor

* Added decorative lines to the tools header

* Fixed the Label path
2022-12-07 18:22:09 +02:00
Variable 1499e7f704
Added a preview to layouts (#787)
* Added a preview to layouts

* removed some empty lines
2022-12-07 15:43:49 +02:00
Emmanouil Papadeas f46c376056 Make reference images work on the Web version*
* Pxos saved with the Web version will have reference images, since their paths will not be stored.
2022-12-07 15:38:44 +02:00
Emmanouil Papadeas 5e90b740e7 Only popup a single files dialog for multiple files - implements #585
This replaces the previous behavior, which used to popup multiple dialogs for each existing file, making the users click "OK" for each exported image.
2022-12-02 02:11:23 +02:00
Emmanouil Papadeas 4989e3e33a Fix Global not being able to find the Reference Images panel 2022-12-02 01:15:49 +02:00
Emmanouil Papadeas a6a1b4da99 Move making GLES2 the default driver in override.cfg outside of Global_init()
This way, override.cfg will not get automatically created when the app opens, unless the user explicitly changes the renderer, or the tablet driver.
2022-12-01 20:17:03 +02:00
Emmanouil Papadeas 251b240857 Update translations and add hint tooltips to the driver preferences 2022-12-01 02:00:45 +02:00
Arron Washington c4059beddf
Tool shortcuts should ignore macOS Command modifier. (#784)
* Tool shortcuts should ignore macOS Command modifier.

This prevents common shortcuts like CMD+S (Save), CMD+C (Copy), etc, from activating a tool.

* Fix formatting

Co-authored-by: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com>
2022-11-30 17:06:03 +02:00
Manolis Papadeas fc5497861a Fix tablet driver not reflecting the currently chosen driver
If winink was chosen, the preferences still showed wintab.
2022-11-30 02:09:06 +02:00
Emmanouil Papadeas e115aa284b Place the Reference Images panel next to the canvas preview
And rename "References" to "Reference Images"
2022-11-30 01:00:41 +02:00
Emmanouil Papadeas 60e58952a5 Use Control + Wheel to change shape thickness 2022-11-30 00:29:44 +02:00
Emmanouil Papadeas 0db574c769 Expose tablet driver to the preferences [Windows only] 2022-11-29 21:10:49 +02:00
Emmanouil Papadeas 78f9cb57bb Set GLES2 as the default video driver in override.cfg
Should fix the renderer not being able to get set to GLES3
2022-11-29 20:48:36 +02:00
Emmanouil Papadeas 8f14f7482e Remove unneeded duplicate methods in PreferencesDialog.gd 2022-11-29 20:17:39 +02:00
Emmanouil Papadeas 3ef73eacea Expose GLES driver to the preferences
Users can now change from GLES2 to GLES3 and vice versa. The change requires a restart of Pixelorama to take effect. Does not have any effect if Pixelorama is being run from the Godot editor. I suppose we should add logic that detects if GLES3 is even supported in the first place in that device before allowing it as an option, but at least I enabled GLES2 fallback in the project settings, so it *should* fall back to GLES2.
2022-11-29 19:58:24 +02:00
Emmanouil Papadeas 4d113d37e5
Export dialog UX overhaul (#781)
* Remove animation tab from the export dialog, unify it with the first tab

* Tidy up the UI using GridContainers

* Make ExportDialog a ConfirmationDialog and clean some code

* Make project a parameter in export methods

This will be useful in the future for exporting multiple projects at once via terminal arguments

* Add a layers option in the export dialog

Currently only visible layers and selected layers, need to add specific layer selection and handle group blending properly.

* Align everything to the left

* Change "directory" into "folder"

* Make animation direction affect spritesheets and multiple png exporting

Besides just gifs and apngs

* Minor code re-organization

* Keep spritesheet options when changing tab

* Use the Unicode multiplication sign in the dimension label

* Specific layer exporting with group blending support

* Change file format cursor mode to pointing hand instead of forbidden

* Add a new custom CollapsibleContainer node and use it for advanced settings in the export dialog

* Change Popups node into Control so its children will automatically inherit the theme

* Add the TextureRect of the CollapsibleContainer in the UIButtons group

* Update ExportDialog.gd

* Disable "Create new folder for each frame tag" when gif/apng is selected, and hide it completely on the spritesheet tab

* Fix "Create new folder for each frame tag" being visible even if the CollapsibleContainer's button is not pressed

* Show layer path for each layer in the export dialog's "Layers" option

* Update translations

* Update strings
2022-11-28 21:22:29 +02:00
Emmanouil Papadeas 0837f68e8b Update contributors in AboutDialog.gd 2022-11-20 19:17:27 +02:00
Emmanouil Papadeas 8732d366bf Use Control + Wheel to change brush size - implements #776
This is not editable in the shortcut settings and it is temporary way of doing this and it will change in Godot 4.x.
2022-11-10 17:36:09 +02:00
20kdc 20bce8175c
Reference Images (#771)
* Reference Images: Part 1

* Reference Images: Proper import workflow

* Reference Images: gdformat/gdlint checks

* Reference Images: Remove random src/Main.tscn changes

* Reference Images: Switch to ValueSliders, autowraps, fix opacity going out of range
2022-11-08 20:04:41 +02:00
20kdc 82acf3f8b1
APNG Exporter (#772)
* APNG: Initial refactorings of animation exporter internals

* APNG: Make ExportDialog actually able to handle multiple file formats

* APNG: Bugfix to FPS hint and such

* APNG: Refactoring: Fix file format propagation

* APNG: Make an "APNG exporter" which creates an empty PNG container

This was the testbed of the previous integration commits.

* APNG: The actual exporter!

* APNG: Remove random src/Main.tscn changes

* APNG: Format/lint

* APNG: Format & Lint, part II
2022-10-31 00:24:24 +02:00
Emmanouil Papadeas ac3d2baf87 Image effect dialog UI changes
All of the elements now expand vertically, and the Cancel and OK buttons are now bigger, thus easier to click.
2022-10-25 02:16:36 +03:00
Emmanouil Papadeas 7768bc92dd Change OpenSave.handle_loading_file to handle a single path
OpenSave.handle_loading_files() has been renamed to OpenSave.handle_loading_file and it now takes a single string as a parameter, instead of a PoolStringArray. This was needed for Main.gd's new _handle_cmdline_arguments() method. This method does not add any new functionality for now, but it will in the future.
2022-10-23 02:22:26 +03:00
mrtripie 5478d320dc
Fixes (#770)
Co-authored-by: MrTriPie <MrTriPie>
2022-10-22 01:32:26 +03:00
mrtripie e8281bf056
Animation Timeline UI Improvements (#769)
* Fixed link cel indicator color and animation tags position

* New scrolling and min size

* fixed dockable container for the timeline min size

* Cleanup

* Tweaked minimum size

* Removed some hacks that are no longer needed

* Fixed frame scrollbar not being in the right place at startup, added ensure_control_visible

* frame scroll horziontally without shift if can't scroll vertically + min size tweaks

* Renamed the frames/layer/cel containers

* Always scroll by whole frames

* Fixed conflict

* reoranized AnimationTimeline scene's node tree to wrok as expected

* tweaks

* Fixed tag position and removed uneeded layer button theme code

* added the icon theme code back, I thought this was for the timeline XD

* Smaller LayerButtons

* Save Layer and Cel size between sessions

* Combined _on_AddLayer_pressed and _on_AddGroup_pressed into 1 add_layer method

* Rename scroll container

* formatting

Co-authored-by: MrTriPie <MrTriPie>
2022-10-21 16:04:26 +03:00
Variable 88b102d9c6
Change layer adding behavior (#767)
* Add layers on top of current layer

* Adding on group makes it the group's child
2022-10-19 18:31:57 +03:00
mrtripie eb153d11a1
Keep colors on cel link sets (#766)
* Implemented except for clone layer bug

* more asserts

* Fixed the layer cloning bug

* gdformat

* Fixed new cels linked crash

* Fixed old .pxo files

* Removed default red color from LinkedIndicator in PixelCelButton scene

Co-authored-by: MrTriPie <MrTriPie>
2022-10-18 03:02:18 +03:00
Emmanouil Papadeas 82d63bd2e8 Fix crash when importing pxos older than v0.7 2022-10-17 03:18:05 +03:00
mrtripie 0faacafb16
Fix id_map error on open_pxo_file as well as grid being wrong size (#765)
Co-authored-by: MrTriPie <MrTriPie>
2022-10-17 02:21:28 +03:00
mrtripie 637662dee4
Linked Cel Refactor and Timeline Refactor Tweaks (#764)
* Updated PixelLayerButton's LinkButton's hint_tooltip to be more accurate

* Don't automatically link the current frame's cel when enabling new_cels_linked on a layer

* Mostly added new system

* renamed link group to link set

* Enable drag and drop of linked cels on the same layer

* formatted CelButton.gd

* serialize/deserialize

* Copy frames w/ new linked cels system. Removed copy_cel from layer classes

* Removed commented out code from AnimationTimeline.copy_frames

* Removed Project.duplicate_layers

* Removed unlink_cel in favour of using null with link cel (as the first part of that method was the same)

* Disabled show_behind_parent on PixelCelButton's LinkedIndicator, as it wasn't enough to improve visibility of selection

* Moved BaseLayer.copy out of the Methods to Override section

* Added optional texture param to Cel's set_content method (needed for use when deserializing, and otherwise helpful

* set textures with set_content where needed

* open_image_as_spritesheet_layer new_cels_linked part updated

* clone layer with linked cels implemented. Removed copy_all_cels from layer classes

* weaked how copied layers names are updated

* Merge layers works with new linked cels now

* Fixed texture on cel buttons not being updated on button setup

* fixed bug where using set_content with new image texture would result in an empty texture

* Open old .pxo with new linked cels

* simplified backwards compatiblity

* removed linked_cels

* better linked cels backwards compatibility

* Removed some old TODO comments

* fixed linked_cels conversion bug when linked_cels is empty

* Added undo for linking the previous cel when creating new cels with new_cels_linked enabled

* Removed TODOs

* Cleaned up some method variable naming

* Cleaned up deserialization

* combined matching for loops

* Inlined BaseLayer.copy() where its used

* gdformat

* Fixed Translations,pot

Co-authored-by: MrTriPie <MrTriPie>
2022-10-16 17:44:01 +03:00
Emmanouil Papadeas 9230f35d89 Add ValueSliders to Rotate and HSV dialogs 2022-10-15 14:10:08 +03:00
Emmanouil Papadeas 0c954e65d8 Add ValueSliders to Bucket and SelectionTool tool options
Replace Bucket's pattern offsets and SelectionTool's position and size SpinBoxes with ValueSliders.
2022-10-15 02:03:15 +03:00
Emmanouil Papadeas ed76cc05e9 Echo support for the ValueSlider arrows
If you press and hold an arrow button, the value will keep changing until you release. Replicates SpinBox's behavior. We should be able to replace any SpinBox now without losing any functionality.
2022-10-14 17:22:05 +03:00
Emmanouil Papadeas c3d07312aa Add arrow buttons to the value slider
Their visibility is toggleable. They also currently do not support echo events, since for some reason Godot only supports them for InputEventKey(s). I suppose this feature could be replicated with a Timer. Once this is done, we can replace all SpinBox nodes.
2022-10-14 02:51:55 +03:00
Emmanouil Papadeas 32fdea638b Simplify OutlineInline shader a bit 2022-10-10 19:58:40 +03:00
Emmanouil Papadeas fbe6ea9a97 Prevent data loss if the app crashes during save - Fix #763
When saving a pxo and a file of the same name already exists, the new file gets a temporary name (.pxo1 extension), and it gets renamed to its proper name if it's saved successfully (Pixelorama doesn't crash)
2022-10-07 02:16:15 +03:00
Emmanouil Papadeas 9f443f3ab0 Replace HSliders+SpinBoxes with ValueSliders in the tool options
Still WIP, the tool options may change even more later.
2022-10-05 00:42:01 +03:00
Martin Novák 5842ce00c6
Add reactivity to palette grid, improve scrolling and add swatch "zoom" (#761)
* Save changed color to palette file only when color dialog is closed

* Restructure palette panel to use unique names

* Make grid size reactive to palette panel size

* Add mouse wheel scroll support to palette grid

* Add palette swatch resizing

* Reorganize palette grid rendering

* Store swatch size in cache config

* Cleanup formatting
2022-10-04 13:47:31 +03:00
Emmanouil Papadeas b299ab235c Change shrink slider to ValueSlider in the Preferences 2022-10-03 19:28:47 +03:00
Emmanouil Papadeas 8abbe0a1cb Use a ValueSlider in the window opacity dialog
More ValueSlider replacements coming next.
2022-10-03 14:43:08 +03:00
Emmanouil Papadeas 4c85f5b0ff [skip ci] Update splash screen artwork licenses 2022-10-02 00:51:06 +03:00
Emmanouil Papadeas f6de836fc7 Add setters for ValueSlider's prefix and suffix
This way we ensure the display is reset if the prefix or suffix changes.
2022-10-01 02:03:30 +03:00
Emmanouil Papadeas 9adf74392a Use notifications for theme and translation changes to update ValueSlider 2022-10-01 01:51:01 +03:00
Emmanouil Papadeas 52b3eae418 Allow for mouse wheel scrolling in ValueSlider 2022-10-01 00:14:54 +03:00
Emmanouil Papadeas 5664271b27 Allow disabling ValueSlider
Maybe we should make theme changes as well when it's disabled, but it's fine for now.
2022-09-30 12:08:44 +03:00
Emmanouil Papadeas 59bc9f022d Replace opacity sliders with the new ValueSlider 2022-09-30 01:03:38 +03:00
Emmanouil Papadeas 963f9d05a0 Make ValueSlider a tool so it can be previewed on editor 2022-09-30 00:54:44 +03:00
Emmanouil Papadeas 8148d03c1f Add a custom ValueSlider node made by @mrtripie
And bump version to v0.11-dev
2022-09-30 00:07:56 +03:00
Emmanouil Papadeas af2b1feb1f Prevent undoing/redoing while drawing
Prevents errors (and potentially unwanted behavior) if attempting to undo while in the middle of drawing with the Pencil, Eraser of Shading tools. Needs more testing in case I broke something else.
2022-09-29 01:50:12 +03:00
Emmanouil Papadeas cc332c6cbf Only activate the right tool if action is pressed
Previously it was possible to hold the right mouse button while the left was being held, then release the left and once the right button is released, the right tool would get activated. This commit ensures that the right tool gets activated only on first press of the right mouse button, if the left isn't already activated.
2022-09-29 01:35:12 +03:00
mrtripie 1fa34d7196
Basic Layer Groups and Timeline Refactor (#698)
* Fixed issues with Shading tool Saturation and Value not always being right in Hue Shading mode

* Shading tool hue shifting fixes and tweaks

* Bringing over changes from layer groups brach, without any changes to layer blending

* Some quick fixes to make it work again

* Fixed some of the places where GroupLayers cause errors. Cel Buttons are now hidden when groups are collapsed

* Layer drag highlighting (need to actually drop them correctly, also need to do cels)

* Added more layer hierarchy related functions, organized the function order in the Layer classes a bit

* Switched the layer type changing from string to int

* Moved layer type enum to Global

* Added get_layer_type_name(), currently used for the default layer name

* Renamed the layer get_children/is_a_parent_of functions

* changed get_layer_type_name() to get_default_name(number)

* New layer drag and dropping behavior

* Added read/write_image_data_from/to_pxo functions to Cel classes to handle saving/loading the binary image data for each cel type

* Fixed warning

* Added a line to child layers wich makes it easier to see where they are in the hierarchy

* Fixed debugger warning

* Fixed all cel types loading as PixelCels

* Fixed spacing issue with cels when collapsing groups

* Fixed bug when dropping a child layer to the bottom region of its parent group, where it would end up to far down (maybe disappearing)

* updated temporary todo comments

* Created a base scene for layer buttons and merged layer button script into one

* Prevent the case of parenting to itself in layer drag and drop, fixed static reference to LayerButton still being BaseLayerButton

* Use a base scene for CelButtons

* First bit of the refactoring work

* Several bits of refactoring

* Fixed moving cels

* Cleaned up Project.move_cel function

* Fixed project_layer_removed

* Updated change_frame_order on FrameButton. Some (not all) work on getting the layer UI updated when pressing buttons such as collapse/visible/lock

* Bug fixes. Updating layer button's buttons

* Fixed timeline selection issues when creating a new project. Some code cleanup

* tweaks

* Removed a bunch of commented out code

* Removing more commented out code

* Fixed bugs with timeline selectio. Fixed cels being placed in the reverse layer order when adding a frame

* Changed add/remove_frame to add/remove_frames (multiple support)

* Refactored copy_frames in animation timeline

* added copy function to cel classes

* added layer copy function

* simplifed copy_frames a tiny bit

* Updated TODO comments to categorize them and remove any that were already done

* Turned Project.add/remove_layer into Project.add/remove_layers (multiple support), not yet tested

* Seperated the layer cloning functionality in timeline's add_layer to its own function, since they're only used by one button, renamed to _on_Button_pressed naming scheme, added children support to the delete layer button

* some TODOs

* Added layer swapping

* Added priorities to refactor TODOs

* Simplified layer swapping code a little

* Fixed performance regression on changing project, updated TODOs

* Included _on_MergeDownLayer_pressed in timeline refactor

* Cleaned up _on_MergeDownLayer_pressed refactor

* If all frames are selected, prevent being able to remove all of them

* Fixed cel linking when cloning layers/frames. Moved the copy function from cel classes to layer classes, splitting into copy_cel and copy_all_cels

* Combined and rewrote the 2 project _toggle_layer_buttons_.. functions into 1 simpler _toggle_layer_buttons function

* Simplified _toggle_layer_buttons some more

* Added hierarchy support for move up/down layer buttons

* Added toggle_frame_buttons method to project (extracted from  _frame_changed). Called from main when setting up startup project. Removed _ from start of _toggle_layer_buttons name

* Fixed duplicate_layers parent references being to the original layers

* cleaned up project.move_layers method a bit

* TODOs

* moved the transform_content_confirm calls for the layer buttons in AnimationTimeline (Add/remove/clone) to the project layer modification functions

* animation first/last_frame tweaks and un-press play buttons when the first/last_frame are the same in _on_AnimationTimer_timeout in AnimationTimeline

* Cleaned up project_changed in ANimationTimeline a bit

* Cleaned up project_layer_added in AnimationTimeline

* Changed Layer classes get_default_name to set_name_to_default

* Cleaned up LayerButton.drop_data slightly

* Looked at some of my TODOs

* cleaned up copying cels

* Fixed CelButton linked_indicator not showing up right away when becoming linked

* Cleand up link/unlink cel menu option a little. Fixed situatoin where trying to call button_setup on cel_button that doesn't exist anymore due to undo/redo

* Fixed regression with copy_cel (linked) in when cloning a frame

* Minor cleanup, more detailed comments, updated TODOs

* more improved comments

* Made focus_mode on Cel/Layer/FrameButton NONE to fix bug where it looks like one is selected after pressing it and adding a new Layer/Frame (but its just in the focus state, not the pressed state

* Made AnimationTimeline.change_layer_order work a little more consistantly with LayerButton.drop_data, and fixed a minor bug in it

* Updated comments and TODOs

* cleanup

* removed some code that should no longer be needed

* updated comment

* removed Project's frames and layers setters _frames_changed and _layers_changed

* Made some 'for x in range(array.size())' just 'for x in array.size()'

* updated comments/TODOs

* Cel content changes intial

* Added 'content' methods to Cel classes

* Removed image var from PixelCelButton

* Reusing PixelCelButton.gd on GroupCelButton scene

* Renamed PixelCelButton.gd to CelButton.gd (as it will be used for all Cel Buttons) and deleted GroupCelButton.gd

* Hide the TransparentChecker on GroupCelButton.tscn until a preview texture is added for GroupCels

* TODOs, prevent memory leak when closing projects

* Link/unlink cel cleanup
:

* Added _project param to _init methods of Layer classes

* Added update_texture method to Cel classes (moving part from the update_texture and update_selected_cels_textures methods from Canvas.gd

* Removed a temporary check (which also fixed another bug)

* Clone child layers when cloning a layer

* Added temp dummy get_image method to GroupCel, and use get_image when copying or picking colors

* TODOs

* Made open_image_as_spritesheet_layer work after the timeline refactor (still doesn't work with groups yet though). TODO comment updates

* Added create_new_cel methods to Layer classes

* Updated TODOs and comments

* Renamed Layer class's create_empty_cel to new_empty_cel to match Project's new_emtpy_frame

* Renamed create_layer/cel_button to instantiate_layer/cel_button

* updated TODOs

* prioritized TODOs

* Fixed some warnings

* removed commented out code from previous commit

* Fixed export

* Made open_image_as_new_frame work after timeline refactor

* Fixed open_image_as_new_layer after timeline refactor

* Some linked cel fixes

* More linked cels fixes

* cleanup

* Optimized importing spreadsheet as new layer

* Fixed Scale Image crash with Groups

* Fixed onion skin with groups

* Removed blend_mode from BaseLayer for now

* Mostly fixed image effects

* Fixed resize canvas

* Fixed drag and drop not working with Cel Buttons on Group Layers

* updated TODOs

* Renamed Replace Frame (in open image) to Replace Cel

* Continued renaming Replace Frame to Replace Cel

* Made open_image_at_cels work after timeline refactor

* Added get_layer_path method to BaseLayer

* Replaced AtLayerSpinbox with AtLayerOption for Open Image as New Frame or Replace Cel

* Updated TODOs

* updated TODOs

* Comments for cel content methods

* fixed right clicking group cel button deselecting the button (even though cel is still selected

* frame/layer modification methods comments

* Removed unneeded size flags

* TODO updates

* Removed a loop that would never run from open_image_as_spritesheet_tab

* TODO update

* Combined BaseLayer.get_children_direct and get_children_recursive into a single get_children method with a bool for recursive. Added a get_child_count method

* Removed unneeded frame paramaters from _on_DeleteFrame_pressed and _on_CopyFrame_pressed

* TODO Updates

* Removed unneeded code from delete_frames

* Made delete_frames variable names more consistent with my other changes

* Continuation

* made variable names in copy_frames more consistent with rest of changes

* Update TODOs

* Removed TODOs for after this PR (moved to my notes)

* Fixed crash when pasting image on Group

* Fixed layer .visible check to be is_visible_in_hierarchy()

* Removed some drag highlight polish code that didn't work

* Removed code from Canvas update_texture and update_selected_cels_textures that was redundant

* gdformat

* gdformat

* gdlint fixes

* Fixed Cel button not having its linked indicator show when enabling new cels linked on a layer other than the current layer

* Fixed crop image and centralize image

* Added '# gdlint: ignore=max-public-methods' to the top of Project'

* Fixed dragging cels to layer of different type crash

* Formatted CelButton.gd

Co-authored-by: MrTriPie <MrTriPie>
2022-09-28 21:59:49 +03:00
Emmanouil Papadeas 5914471149 Release v0.10.3-stable 2022-09-26 17:40:15 +03:00
Emmanouil Papadeas a04077569a [skip ci] Add licenses to some of the splash screen artworks 2022-09-26 17:05:13 +03:00
Emmanouil Papadeas 2b3da1f591 On delete, only create a blank image if there's a selection
If there is no selection, the entire image becomes transparent, so there is no need for a blank image to use with blit_rect_mask()
2022-09-25 19:02:13 +03:00
Emmanouil Papadeas 92e0e7e11c Clear some code in HandleLanguages.gd
Got rid of the second for loop, so maybe this is a minor speedup as well.
2022-09-22 23:22:40 +03:00
Emmanouil Papadeas 64746d9f31 Create a _popup_dialog() method in TopMenuContainer.gd to reduce lines of code 2022-09-22 18:02:01 +03:00
Emmanouil Papadeas b095fae462 Don't let menu shortcuts work if there's a dialog open
Continuation of the fix for #709
2022-09-22 17:46:22 +03:00
Emmanouil Papadeas 3104e481f0 Fix #709 and allow for non-keyboard shortcut bindings for tools 2022-09-22 17:32:07 +03:00
Emmanouil Papadeas c2e90f77b0 Fix PreferencesDialog becoming smaller if the display scale changes 2022-09-22 17:04:20 +03:00
Emmanouil Papadeas 37eee319b5 Fix "Close" button in the Preferences not being translated from a non-English language
Before this commit, if Pixelorama started in a language other than English and then the user switched languages, the Close button's string would remain translated in the previous language
2022-09-22 16:40:53 +03:00
Emmanouil Papadeas 5a9a3ba495 Update AboutDialog.gd 2022-09-21 03:28:46 +03:00
Variable 56a113d36d
fix recent projects (#755) 2022-09-20 21:14:42 +03:00
Emmanouil Papadeas 950a6d77af Move pencil's brush slider above "Overwrite color" again 2022-09-20 20:46:53 +03:00
Variable 03813b41c5
Remember last choice in import options (#754)
* Remember last choice in import options

Implements 2nd point of  "Minor UX improvements #735"

* formatting
2022-09-20 20:28:35 +03:00
Emmanouil Papadeas 028a4c9f8a Remove minimum size from PreferencesDialog 2022-09-20 20:01:32 +03:00
Emmanouil Papadeas 8b78877f0c Make themes have consistent alignment and add header for the shortcuts in Preferences 2022-09-20 19:39:15 +03:00
Emmanouil Papadeas 1f55ac92fd Add tool button color & tool name header on each of the tool options 2022-09-20 00:58:39 +03:00
Emmanouil Papadeas 4fc44a71c6 Polish the preferences dialog and add a "Header" theme type variation for Labels 2022-09-20 00:16:01 +03:00
Emmanouil Papadeas af7f1f83b1 Disable "New Brush" instead of "Delete" in the Edit menu
Issue caused when "Paste in Place" was added.
2022-09-18 21:58:37 +03:00
Emmanouil Papadeas 63bc2332db Make bucket fill "Whole Selection" option work with patterns
Also fix issue with similar area and color fill where if the selected color is the same as the pixel's color in mouse position, the operation stops even if there are other cels selected.
2022-09-18 19:22:06 +03:00
Emmanouil Papadeas cac9b67335 Revert back to an OptionButton in the Bucket tool options and add "Whole Selection" option in the fill area
Still WIP, "Whole selection" isn't working with patterns yet.
2022-09-18 18:43:50 +03:00
Emmanouil Papadeas eda848ff63 Change "continuously" to "contiguously" 2022-09-18 17:23:42 +03:00
Emmanouil Papadeas 94789a57c8 Replace the fill area OptionButton with a Checkbox in the bucket tool options 2022-09-18 16:36:03 +03:00
Emmanouil Papadeas 698c7c4a08 Fix invalid image error when using the bucket tool to replace colors 2022-09-18 15:56:36 +03:00
Emmanouil Papadeas d69d98dc3b Auto-scale the UI based on dpi and resolution - Closes #643
Code is taken from Godot's editor, so I assume it should work well.
2022-09-18 01:17:35 +03:00
Emmanouil Papadeas c8efa7c09a Allow for down to 0.5 UI scale
Might be useful for small loDPI displays.
2022-09-17 03:03:17 +03:00
Emmanouil Papadeas 56748da971 Update GradientEdit hint tooltip string 2022-09-17 00:25:43 +03:00
Emmanouil Papadeas c2f2473d77 Add a "Divide into equal parts" button in GradientEdit
This is meant for easy gradient bisecting, which is helpful for converting Linear/Cubic interpolated gradients into Constant.
2022-09-17 00:19:08 +03:00
Emmanouil Papadeas a64f102b9a Change paste placement behavior
Paste now places the pasted content in the middle of the canvas view, instead of its original position. A new option in the Edit menu has been added, "Paste in Place", that preserves the previous behavior. This is similar to how GIMP works.
2022-09-15 00:08:22 +03:00
Emmanouil Papadeas 7558c2c891 Add an ExtensionsAPI version
This lets us keep track of changes in the Extensions API easier.
2022-09-14 01:16:39 +03:00
Emmanouil Papadeas 2e795e8db5 Fix onion skinning not working with mirror view
Addresses the 3rd issue in #717.
2022-09-13 00:49:22 +03:00
Variable 4b4b0773ff
Highlight color in palette if it's selected in color slots (#730)
* select pallete color (if present)

* find and select color

* [skip ci] Update CHANGELOG.md

Co-authored-by: Emmanouil Papadeas <manoschool@yahoo.gr>
Co-authored-by: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com>
2022-09-12 02:03:14 +03:00
Emmanouil Papadeas 66857f5e62 Make background around canvas configurable - implements #586 2022-09-10 02:58:13 +03:00
Emmanouil Papadeas d34e69579f Make circle brushes scale properly, with support for even-numebered diameters
Also reverts commit 488cf0cc93
2022-09-09 00:10:34 +03:00
Emmanouil Papadeas dee49b61bf Move get_ellipse_points() to DrawingAlgos
The same ellipse algorithm will be used for the circular brushes, as I can't seem to make the current circle algorithm work with even-numbered diameters.
2022-09-08 17:35:00 +03:00
Emmanouil Papadeas cd0c7ccdb0 Remove duplicate circle code from Draw.gd 2022-09-08 14:02:33 +03:00
Emmanouil Papadeas e7678ef5cc Move _fill_bitmap_with_points() to BaseTool.gd 2022-09-08 13:42:03 +03:00
Emmanouil Papadeas ffd6c8c88d Remove unused methods in Draw.gd 2022-09-08 13:32:03 +03:00
Emmanouil Papadeas edbbec1d55 Copy, cut & delete now affect the entire cel if there is no selection
Also fixed issue with delete deleting content from locked/invisible layers.
2022-09-08 01:10:23 +03:00
Emmanouil Papadeas c22633901d [skip ci] Fix typo 2022-09-05 18:17:20 +03:00
Manolis Papadeas d564139f98 Some more static typing
Apologies for the pointless-ish commits but I'm on vacation and time is limited :(
2022-09-03 00:58:29 +03:00
Manolis Papadeas 3bfbf07d58 Don't move selection if there's a dialog open 2022-09-01 00:21:18 +03:00
Manolis Papadeas eef722946c Change into forbidden cursor in the canvas if the layer is unavailable
Unavailable means either locked or invisible, or both.
2022-08-31 00:36:41 +03:00
Manolis Papadeas 488cf0cc93 Pixel perfect only affects the square brush 2022-08-30 20:11:01 +03:00
Manolis Papadeas 47ba050ad4 Some formatting changes 2022-08-29 22:15:43 +03:00
Manolis Papadeas 01f8273e4b Add some missing static typing 2022-08-29 21:11:43 +03:00
Emmanouil Papadeas 500fc5ac47 Change SplashDialog from WindowDialog to AcceptDialog
This eliminates the need of the dialog having a rect_min_size, which lets users resize it to make it even smaller. The OK button is being hidden at the start, so visually it should look almost the same.
2022-08-26 03:25:22 +03:00
Emmanouil Papadeas 7bfcabc466 Close project tabs with middle mouse click 2022-08-25 01:47:05 +03:00
Emmanouil Papadeas b9f0f0a647 Move left and right cursor sprite nodes to Main.gd 2022-08-24 14:22:40 +03:00
Emmanouil Papadeas 615491052a Minor code cleanup to reduce lines of code 2022-08-21 00:18:33 +03:00
Emmanouil Papadeas 27a23f5e37 Update contributors, translators and changelog URL 2022-08-18 02:04:08 +03:00
Emmanouil Papadeas e495f1f260 Add Danish language 2022-08-14 16:06:46 +03:00
Emmanouil Papadeas 92fcf8faca Update translations, rename "New tab" to "New project"
Addresses the first half of #735.
2022-08-11 01:44:45 +03:00
Emmanouil Papadeas 469f9bf4d3 Use theme type variations for RulerButtons and TopMenuContainer 2022-08-09 04:18:11 +03:00
Emmanouil Papadeas 8a8e6929b9 Replace Tweens with SceneTreeTweens
Futureproofing for easier porting to Godot 4.0, and reducing lines of code in the process ;)
2022-08-09 03:57:14 +03:00
Emmanouil Papadeas c66cac2fd8 Add an interpolation OptionButton to GradientEdit 2022-08-09 02:02:46 +03:00
Emmanouil Papadeas 8b70b56a5e Fix current frame button not being pressed when changing project 2022-08-08 21:37:00 +03:00
Emmanouil Papadeas c7ee96591c Some theme changes made automatically by Godot 3.5 2022-08-08 21:33:38 +03:00
Emmanouil Papadeas a9e624e319 Greatly optimize selection content deletion
New speeds with this commit (approximately)
64x64: 0-1ms
1024x1024: 27ms
2048x2048: 73ms
4096x4096: 261ms

Old speeds before this commit (approximately)
64x64: 42ms
1024x1024: 5204ms
2048x2048: 20988ms
4096x4096: 83973ms
2022-08-08 19:07:17 +03:00
Variable 8a6e393d69
New theme-related methods to ExtensionsAPI (#733)
* hide accidentally visible dialog

* added new theme methods

* Wait for themes to add from api

* remove `find_theme`

* revert last commit

* Formatting

* Some code changes

* update to godot 3.5
2022-08-08 16:20:42 +03:00
Emmanouil Papadeas afe5a90722 Use a HFlowContainer for the Tools
This commit requires Godot 3.5 and Pixelorama will no longer run in older Godot versions
2022-08-08 04:17:34 +03:00
Variable ef0adf55b1
Make changing window transparency only affect the main canvas' transparency (#734)
* Only change opacity of TabContainer of MainCanvas

* fix typo
2022-08-08 03:21:08 +03:00
Emmanouil Papadeas 41ccc704c2
Refactor the selection system to use an Image instead of a BitMap (#710)
* Use Image instead of BitMap for selection

Not complete and Pixelorama is currently broken

* Add a SelectionMap class

* Make the changes in Selection.gd

* Remove selection_bitmap

* Replace duplicate() with copy_from()

* Fix selection

Intersection and transforming are not working

* Fix wrong pixel color values

* Fix selection transforming

* Call selection_bitmap_changed() on scale

* Fix clipboard

* Remove bitmap_to_image()

* Rename selection_image to selection_map

* No errors in Magic Wand

* Rename selection_bitmap_changed() to selection_map_changed()

* Format

* Fix selection resizing

* Remove a line from image effects

* Fast selection inverting using shader

* Update SelectionMap.gd

* Format

* Convert SelectionMap back to LA8 after inverting

* Minor refactor in RectSelect.gd

* Fix intersections

* Use shader for ColorSelect and add color similarity option

* Update RotateImage.gd
2022-08-08 03:03:17 +03:00
Emmanouil Papadeas 7165f352b0 Make GradientEdit's color picker popup not get in the way of the preview 2022-08-04 17:14:43 +03:00
Variable 57387f3530
Change tilemask loading (#731)
* Load tilemask from current frame...

...instead of selecting from FileDialog

* Delete the FileDialog

* Added the reset button

every good loader needs a reset button, Cheers!!!
2022-08-03 00:42:54 +03:00
Variable 8803acd105
Tile mode fixes (Heavy testing required) (#723)
* Hide/Show options based on current tile option

* Changed a condition for tile mode

* Simplified tile detection code

* Priortize main tile as nearest if mouse is in it

* make tile mode draw behind canvas

* Changed a condition

* Tiles on top gets detected first...

...in case of overlap

* Only display relavant options

according to current mode

* Update preview according to..

..current mode

* removed print()

* Added tile masking

* Added tile masking

* Compare mask with project size

only masks with same size as project are accepted

* Formatting

* Added the suggestions

* Some minor modifications

* detect if a mask is loaded or not

* Added tile_mask to project

* Cosmetics

* added path detection

* added option to emit signal instead of loading...

... image directly through OpenSave

* Added a way to load mask for HTML5

* formatting

* formatting

* Formatting

* set proper way for saving tile_mask

* Formatting

* removed whitespace
2022-08-02 18:57:06 +03:00
Emmanouil Papadeas b7e6a183a6 Add dockable container methods to ExtensionsAPI 2022-07-31 16:06:26 +03:00
Emmanouil Papadeas 273f7f2569 Update AboutDialog.gd 2022-07-30 22:11:29 +03:00
Emmanouil Papadeas c5e2e1ce4c Change badly named variable in ExtensionsAPI 2022-07-29 20:51:45 +03:00
Emmanouil Papadeas acebbdf031 Update ExtensionsAPI.gd 2022-07-29 20:41:39 +03:00
Emmanouil Papadeas c9e5c97214 Fix wrong order of undoredo properties in open_image_as_spritesheet_layer 2022-07-29 19:23:32 +03:00
Emmanouil Papadeas dcebf894bf Fix crash when importing a spritesheet as a new layer, undoing and then exporting
Thanks to @Variable-ind for the fix.
2022-07-29 17:41:38 +03:00
Variable 937e895aef
Fix (slightly) wrong color being drawn when selected from palette (#729)
* fixed the bug for simle and pixel perfect

* fix wrong color drawn for bucket tool

* fixed an accidental change
2022-07-29 15:31:06 +03:00
Variable 9d71c7e6bc
removed initial angle quick rotation buttons (#728) 2022-07-29 12:38:25 +03:00
Emmanouil Papadeas 1350720a8f Fix Rotxel with Smear producing wrong alpha values for pixels outside the selection 2022-07-28 12:18:49 +03:00
Emmanouil Papadeas 559da5414b Implement @azagaya's rotation with smear shader 2022-07-28 01:04:24 +03:00
Emmanouil Papadeas 68ad07572a Some more minor changes in rotate image dialog and script 2022-07-25 17:47:01 +03:00
Emmanouil Papadeas 42942d2c0a Fix pivot drag not working in the Web version 2022-07-25 14:58:17 +03:00
Emmanouil Papadeas dfc8499d06 Changes in the Rotate image dialog and script 2022-07-25 14:39:23 +03:00
Variable 7381311e71
Pivot remembering and algorithm re-arrangement (#724)
* Make pivot remember it's last position

* formatting

* Re-arranged algorithms

According to their speed

* Accidentally left popup visible
2022-07-25 03:01:23 +03:00
Variable cca36b52e4
Upgrade current_cel to selected_cel for Preview Display (#722)
* 1 of 3

* 2 of 3

* 3 of 3
2022-07-24 02:20:58 +03:00
Variable 43a8a04704
Expose pivot Option (#720)
* Added the pivot system

* Some re-arrangement

* a bug-fix

* fixed a conversion scale bug

The problem was the conversion from rect to pixel scale was not properly done, i changed it so that it sets conversion factor of shorter side according to the longer side

* Fix to allow manual pivoting

* remove an update()

i may have added it my self but i think its not needed now

* made shader pivot consistent with gd script

by doing `pivot + Vector2(0.5, 0.5)` for "Nearest neighbour (Shader)"

* Cosmetics

* Formatting

* more formatting

* an optimization
2022-07-23 23:31:39 +03:00
Emmanouil Papadeas 388c121520 Make the canvas preview play button respect frame tags 2022-07-21 22:26:01 +03:00
Variable d7065ad6ae
Handle extension improvements (#715)
* Added crash protection

* removed an empty line

* Formatting

* more Formatting
2022-07-20 15:22:43 +03:00
Emmanouil Papadeas 69f25d398e Update Main.gd 2022-07-18 22:12:17 +03:00
Emmanouil Papadeas 0b1ea0d680 Made Guide.gd a bit easier to read 2022-07-15 21:13:46 +03:00
Emmanouil Papadeas 95cf6afb47 Added a get_global() method in ExtensionsAPI
In case an extension needs to use properties that can only be found in Global, such as a setting in the Preferences.
2022-07-14 18:22:19 +03:00
Emmanouil Papadeas 28d178c8d6 Change ifs to elifs in PreferencesDialog.gd's preference_update method 2022-07-10 02:55:18 +03:00
Emmanouil Papadeas a3c9dc8976 Load and save metadata from pxo files
Useful for certain extensions that want to save data in pxo files
2022-07-09 01:08:27 +03:00
Emmanouil Papadeas 29d590f2c2 Let users change left and right tool colors 2022-07-08 03:25:17 +03:00
Emmanouil Papadeas a705f848c9 Change the background left & right colors of tool buttons in code 2022-07-08 02:54:31 +03:00
Emmanouil Papadeas cb4c54617a Make the right tool indicator enabled by default and orange, closes #691 2022-07-08 02:49:40 +03:00
Emmanouil Papadeas 7bcae8e743 Remove duplicated lines from TopMenuContainer.gd
And add another idle_frame yield to _save_project_file_as()
2022-07-08 02:22:06 +03:00
Emmanouil Papadeas 5d65e82070 Fix issue with save file dialog taking the name of the first file it sees
Instead of using the project's name. This could've caused issues if the user accidentally replaced the previous file.
2022-07-07 17:39:16 +03:00
Emmanouil Papadeas a368ea500a Add more methods to ExtensionsAPI 2022-07-07 01:37:04 +03:00
Emmanouil Papadeas b5d268e7e1 Reload extension if the user is trying to add it and it already exists
Restarting Pixelorama to reload an extension should no longer be required
2022-07-06 00:12:38 +03:00
Emmanouil Papadeas 694c6c7509 [skip ci] Fix typos 2022-07-05 00:31:57 +03:00
Emmanouil Papadeas f432defd1f Fix symmetry points being wrong on project initialization
The symmetry points were wrong if the "Show Guides" option in the View menu is toggled off, and mirroring was enabled.
2022-07-04 21:36:19 +03:00
Emmanouil Papadeas 23f591a862 Support even-numbered rectangle and ellipse sizes in the shape tools
Needs testing.
2022-07-04 20:44:23 +03:00
Emmanouil Papadeas 55935bcfd2 Fix wrong color picker shortcut in shape tools and remove unneeded method 2022-07-04 03:09:43 +03:00
Variable feb68a21a5
Fixed move offsets (#713)
* Fixed move offsets

* Formatting

* More formatting

* Some more Formatting
2022-07-04 02:41:26 +03:00
Emmanouil Papadeas 8a922a255c Fix move tool grid offset snapping, follow-up to #712
Also re-formatted SelectionTool's draw_move()
2022-07-03 00:04:01 +03:00
Emmanouil Papadeas dcb963d733 [Experimental] Add a basic ExtensionsAPI autoload
This is still experimental, it is not recommended to start actually using it yet.
2022-07-02 19:24:44 +03:00
Variable 9805af36b0
offset corrections (#712)
* offset corrections

* formatting
2022-07-02 16:26:53 +03:00
Variable b95d884dcc
Onion icon change (#711)
* aspect changes for changed icon

* New "expandable" icon
2022-07-01 14:48:10 +03:00
Emmanouil Papadeas 90d2473f52 Fix macOS crash 2022-06-29 23:41:53 +03:00
Emmanouil Papadeas 30f9a3875d Import multiple images at once from File > Open 2022-06-27 14:51:26 +03:00
Emmanouil Papadeas 31b56500c2 Make Pixelorama work on Godot 3.5-rc4
For some reason it crashes without this fix, while it did not crash in RC3.
2022-06-26 01:39:25 +03:00
Variable c3eaddd9ca
Implemented text clipboard system instead of the old one (#693)
* add limit change with brush

* Delete Draw.gd

* Delete BaseTool.gd

* added error calculation

* revert last commit

* Implemented OS.clipboard (using var2str())

* some sanity checks

* formatting

* use text system instead of os clibboard
2022-06-23 20:14:03 +03:00
Grant Moyer 8cfdcb5ebc
Add reset button to tile mode offsets dialog (#708)
I forgot to implement this requested feature in #707
2022-06-21 18:10:59 +03:00
Grant Moyer aadad462b9
Add options for custom tile mode offest (#707)
* Add preferences for tile mode basis vectors

Each tile is offset according to the x and y basis. For example, a tile (1,1) would be at basis_x + basis_y

* Update tools for custom tile modes

Show the indicator in the correct position, and only draw on the nearest tile.

* Fix style issues

* Move tile functionality to own class to prevent bloating Project

* Fix error in Tiles bounding box logic

* Make tile mode offsets project settings

Since the desired tile mode offsets depends on the tile being drawn, the tile mode offsets should be a project specific setting which is persisted in the project file.

* Update TileMode object immediately after closing dialog

* Don't draw center tile by default in TileMode

* Move tile mode offsets to view menu

* Move tile mode offsets dialog out of ImageEffects
2022-06-20 12:07:20 +03:00
Emmanouil Papadeas c508b554d0 On quit, make "Save & Exit" the focused button by default 2022-06-16 00:15:54 +03:00
Emmanouil Papadeas 7b067de20e Image effect refactors 2022-06-12 00:27:59 +03:00
Emmanouil Papadeas c9f0301c79 Add a Gradient Map image effect, implements the second half of #595
The gradient edit code was taken and modified from Material Maker, MIT license.
2022-06-11 16:16:37 +03:00
Matteo Piovanelli 872ac62722
Reworked draw_tool (#705)
* Refactored `draw_tool`

In draw.gd, efactored the `draw_tool(position)` function to memorize a
few preliminary steps that may be skipped on every pixel.

* Reformat

* Reformat

* Improved _set_pixel

Memorized a few results per-stroke rather than recomputing them on each
pixel.

* Refactor

* Improved draw_tool_circle

Memorized the shape of the circle as a vector of displacements from
the center to avoid recomputing the whole circle at every position.

* Refactor

* Reworked drat tool methods

I changed the implementations to use private functions that return the
array of points that would be affected by the tool. This way, when we
are drawing a stroke of a tool, we can get all points affected by the
stroke, filter out duplicates, and only set pixels once.

* refactor
2022-06-10 16:30:08 +03:00
Emmanouil Papadeas e4607a46bc Release v0.10.1-stable 2022-06-06 15:43:51 +03:00
Emmanouil Papadeas 0020029871 Update AboutDialog.gd 2022-06-05 17:51:59 +03:00
Emmanouil Papadeas 7683af09df Change 1f to 1.0 in shaders
This makes them work on Godot 3.5
2022-06-02 00:04:08 +03:00
Matteo Piovanelli 06d591c7ad
Only update brush size config if size changed (#704)
This is the fix I proposed in #703 after noticing that the code in `update_config()` was being executed twice when changing the size of brushes.
2022-06-01 14:43:52 +03:00
Emmanouil Papadeas 081ce90a08 Internal changes in SelectionTool regarding snap to grid transformation
These changes allow users to set the left (or right) mouse buttons as mapped shortcuts to the transform snap grid action, in order to automatically snap to grid while moving a selection.
2022-05-29 14:10:18 +03:00
Emmanouil Papadeas c3d56ee547 Add a warning label to window opacity if fullscreen is enabled 2022-05-28 18:23:52 +03:00
Emmanouil Papadeas 2d404dd9ab Fix window opacity not working after entering fullscreen 2022-05-28 17:29:38 +03:00
Emmanouil Papadeas 5e5925b8c6 Update OpenSave.gd 2022-05-22 00:01:17 +03:00
Emmanouil Papadeas 2ae7d638d4 Add missing menu shortcuts 2022-05-21 00:50:39 +03:00
Emmanouil Papadeas b8ed7b382e Remember grid, pixel grid, guides and rulers view menu settings
The next time Pixelorama opens, it will remember your settings.
2022-05-20 18:50:06 +03:00
Emmanouil Papadeas d7cfa87ffa Optimize Magic Wand tool based on #667 and #672 2022-05-20 17:47:19 +03:00
Emmanouil Papadeas c3c337280e Update tile mode on project switch 2022-05-20 14:08:01 +03:00
Emmanouil Papadeas 6b5a835322 Change quick color picker shortcut name 2022-05-20 10:59:25 +03:00
Emmanouil Papadeas b66ea70a92 Fix scale image aspect ratio not updating correctly when the dialog is about to appear 2022-05-19 15:16:28 +03:00
Emmanouil Papadeas 0ad3d16b57 Update translations 2022-05-18 21:46:48 +03:00
Emmanouil Papadeas e2550bba47 In the backup confirmation dialog, change "Delete" to "Discard all" and add Cancel button
Cancel and X button keep the backups in memory, discard deletes them.
2022-05-18 15:51:17 +03:00
Emmanouil Papadeas a478dee88e Treat X as delete in the backup confirmation dialog 2022-05-18 14:42:36 +03:00
Emmanouil Papadeas f327eccaa1 Delete content in all selected cels, and not when a layer is locked/invisible 2022-05-17 19:48:06 +03:00
Emmanouil Papadeas da65380169 Made left and right tool activation shortcuts configurable
Mapped to left and right mouse buttons respectively by default, as well was L1 and R1 buttons respectively in joypads. This commit should allow mouse-free drawing, since it's now possible to activate the left and right tools via joypad and keyboard buttons, thanks to the Keychain plugin.
2022-05-17 01:25:50 +03:00
Emmanouil Papadeas d028582f27 Move cursor with numpad arrow keys, joy d-pad and left stick
Similar to GraphicsGale, you can now draw without moving the mouse. Although you still need the mouse for the left and right buttons, but I'd like to make give more options to the user as well so that they can activate tools using keyboard and joypad buttons, if they like.

The numpad arrow keys did nothing previously, so nothing changes for people who are not interested in this feature. They are also configurable thanks to the Keychain plugin.
2022-05-16 21:50:19 +03:00
Emmanouil Papadeas a98424e474 Rename "confirm" and "cancel" input events
Into "transformation_confirm" and "transformation_cancel" respectively.
2022-05-16 20:01:17 +03:00
Emmanouil Papadeas 4a16700b80 Show correct tool modifier shortcuts in the tool button tooltips 2022-05-16 19:46:26 +03:00
Emmanouil Papadeas f509dfb9f6
Implement the Keychain Plugin (#700)
* Start implementing the godot_better_input plugin

* Update ShortcutEdit.gd

* Load & save preset option

* Add some groups and fix action events not being deleted on load

* Add MenuInputAction class for multiple menu accelerators

* Create a proper plugin and a BetterInput autoload

* Update menu accelerators

* Move settings to BetterInput

* Move menu enums to Global, make more MenuInputActions

* Add more menu events

* Add new groups

* Optimize BetterInput _input() method

* Remove a lot of lines of code

* Change some previous events, add ignore actions and a View menu group

* Change update_item_accelerator to update_ui

* Move MenuInputAction initialization to BetterInput.gd

* Update hint tooltips when a shortcut changes

Temporarily comment out some code regarding the configurable modifiers

* Some MenuInputAction variable name changes

* Add handle_input() to InputAction

* Update the shortcuts of buttons

* Fix shortcut selector menu position

* Change plugin name into Keychain

* Fix keyboard input dialog exiting when Enter or Space is being pressed

* Add two more groups

* Make groups folded by default

* Temporarily make tool modifier shortcuts not configurable

A temporary change, they will be made configurable again, with different actions that are currently mapped to the same events, local/independent from each other.

* Add license for Keychain

* Fix issue where a key event would be added in other input types

* Fix bug where the assigned state was not updated when the dialog appeared again

* Update Main.tscn

* Add a disabled line edit in keyboard shortcut selector to grab focus

* Load presets in the Keychain autoload

This way, the input actions get updated from the start, instead of only at the ShortcutEdit scene.

WARNING, this currently causes crashes if the menu items have no shortcut binded to them.

* Move custom settings away from Keychain.gd

To keep it the same as the upstream plugin

* Change menu enum names

* Made action_get_first_key() more general

* Use arrays for menu items instead of dictionaries, fixes crash

* Move moveable panels to Window menu

* Format

* Optimize hint tooltip updating

* Add support for translations in Keychain

* Translation changes

* Made tool modifiers configurable

Needs more testing.

* Made camera arrow key movement configurable & joypad axis support

This commit removes the ability to press Shift and Control+Shift to adjust the camera arrow key movement speed. Instead, the speed depends on the zoom level.

The right joypad analog stick is configured to move the camera by default.

* Rename presets into shortcut profiles, use Resources and let users create their own

* [skip ci] Update addons README

* Update Global.gd
2022-05-16 15:07:51 +03:00
Emmanouil Papadeas 1e0eb19c15 Don't fill color when creating a new empty frame if the color is transparent 2022-05-15 22:05:35 +03:00
Variable c1759c74eb
Draw UI improvements (#671)
* add limit change with brush

* Delete Draw.gd

* Delete BaseTool.gd

* Some improvements

1) A Smarter Placement of "brushes_popup"
2) A Different Convention for image brushes (100 % instead of 1px)

* Formatting

* some more formatting
2022-05-11 15:46:29 +03:00
AlphinAlbukhari 55b5cc3932
Fix drop shadow (#690)
* Fix drop shadow

* Connect signal

AffectOptionButton didn't work
2022-05-04 01:02:20 +03:00
Variable 0232f95c84
Shader Rotation fix (#687)
* add limit change with brush

* Delete Draw.gd

* Delete BaseTool.gd

* added error calculation

* revert last commit

* fixed rotation bug caused on some transparency

* fix for a bug

when selection was present

* added a comment

* added a fix when selection was enabled

* formating

* fixed another bug

* Added quick buttons for rotation
2022-05-03 19:38:29 +03:00
Emmanouil Papadeas 9e7dd1210b Fix flood fill bug mentioned in https://github.com/Orama-Interactive/Pixelorama/pull/672#issuecomment-1114762474 2022-05-03 00:58:14 +03:00
Emmanouil Papadeas 9a43d4bd34 Change "Step" and "Dithering" gradients to "Linear Step" and "Linear Dithering" 2022-05-02 16:53:13 +03:00
Emmanouil Papadeas cf926942ac
Shader-based gradients (#677)
* Add 6 shader-based gradient types

* Shaders now respect selection

* Fix step gradient

* Remove comments

* Disable step and dithering shaders in Web version

* Fixed a weird bug with dithering shaders, selection and GLES2

Having a selection, applying a dithering gradient, removing the selection and then going to the gradient dialog again causes the dithering shaders to "remember" the previous selection, even if there is no selection currently. This only happens with the two dithering shaders and only with the GLES2 renderer. Removing `uniform sampler2D dither_texture;` from the shader code seems to fix the issue, but that's obviously isn't what we want so a "proper" fix is included in this commit.

* Format & lint

* Removed old gradient code

* Change how centers work on radial step and dithering

* Made angle, center and radius option a bit more clear

* Rename bayer-matrices directory to dither-matrices

* Use DitherMatrix class

* Create dithering types programmatically

* Remove unneeded code in shaders

* Rewrite the step shader without a for loop

More optimized and works on the Web version with GLES2

* Rewrite radial step and dithering shaders without for loop

Now all shaders work on the Web version and have been optimized.

* Fix Linear & Radial size range and remove some unneeded lines

* Added size uniform to Radial Step and Radial Dither

* Swap colors in the Linear gradient

* Make size a percentage

* Make the preview look the same as the result

Didn't change the dithering shaders because they seemed to give different results.

* Remove ratio uniform and divide uvs by the radius instead

This makes more sense because the smaller the number, the smaller the radius.

* Fix linear gradient

* Change Position to percentage and "Size" to "Transition size"

* Mix gradients with original color, if the gradient colors have transparency
2022-05-02 16:12:00 +03:00
Emmanouil Papadeas 539ccb2e58 Fix issue with the bucket tool's "same color pixels" method not working in all selected cels 2022-05-01 03:28:45 +03:00
Variable 5475643079
View Export dimensions (#686)
* add limit change with brush

* Delete Draw.gd

* Delete BaseTool.gd

* added error calculation

* revert last commit

* The Export file dimensions

* formating

* formatting
2022-04-30 19:32:55 +03:00
AlphinAlbukhari 74ae37eb6e
Shader based rotation (#683)
* Add Shader based rotation

* Selection, aspect ratio and edge border

* Change Shader option to Nearest neighbour (Shader)

* Resolve Conflict

* Remove Whitespaces
2022-04-29 18:54:50 +03:00
Matteo Piovanelli c44feb50a7
Refactored bucket.gd (#681)
* Refactored bucket.gd
Separated out the larger functions to ease readability and possible
future improvements.

* Removed debug comment
2022-04-29 00:56:55 +03:00
Emmanouil Papadeas 1f28672eea Fix last end of the last tag being cut off 2022-04-28 19:17:58 +03:00
Emmanouil Papadeas 09a2d70ed0 Update PreferencesDialog.tscn 2022-04-28 18:26:37 +03:00
Variable 12c9d02f12
Better timeline scrolls (#682)
* add limit change with brush

* Delete Draw.gd

* Delete BaseTool.gd

* added error calculation

* revert last commit

* Updated Scrollbar behaviour

* formatting

* removed some bugs

* Update AnimationTimeline.gd

* formatting

* some more formatting +

Removed unwanted function

* formatting

* removed print()
2022-04-28 18:06:41 +03:00
Variable 252e93cc9c
Transparency improvements (#680)
* add limit change with brush

* Delete Draw.gd

* Delete BaseTool.gd

* added error calculation

* revert last commit

* Error calculations

* Update UITransparency.gdshader

* Update UITransparency.gdshader

* Update UITransparency.gdshader

* used "screen_uv" instead of "UV"
2022-04-28 00:03:56 +03:00
Variable b9a841a360
Rotation improvements (#676)
* add limit change with brush

* Delete Draw.gd

* Delete BaseTool.gd

* Pivot correction in case of even size

* fix the Scale3x

it should not remove the edges now

* formatting

* more formatting
2022-04-27 16:27:33 +03:00
Variable 16a2abf9b4
Added shortcuts (#673)
* add limit change with brush

* Delete Draw.gd

* Delete BaseTool.gd

* Added all shortcuts

* formatting

* Removed 1 shortcut from "Fullscreen"

* Assigned shortcuts to special behaviours

* formatting

* Added configurable shortcuts to special behaviour

* formatting

* Added special behaviour shortcuts and some code im

provements

* a minor fix
2022-04-27 15:03:39 +03:00
AlphinAlbukhari 7b721ca66d
Add Drop Shadow (#674) 2022-04-27 14:48:31 +03:00
Emmanouil Papadeas 63759d3607 Remove affect_selection and has_selection checks from Shaders 2022-04-23 14:39:17 +03:00
Emmanouil Papadeas 2da5b1e944 Outline generation with shaders
This results in both better and faster results. Unfortunately, the shader does not work in the Web version, so we have to rely on the old method for that platform.
2022-04-22 21:11:02 +03:00
Emmanouil Papadeas 7215f3e0a7 Fix formatting
No linter erros fixed yet
2022-04-22 15:42:36 +03:00
Emmanouil Papadeas 19512e4516 Change "Flip" window title to "Mirror Image"
Also made Horizontal enabled by default
2022-04-22 15:38:08 +03:00
Matteo Piovanelli 1a19c3a297
Further speed up of bucket fill (#672)
* Removed some calls to can_pixel_get_drawn by
managing has_selection condition differently

* Refactored `_set_pixel` to shortcircuit.
This allowed shortcircuiting away some tests to speed up common code
paths.

* Further refactor of `_set_pixel`
Removed unused functions. Made conditions for pattern-fills clearer.

* Refactor.

* Refactor.

* Removed dev timers.
2022-04-21 04:57:39 +03:00
Emmanouil Papadeas 7c6cdadb86 Optimize shader-based image effects when there is no selection 2022-04-20 03:06:58 +03:00
Emmanouil Papadeas 1e73ce5aa6 Fix export bug where the path is being changed if there's a folder with the same name as the file 2022-04-20 02:49:48 +03:00