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

1448 commits

Author SHA1 Message Date
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
Variable 77513b6ba3
Export conflict (#669)
* add limit change with brush

* Delete Draw.gd

* Delete BaseTool.gd

* added more info about export conflict

* more info about export conflict

* Update Export.gd

* Update ExportDialog.tscn

* fixed a small mistake
2022-04-19 19:29:21 +03:00
Manolis Papadeas bdd32a8239 Make marching ants shader ratio-independent 2022-04-18 15:32:14 +03:00
Matteo Piovanelli 6a7ee3407c
Upgrade/floodfill (#667)
* Implemented floodfill routine by Shawn Hargreaves

* Removed performance timers used for testing

* Reformatting file after setting "Trim Trailing
Whitespace On Save".

* Refactoring to respect code guidelines.

* More reformatting

* More refactoring

* Refactor: added # gdlint: ignore=max-line-length
to line the parser has me set to longer than 100 chars

* Manage selected areas
2022-04-16 12:22:51 +03:00
Manolis Papadeas f42f75aa28 Update TopMenuContainer.gd 2022-04-14 18:33:42 +03:00
Manolis Papadeas fc482831a8 Update tags to 0.10 2022-04-14 18:32:39 +03:00
Manolis Papadeas 93c122f07b Update Uch and Kalpar's social media links 2022-04-14 17:29:32 +03:00
Manolis Papadeas bc11dcfd4b Update the splash screen artworks 2022-04-14 01:13:42 +03:00
Manolis Papadeas 87c4d4c310 Update AboutDialog.gd 2022-04-11 00:43:44 +03:00
Manolis Papadeas b0e4636c66 Properly center the splash screen on application start 2022-04-10 15:41:07 +03:00
Manolis Papadeas d8830d7f06 bool support for shaders
Feature not exposed to the end user yet
2022-04-10 00:04:45 +03:00
Manolis Papadeas c7f9f1d23b vec2 support for shaders
Feature not exposed to the end user yet
2022-04-09 23:28:57 +03:00
Manolis Papadeas d579118bb1 Load textures for sampler2D uniforms in the experimental shader feature
Feature not exposed to the end user yet
2022-04-09 03:42:34 +03:00
Manolis Papadeas 41d9add6a7 Change shader color in the experimental shader feature
Feature not exposed to the end user yet
2022-04-08 02:57:58 +03:00
Manolis Papadeas 8e9243b8c1 Update Main.gd 2022-04-06 00:30:34 +03:00
Manolis Papadeas 980b39d21b Update AboutDialog.gd 2022-04-02 17:10:16 +03:00
Manolis Papadeas 44e5fcfb87 Change global tool option textures 2022-04-01 13:45:24 +03:00
Manolis Papadeas d01d0a287a Make cut not work on locked/invisible layers 2022-03-31 17:30:25 +03:00
Manolis Papadeas 11b6af07f1 Update Translations 2022-03-31 02:29:23 +03:00
Manolis Papadeas a79f368f41 Fix aspect ratio in scale image to work as it does in create image 2022-03-30 16:12:19 +03:00
Manolis Papadeas 8a5cc6860f Move layer and frame initial creation code to Main.gd
From Global.gd
2022-03-29 03:14:41 +03:00
Manolis Papadeas 66ad745c52 Minor code changes 2022-03-29 02:35:32 +03:00
Manolis Papadeas 4cdd20a2fe Fix issue with export preview not working when importing an image 2022-03-27 04:19:47 +03:00
Manolis Papadeas e901fc774a Replace "Export" with "Overwrite" when importing a png
When exporting an imported image, the export will happen immediately, without having the export dialog appear, unless "Export as..." is selected. For .png imported images, the menu option will display "Overwrite" instead of "Export". This makes it clear that if Control + E is pressed on an imported png, that file will be overwritten.
2022-03-25 02:00:40 +02:00
Manolis Papadeas bd6f850ab5 Rename "Flip" into "Mirror Image" 2022-03-24 20:01:31 +02:00
Manolis Papadeas 3727caf9c4 Revert "Use L8 format for selection texture"
This reverts commit 8a3414f83a.
2022-03-23 03:56:47 +02:00
Manolis Papadeas 8a3414f83a Use L8 format for selection texture
Instead of LA8. This should result in slightly less memory usage and is more on par with Godot's BitMap "convert_to_image" method, which will be exposed in Godot 3.5.
2022-03-23 01:48:58 +02:00
Manolis Papadeas 8624ed6da8 Fix macOS shortcuts 2022-03-22 01:48:14 +02:00
Manolis Papadeas 9648b48a96 Remove empty project when importing an image
This should no longer keep empty canvases when importing images
2022-03-21 23:33:45 +02:00
Manolis Papadeas 4cf9c57e84 Don't reset export status when a pxo is saved 2022-03-21 23:07:57 +02:00
Manolis Papadeas 57729ef4e9 Move Moveable Panels to the Panels submenu 2022-03-21 18:04:26 +02:00
Manolis Papadeas bf98dd18e6 Remove the "Palettes" label from the Palettes panel 2022-03-21 16:24:03 +02:00
Manolis Papadeas 1c3103e06b Scale custom cursor with UI size - closes #642 2022-03-21 02:24:13 +02:00
Manolis Papadeas 0e79138d87 Another canvas texture optimization + bug fix with resizing 2022-03-20 18:52:48 +02:00
ArthyChaux 9e5db16994
Optimize canvas texture updates (#661)
In this line, a new texture is generated each time the canvas is updated it seems :
But it is mentionned in the documentation to use `void set_data(image: Image)` instead for slightly faster results, which updates the texture instead of creating a new one.

I hope that it is relevant !

Also, if it is approved, this change should be applied to everywhere it is used (except when initializing the texture)
2022-03-19 19:21:07 +02:00
Manolis Papadeas 9411f37a47 Add a confirmation dialog when deleting a layout 2022-03-18 04:21:38 +02:00
Manolis Papadeas 9128b455e6 Transparent canvas now works properly with scaled UI 2022-03-18 01:08:00 +02:00
Manolis Papadeas 4059cb018b In ResizeCanvas, always set the spinbox values to the current project size 2022-03-18 00:07:40 +02:00
Manolis Papadeas 790cd8533a Changes to ManageLayouts dialog 2022-03-18 00:03:53 +02:00
Manolis Papadeas 21b4f3369f Select layer when clicking a layer button (visible, lock, etc) 2022-03-17 00:12:00 +02:00
Manolis Papadeas bffc36a018 Change Layout menu and rename Edit Mode to Moveable Panels 2022-03-16 00:30:24 +02:00
Manolis Papadeas 5d3963d495 Make panel tabs always visible if there are 2 or more tabs in a single panel 2022-03-12 20:46:17 +02:00
Manolis Papadeas 6d641259d5 Make it possible for extensions to add menu items
With metadata
2022-03-11 01:59:12 +02:00
Manolis Papadeas f2a24aaffd Set grayscale vision node properties instead of in code 2022-03-11 01:48:50 +02:00
Manolis Papadeas 5995788ef7 Update donors & translators 2022-03-11 00:45:48 +02:00
Manolis Papadeas c00aac944e Translate the panel tab names 2022-03-10 19:17:28 +02:00
Manolis Papadeas 294738e48a Disable "From Current Palette" preset option when creating a new palette, if there is no current palette
Fixes #659
2022-03-07 19:33:23 +02:00
Manolis Papadeas 07473bea95 Update UI.gd 2022-03-06 00:15:25 +02:00
Variable 57ea4d25f1
Draw optimizer (#657)
* draw optimizer

* improvements

* some memory improvements

don't think this one's needed but doing it just in case...

* formatting

* add limit change with brush

* fixed a small bug

cache was being kept when frames were changed

* formatting

* change `_cache_limit` on changing `_brush_size`
2022-03-03 14:54:27 +02:00
Manolis Papadeas ce026395df Remember layout on app exit 2022-03-02 00:41:22 +02:00
Manolis Papadeas 2f9de65805 Zen mode no longer makes invisible elements visible again 2022-03-02 00:01:28 +02:00
Manolis Papadeas 175eb0b250 Set minimum size in tools, tool options and timeline 2022-03-01 21:39:07 +02:00
Manolis Papadeas da34f0ae7b Center the global tool options 2022-03-01 02:16:53 +02:00
Manolis Papadeas 092ddc0a7a Fix crash when we change a non-existant texture in a TextureRect
This should never happen, but just in case.
2022-02-28 20:40:13 +02:00
Manolis Papadeas 68414f5bd9 Made pixel perfect into a global tool option
More global tool options will most likely be added soon, most notably tablet pen pressure sensitivity options.
2022-02-28 19:24:14 +02:00
Manolis Papadeas b316cadfb8 Separate global tool options from the color pickers 2022-02-28 18:59:30 +02:00
Variable bec30112f6
improvements to copy\delete methods and (some) tag workflow (#648)
* improvements to copy and delete methods

To allow cloning/deleting an array of frames

* formatting

* adapt to the new copy/delete methods

* Update AnimationTimeline.gd

* removed some bugs

* changed old tag behaviour

tags ahead get further by 1 frame on add_frame()

* modified tag behaviour

* formatting

* removed tag interaction
2022-02-28 03:31:17 +02:00
Manolis Papadeas e05ee53839 Fix mirror button textures having the opposite file name 2022-02-26 19:50:43 +02:00
Variable de2d7b7748
A simple id for extensions (#653)
* A simple id for extensions

A simple id system for extensions using the benefit of groups

* formatting
2022-02-26 16:14:13 +02:00
Variable 906123bab1
Sync import options (#624)
* sync import options (1/2)

* sync import options (2/2)

* resolve format check

* a minor improvement +

some code formatting

* some more formatting

* Some  more formatting

...the checks becoming a pain...

* again you guessed it!

CODE FORMATTING

* used checkbutton instead of simple button

* formatting
2022-02-25 16:08:11 +02:00
Manolis Papadeas 8e126c3bab Load shaders by dragging and dropping and support hint_range values
This is for the experimental shader feature, which isn't exposed to the user yet.
2022-02-24 03:38:13 +02:00
Manolis Papadeas d4373a680b Use preload on the tool scenes again
This makes the initial app load time fast again, as it used to be before the tool logic changes. The code is uglier to read now but it's worth it.

Also optimize update_tool_cursors()
2022-02-23 00:10:16 +02:00
Manolis Papadeas 63a9f2485c Support tools that don't have shortcuts
Might be useful for Extensions that add tools and for the future where we allow users more freedom with shortcut binding, including unbinding shortcuts.
2022-02-22 23:38:47 +02:00
Manolis Papadeas 77f598d969 Added remove_tool() method in Tools
May be useful for extensions that add new tools
2022-02-22 02:58:52 +02:00
Manolis Papadeas 4d3cb86800 Change the look of the mirror buttons 2022-02-21 20:04:39 +02:00
Manolis Papadeas 200d1c73a1 Add a clear_color property to the themes 2022-02-21 18:44:46 +02:00
Manolis Papadeas add9ba926e Remove pre-set tool button nodes, tool setup now being done only in the Tools singleton
Now when making a new tool we only have to set it up in Tools.gd, along with its button and cursor textures and its tool options scene. Previously, we also had to put it in ToolButtons.gd and manually create a button in Tools.tscn
2022-02-21 18:02:02 +02:00
Manolis Papadeas 5bf9da243f Add the Extensions parent node to Main.tscn 2022-02-21 15:46:08 +02:00
Manolis Papadeas 8d0418fe21 Don't do anything if the user adds an already existing extension
The .pck file gets replaced but changes will only be visible on app restart, as there's no way (I think) to unload and then reload the .pck file.
2022-02-21 03:33:05 +02:00
Manolis Papadeas 375f3d4cb6 Implement a basic extension system
Importing .pck or .zip Godot resource pack files into Pixelorama is now possible. This needs to be documented properly, but here's the basic idea, for now at least. This is super early work and I haven't tested it with a proper extension yet, so all of this could be a subject of change. I tested it with a custom theme extension though and it seems to be working perfectly.

Importing resource pack files, either by dragging and dropping them into the app window or by going to Edit>Preferences>Extensions>Add Extension, copies the files into user://extensions/. Extensions can be enabled/disabled and uninstalled. Uninstalling them deletes the resource pack files from user://extensions/.

The extension project source files need to be in a folder inside src/Extensions/ with the same name as the .pck or .zip file. **This is required for now, otherwise it will not work.** Inside that folder there also needs to be an extension.json file, with a structure similar to this:

{
	"name": "ExtensionName",
	"display_name": "Extension Name",
	"description": "A Pixelorama extension",
	"author": "Orama Interactive",
	"version": "0.1",
	"license": "MIT",
	"nodes": [
		"ExtensionExample.tscn"
	]
}

The `nodes` array leads to the packed scene files with the nodes that are to be instantiated. **The root nodes of these scenes need to have the same name as the .tscn files they belong to.** The scripts of these nodes should have _enter_tree() and _exit_tree() methods to handle the extension enabling/disabling (or even uninstalling) logic. Note that .json files need to be included in the export options while exporting the extension from Godot.

Enabling an extension means that the scenes found in the extension.json's "nodes" array get instantiated, and disabling gets rid of these nodes from Pixelorama's SceneTree.
2022-02-19 03:21:08 +02:00
Manolis Papadeas bafcb2620a Tidy up preferences code
Use a Preference class instead of a nested array. Lines of code reduced from 461 to 330. Also fixed a minor bug in the Web version where, when the user changed language, "Interface" was being selected instead.
2022-02-18 01:47:05 +02:00
Manolis Papadeas d37d3c5d3d Even more theme code tidying 2022-02-17 20:57:54 +02:00
Manolis Papadeas 71dcb9807d Theme code cleaning and tidying 2022-02-17 20:36:10 +02:00
Manolis Papadeas 290e8cdb18 Remove mirror nodes from the tool scenes 2022-02-17 16:12:07 +02:00
Manolis Papadeas 93622d5761 Mirroring buttons now affect both left & right tools 2022-02-17 16:07:03 +02:00
Manolis Papadeas 9e7748d2ec Fix rare issue where the splash screen never appears and the program is unresponsive 2022-02-17 15:22:34 +02:00
Manolis Papadeas 8b53773d2d Split View menu into View and Window menus 2022-02-17 00:54:09 +02:00
Manolis Papadeas e0d2393eb2 Fix crash when importing .tres files that are not palettes 2022-02-16 18:23:32 +02:00
Variable 008683a33a
Novhack fill shader (#649)
* Get same color pixels shader (#2)

* Replace same color pixels bucket code with a shader

* Add pattern fill

Co-authored-by: novhack <42614907+novhack@users.noreply.github.com>

* formatting

* some minor changes and fixed a bug

* added similarity feature

* formatting

* Update Bucket.gd

* added similarity feature in shader

Co-authored-by: novhack <42614907+novhack@users.noreply.github.com>
2022-02-16 00:15:53 +02:00
Manolis Papadeas 196c5c2d5d Make the second canvas a separate panel and have it hidden by default 2022-02-15 01:48:49 +02:00
Manolis Papadeas a29aadd519 Use deferred mode for gradient color pickers - Closes #645 2022-02-14 15:37:18 +02:00
Manolis Papadeas 88578fe260 Set the min size of the tools to be a bit smaller 2022-02-13 00:12:47 +02:00
Manolis Papadeas d26d1e294b Fix cursor always being a cross on the canvas even if it's toggled off 2022-02-12 04:25:08 +02:00
Variable f7e866e9cb
Shader vision - Grayscale view (#646)
* ShaderVision Funcionality

* reference to ShaderVision

* Greyscale shader

* A minor code improvement

* decided on a checkbox

* decided on a checkbox

i foresaw the earlier implementation isn't required so i decided on a checkbox

* removed unneeded code

* reverted a mistake commit

* Update TopMenuContainer.gd

* Precieved Brightness
2022-02-12 00:47:26 +02:00
Variable 25fd6026be
Move Guides without moving mouse outside canvas (#647)
* guide movement enhancement

* Gave more access to pan tool

* Update Guide.gd

* Update Guide.gd

* Update Tools.gd
2022-02-11 03:16:33 +02:00
Manolis Papadeas 74df57ed70 Add extra cursor options to the Preferences
Changes "Indicators" to "Cursors" and adds options that let the user use the native mouse cursors of the OS and toggle the cross cursor on or off for the canvas
2022-02-10 22:32:55 +02:00
Manolis Papadeas 1285fa89c5 Added a Scrollcontainer in the timeline
This fixes the issue with the timeline UI nodes affecting the rest of the panels if the timeline becomes too small. Kind of an ugly fix because there can now be two scrollbars visible if there are many frames, eventually we may need to redesign the timeline.
2022-02-10 19:15:57 +02:00
Manolis Papadeas a3e933cf4f Fix a bug where the selection got stuck to the canvas boundaries when they were 1px away from them 2022-02-09 16:14:16 +02:00
Manolis Papadeas a331d697ed Move some variables in AnimationTimeline
No functional changes
2022-02-07 18:10:29 +02:00
Manolis Papadeas 4fe65fabf7 Rename "Dockers" to "Panels" and update Translations.pot 2022-02-07 01:18:19 +02:00
Manolis Papadeas 8394f252f7 Implemented a system that lets the user make and delete their own UI layouts
Layouts are being saved as .tres files in user://layouts
2022-02-06 01:49:54 +02:00
Manolis Papadeas 26d5b8de40 Added MysteryStudio to the splash screen 2022-02-05 23:50:02 +02:00
Manolis Papadeas 1dd7d23682 Minor timeline UI fix 2022-02-04 17:03:57 +02:00
Manolis Papadeas ad9d8cfdbc Properly fix the palette panel initialization issue
And remove the hacky way. The issue is that the swatches were being created and then queue_freed at the end of the frame and not immediately.
2022-02-03 19:57:53 +02:00
Manolis Papadeas f96879012d Fix orphan node 2022-02-03 02:41:14 +02:00
Manolis Papadeas 0893a5b481 Added frame duration appear in the frame button tooltips
Code provided by @Variable-ind
2022-02-02 18:14:16 +02:00
Manolis Papadeas 13229031ed Turn zen mode off when switching between layouts 2022-02-02 02:51:43 +02:00
Variable 4369869e1f
Some Popup changes and added Self Awareness ;) (#644)
* Some Popup changes and added self awareness

start/end is automatically determined by selected cels boundary

* Update FrameTagDialog.gd

* some more code formatting
2022-02-02 00:40:37 +02:00
Manolis Papadeas 12b64316da Added layout selection
Users can currently select between Default and Tallscreen
2022-02-01 02:31:13 +02:00
Manolis Papadeas cbae8bdc77 Put a ScrollContainer in the tool bar 2022-02-01 00:54:33 +02:00
Manolis Papadeas c7649bc061 Save toolbar as a separate scene 2022-01-31 19:01:55 +02:00
Manolis Papadeas 7e9d9a6a73 Make layer button container change color based on theme
Also removed unneeded node from AnimationTimeline
2022-01-31 18:25:52 +02:00
Variable 748a172b7b
Transparency fixes (#641)
* added a node path

* removed a line that's not needed

* added shader transparency "illusion"

before it "Alternate transparent background" was used.

* code formatting

* shader for ui transparency

* some more formatting

* more formatting...
2022-01-31 02:18:04 +02:00
Manolis Papadeas e2bb0b8440
New UI system using Dockable Containers (#640)
* Add dockable container plugin

Experimenting with it, also added a tabs_visible property to the DockableContainer. Removed some code about Tallscreen from Main.gd, but not all of it.

* Add a panel behind the UI, temporarily restore the dark theme

* Remove tallscreen code

* Add edit mode, toggles DockableContainer's tab visibility on and off

* Split tool options into color pickers, left and right tool options

* Remove alternate_transparent_background

* Re-order tool buttons on resize

* Clip content in timeline

* Changes to the tool panel

* Removed some old unused node variables

* Restore Zen mode

* Set tabs_visible = false by default

* Better way to set tabs_visible = false by default

* Added the license of godot-dockable-container

* Remove unneeded lines

* Update README.md

* Restore window transparency with the canvas

It makes all of the TabContainers transparent however, which may not be what we actually want.

* Change tab names of the UI elements

* Remove unneeded nodes from ColorPickers.tscn

* Update default.tres

* Let the user hide elements individually

* Add some checks in HandleThemes

* Center tool icons

* Remove unneeded custom panel in SplashDialog

* Bump version to v0.10-dev and some other minor changes

* Fix crash on Zen Mode

* Added a hacky way to fix the issue with the palette panel size
2022-01-30 00:47:25 +02:00
Manolis Papadeas 2649f0e2b8 Added Portuguese 2022-01-27 20:45:26 +02:00
Manolis Papadeas ec54754159 Remove unneeded line in TransparentChecker.gd 2022-01-26 18:33:53 +02:00
Manolis Papadeas 35b10a1cc4 Rewrite the translators code 2022-01-24 20:11:39 +02:00
Manolis Papadeas 686a49d4c5 Release v0.9.2-stable 2022-01-21 16:03:53 +02:00
Manolis Papadeas 2f9960e15e Update AboutDialog.gd 2022-01-11 03:40:46 +02:00
Manolis Papadeas f7a6ed0289 Don't draw in unavailable layers if multiple cels are selected 2022-01-09 00:53:42 +02:00
Manolis Papadeas 9fb9d06c38 Clear mask in Draw tools if it's not needed and it already exists 2022-01-08 17:44:15 +02:00
Manolis Papadeas db8ded9d66 Fix Pencil bug with transparent colors immediately blending when Overwrite is setto false 2022-01-08 17:18:59 +02:00
Manolis Papadeas 0da52326a3 Quitting now detects if changes have been made in other projects too other than the current 2022-01-07 03:36:16 +02:00
mrtripie f0fbca8b5b
Bugfix: Duplicate Shader in ShaderImageEffect before modifiying its code (#630)
* Fixed issues with Shading tool Saturation and Value not always being right in Hue Shading mode

* Shading tool hue shifting fixes and tweaks

* Duplicate shader resource before modifying its code

* added line before comment

Co-authored-by: MrTriPie <MrTriPie>
2022-01-07 01:49:22 +02:00
Manolis Papadeas c242cd546d Add a checkbox in Preferences for quit confirmation
This has no effect if the project has unsaved changes.
2022-01-05 02:34:45 +02:00
Manolis Papadeas 0fa6879bdf Made guides a little easier to select and drag 2022-01-04 21:00:03 +02:00
Manolis Papadeas 8f701dfee0 Fix #626 2022-01-03 14:05:41 +02:00
Manolis Papadeas 04dda09df5 Do not delete cel content if the layer is locked/invisible 2022-01-01 04:12:49 +02:00
Manolis Papadeas 605e7ab3fd Copy frame duration when cloning a frame 2021-12-31 04:05:04 +02:00
Darshan Phaldesai 51288148ee
Shader Fix Hack (#625) 2021-12-30 18:05:28 +02:00
Manolis Papadeas 95ae81eef1 Fix undo error when the user draws on a locked/invisible layer 2021-12-29 21:48:33 +02:00
Variable bbc56e253e
Spritesheet layer improvements (#623)
* Drastically changed an old func()

"open_image_as_spritesheet_layer" (Hope i didn't break anything...)

* removed whitespace

* some minor changes

spritesheet "Start frame" no longer restricted to existing frames number
and a minor UI change

* solved some format errors
2021-12-28 23:45:46 +02:00
Manolis Papadeas 311f4dd70b Add missing line to Desaturate and InvertColors, and made some changes to ShaderImageEffect 2021-12-27 00:08:06 +02:00
Manolis Papadeas 93268fef43 Fix another bug with Undo/Redo where the app became unresponsive if the user drew outside the canvas 2021-12-25 19:21:09 +02:00
Manolis Papadeas b40c2f5b75 Minor UI changes 2021-12-24 03:12:44 +02:00
Manolis Papadeas 48326900d9 Fix a memory leak coming from the Layer class
Removed the "frame_container" property from Layer.gd, which used to hold a reference to a node, leading to orphan nodes being created and never freed. Memory management seems to be working okay now. Previously, every time the user made a change, memory kept going up and never coming down. Now, data that can never be recovered, like undo data that have been rewritten in history, are also removed from memory.
2021-12-23 19:58:07 +02:00
Manolis Papadeas 6a78351704 Fix undoredo not working if the users draws on a locked/invisible layer 2021-12-21 01:26:58 +02:00
Manolis Papadeas 50885b8769 Release v0.9.1-stable 2021-12-20 13:45:53 +02:00
Manolis Papadeas 30f2873ed1 Remove unneeded method from HTML5FileExchange 2021-12-18 02:31:10 +02:00
Manolis Papadeas 92c252e22d Fixes #618 2021-12-15 01:39:24 +02:00
Manolis Papadeas 28341a18d2 The autosave timer no longer starts after the backup confirmation dialog gets hidden, if the autosave option is turned off in the Preferences 2021-12-14 21:51:52 +02:00
Manolis Papadeas 7b7c572f13 Fix issue where the timeline would be unresponsive if zen mode was toggled off and on 2021-12-12 17:11:25 +02:00
Manolis Papadeas 750fae4713 Project data no longer remain in memory after the user has removed their tab 2021-12-11 21:29:32 +02:00
Manolis Papadeas 057318f659 Pause the app when it loses focus instead of limiting its FPS 2021-12-11 20:02:51 +02:00
Manolis Papadeas 47943703ec Update CHANGELOG & AboutDialog 2021-12-07 02:20:12 +02:00
Manolis Papadeas 02a74d498c Fix shape tool previews not being updated when modifier keys are being pressed 2021-12-06 19:11:50 +02:00
JumpJetAvocado fa27d7fbad
Fix drawing bug reported in issue-555 (#603)
* Fix drawing bug reported in issue-555

* Remove unused parameter from commit_undo() in Draw.gd
2021-12-06 18:38:54 +02:00
Manolis Papadeas af86856dc6 Added a clipboard pattern button
It starts empty and gets updated every time the user copies something.
2021-12-05 18:37:15 +02:00
Manolis Papadeas 086c6c5b9c Remove unneeded font changing code
Welp, I just found out that Godot's font resources have fallback options. Better late than never, I guess.
2021-12-03 02:39:10 +02:00
Manolis Papadeas 563aab3137 Update AboutDialog.gd 2021-12-03 01:45:57 +02:00
Manolis Papadeas 59ee60151e Change "Rectangle Select" undoredo action to "Select" 2021-12-02 13:25:20 +02:00
Manolis Papadeas 67ec887ad1 Just one method for undo/redo in Global.gd 2021-12-02 02:22:32 +02:00
Manolis Papadeas f70efe3076 Move new_empty_frame() to Project.gd from Canvas.gd
This commit also changes the behavior of the fill color. The new cels now only get filled with the Project.fill_color if they are on the bottom layer.
2021-12-01 20:50:50 +02:00
Manolis Papadeas 4c60ef144f Fixed project not having the correct size if the default image size has been changed in the Preferences
Ideally, the new_empty_frame() method should be removed from Canvas and should probably go to Frame or Project.
2021-12-01 20:02:39 +02:00
Manolis Papadeas f7ef4a4283 Remove handle_undo() and handle_redo() from Canvas.gd
Getting rid of some old, unneeded code.
2021-12-01 17:49:22 +02:00
Manolis Papadeas f3d696ef81 Clear code from ShaderEffect.gd
Now inherits from ImageEffect and uses a ShaderImageEffect to generate the image. We get to clear duplicate code that was shared between ShaderEffect.gd and ShaderImageEffect.gd this way, and it also uses the undo/redo logic from ImageEffect instead of Canvas.gd.
2021-12-01 03:41:20 +02:00
Manolis Papadeas 2cab2af561 Preload image effect shaders 2021-12-01 03:04:40 +02:00
Manolis Papadeas 72aef23cce UI changes to the onion skinning settings
Also changed the ignore text to the "_io" suffix instead of "ignore_onion", because this is quicker to type.
2021-12-01 02:28:12 +02:00
Manolis Papadeas 15d987ebae Changed behavior of flip image to make it work as expected with selections
The selection itself also gets flipped, if there is any
2021-11-30 02:42:35 +02:00
Manolis Papadeas 3835a3f0da Fix all of linter errors 2021-11-29 18:58:40 +02:00
Manolis Papadeas e2a68c4ba4 Add an underscore to private method's names
As a way to differentiate between public and private methods, as per the official GDScript naming convention. Haven't changed all of the codebase yet, just some scripts that had a lot of public methods. This fixed 4 of the 7 errors of the linter.
2021-11-29 17:12:30 +02:00
Manolis Papadeas 540a61ae4d Merge onion skinning past and future into one script 2021-11-26 03:38:00 +02:00
Variable 159a821dd2
Better Onion Skinning (#600)
* better onion part (1/3)

changed code and added scripts

* better onion part (2/3)

added some onion variables

* better onion part (3/3)

Added to onion dialog

* removed whitespace that gave static error
2021-11-26 02:55:08 +02:00
Manolis Papadeas 246f6f9be1 Minor code changes 2021-11-25 19:10:04 +02:00
Manolis Papadeas 8c9545e183 Preload tool scenes
The app now opens just a bit faster
2021-11-25 17:42:35 +02:00
Manolis Papadeas 7489ae3777 Optimize update_hint_tooltips() calls
Now gets called once at the beginning instead of multiple times for every shortcut.
2021-11-25 15:16:56 +02:00
Manolis Papadeas c6b9a1fb82
Format code and add static checks (#599)
* gdformat .

* Lint code - Part 1

* Format code - Part 2

* Lint code - Part 2

Trying to fix the max allowed line length errors

* Add normal_map_invert_y to the image .import files

Because of Godot 3.4

* Do not call private methods outside of the script's scope

Lint code - Part 3

* Format code - Part 3

* Fixed more line length exceeded errors - Lint code Part 3

* Export array of licenses - Lint code part 4

* Clean hint_tooltip code from Global

Removes a lot of lines of code

* Create static-checks.yml

* Fix FreeType's license
2021-11-25 14:48:30 +02:00
Manolis Papadeas 41b5db4622 Don't change the cursor tool icon texture _input() call
Seems like my past self has made some pretty embarassing optimization mistakes...
2021-11-23 02:52:21 +02:00
Manolis Papadeas 536250f517 Moved some variables away from Global 2021-11-23 02:36:22 +02:00
Manolis Papadeas c921344b04 Fix splash screen not appearing in the Web version 2021-11-22 21:38:17 +02:00
Manolis Papadeas 79ff0a8d45 Optimize _input() methods 2021-11-22 21:32:39 +02:00
Manolis Papadeas 4931e50213 Move cursot tool icon visibility to ViewportContainer
I have no idea what I was thinking when I put that code inside Canvas' _input()
2021-11-22 18:43:06 +02:00
Manolis Papadeas 36680795ee Move even more code away from Global
The idea is to make the project less dependant on Global. Global should strictly be used for reusable code in multiple places, not as a second Main. I just hope I'm not breaking anything during this process.
2021-11-22 17:37:06 +02:00
Manolis Papadeas 19c062fa07 Move some PopupMenu code away from Global's _ready() 2021-11-22 16:15:36 +02:00
Manolis Papadeas 88365301fb Change window opacity settings to a dedicated dialog with a slider and a spinbox
Changed from a popupmenu with fixed settings. This should give more freedom to the user while improving UX.
2021-11-22 04:47:41 +02:00
Manolis Papadeas f4c903771d Remove some unneeded yield() calls
And minor changes to make the code a tiny bit more clean. I tested this PR, but it still might be a bit risky.
2021-11-17 19:59:14 +02:00
mrtripie 0081aa365a
Guide Color Improvements (#561)
* Symmetry guide color work

* Changed to semi-transparent guides from red, blend slight blue into symmetry guides for variation

Co-authored-by: MrTriPie <MrTriPie>
2021-11-17 01:48:21 +02:00
Variable 3e88efc118
Improvements to Animation Tags (#560)
* Animation tag fix (a)

fixed tag behavior in "Project.gd"

* Animation tag fix (b)

fixed tag behavior in "AnimationTimeline.gd"

* Animation tag fix (c)

fix top part of line not visible

* Animation tag fix (d)

a fix i forgot about earlier

* added a randomizer...

... to auto select colors of new tags

* Fix Tag scrolling without cels when scrolled on it

* removed randomize() cause it's not needed
2021-11-17 00:21:29 +02:00
mrtripie 969aed8070
Cache Save/Open Sprite Dialog's directory, and keep dialogs synced (#559)
* Open/Save Sprite Dialogs now have their directory cached so when reopening Pixelorama they will be set to that directory. Load last project and load recent project also syncs with the open/save dialogs and caches that directory

* Sets a projects default file path to the cached file directory (not sure about) and if the export directory is blank, use the cached file directory

* Changed 'file_dialog_dir' to 'current_dir'

Co-authored-by: MrTriPie <MrTriPie>
2021-11-17 00:17:02 +02:00
Manolis Papadeas 752703878d Use onready vars for nodes in Global.gd
I have no idea why I didn't do that sooner. This cleared over 80 lines of code.
2021-11-16 00:04:50 +02:00
Manolis Papadeas 1fa0b1e1b7 Hide the "Brush colors from" option from the Eraser tool 2021-11-15 02:03:05 +02:00
Manolis Papadeas 9cfa8c82b1 Make the eraser tool's transparency settings work with brushes 2021-11-14 16:19:38 +02:00
Manolis Papadeas 4f02ea1b97 Alt to pick colors with draw tools - Closes #125 2021-11-14 03:30:00 +02:00
mrtripie a9039cccd5
Canvas Rotation (#558)
* Implemented canvas rotation

Co-authored-by: MrTriPie <MrTriPie>
2021-11-13 20:43:37 +02:00
Jeremy Behreandt 429b37f6fc
Use Luminance In Desaturate Shader (#557)
Updated desaturate shader to use perceptual luminance instead of HSV.
2021-11-12 21:46:29 +02:00
Manolis Papadeas 24d25d49ea Implement #429 2021-11-11 03:21:34 +02:00
Manolis Papadeas 0c1fcdea89 Use JavaScript.download_buffer() for file downloading in the Web version
This commit makes Pixelorama unable to run in Godot versions prior to 3.4.

I wonder if there are plans for an upload_buffer() method as well...
2021-11-10 20:16:25 +02:00
Manolis Papadeas 6e5c4fc99f Do not keep decreasing opacity with the Eraser without releasing the mouse first
Only relevant if the opacity strength is less than 255 in the tool options
2021-11-08 19:26:00 +02:00
Manolis Papadeas 056cb76a46 Minor code cleanups 2021-11-06 17:23:54 +02:00
Manolis Papadeas 87261e93c6 Disable "New Brush" in the Edit menu if there is no selection 2021-11-06 17:19:20 +02:00
Manolis Papadeas f6b15cb562 Fixes #552 2021-11-04 02:46:12 +02:00
Manolis Papadeas 77996c769e Implement #540 and a part of #429 for the zoom tool 2021-11-03 02:33:45 +02:00
Manolis Papadeas 11f8402d57 Change the UI scale slider step to 0.25 from 0.1 2021-11-01 18:23:09 +02:00
Manolis Papadeas 93a8e75bcb Change the backup dialog message 2021-10-26 03:34:14 +03:00
Silent Orb 520e31cd7e
Persist palette selection (#549) 2021-10-17 16:20:11 +03:00
Variable 087387a700
Minor adjs to eraser (#548) 2021-10-15 16:31:24 +03:00
Manolis Papadeas c7f238ff19 Don't show the brush color from option in the Shading tool 2021-10-15 15:49:23 +03:00
Manolis Papadeas cdb7ff1004 Add an opacity option for the Eraser's tool options
This lets the user change the strength of the tool. When it has an opacity of 255, the eraser will completely delete the underlying pixels. If it has less than 255, it will simply subtruct that value from the underlying pixel's alpha.
2021-10-12 23:12:05 +03:00
Manolis Papadeas a5e3afa7e2 Start the autosave timer if the user presses X on the backup confirmation dialog 2021-10-11 20:40:26 +03:00
Manolis Papadeas 4b552a1fdd Enable autowrap for the Backup confirmation dialog 2021-10-11 19:55:25 +03:00
Manolis Papadeas 18ed5b2a05 Update CHANGELOG & AboutDialog 2021-10-07 16:57:26 +03:00
Manolis Papadeas b7e598c438 Fix issue with copying and pasting to a different project that has a smaller canvas
Fixes a bug caused by 86e66495b1
2021-10-06 02:02:56 +03:00
Manolis Papadeas 845bf2bab7 Fixes critical bug that is caused by removing a project tab that is to the left of the currently active tab 2021-10-06 01:51:39 +03:00
Variable da070db27e
Log Option (#546)
* Added Log button option
2021-10-05 23:37:16 +03:00
Manolis Papadeas 721cab8765 Minor changes that make Pixelorama work with Android
Just planting the seeds of a possible Android version, probably tablet-only, at least at first. I do not know when that will happen yet.
2021-10-02 15:08:58 +03:00
Laurenz Reinthaler 502c7d9409
Add idle fps setting and fix bug when moving the mouse outside of the application (#543) 2021-09-29 18:03:45 +03:00
Manolis Papadeas 61fa13cde3 Fix notifications not appearing properly when the UI is scaled 2021-09-27 02:41:45 +03:00
Manolis Papadeas 3b7ac1eddf Fix guides not working properly when the UI is scaled 2021-09-27 01:30:53 +03:00
Marquis Kurt cad464eb99
(Port) Port Pixelorama to Ubuntu Touch (#517)
* Add support for creating Ubuntu Touch click packages.

The clickable directory contains the files necessary to create a
click package designed for Ubuntu Touch, a community-driven Linux
distro for mobile phones as an alternative to iOS and Android.

A new CI script has been added to create the packages, which is
copied over from one of my other projects. Please change this to
suit your needs.

A new custom feature "clickable" has been added to the project
settings to allow customizations for the Ubuntu Touch platform.

Signed-off-by: Marquis Kurt <software@marquiskurt.net>

* Make clickable CI follow more closely to desktop builds

* Remove sudo from clickable install step

* Install software-properties-common

* Comment out docker startups in click install

* Change export name for Click version

* Change name and export mode to pack only

* Change means of copying data to clickable dir

* Install sudo to docker

* Add -g to docker add user

* Remove docker user creation

* Remove other chpasswd stuff

* Split CI into two jobs

* Make build-ubports.sh runnable

* Use HiPDI GUI theme on Clickable

* Move clickable folder to Misc, add release CI targets

* Add mobile to clickable settings

* Add pixelorama_data to install data

* Create pixelorama_data subdir in click itself

* Change default save dir for clickable

* Update AppArmor policy

* Update clickable version to test AppArmor

* Revert changes and use user data dir

* Add README pertaining to Ubuntu Touch

* Remove GODOT_MAC_VERSION from UT port workflow

Co-authored-by: Manolis Papadeas <35376950+OverloadedOrama@users.noreply.github.com>
2021-09-25 13:42:31 +03:00
Manolis Papadeas 86e66495b1 Fix issue with copying and pasting to a different project that has a bigger canvas 2021-09-24 19:23:59 +03:00
Manolis Papadeas f948c24430 Fix Changelog URL 2021-09-24 17:39:02 +03:00
Variable 41d88c1839
Boost HSV and Rotation sliders (#531)
* Added a timer to filter out useless values

This timer will determine if you actually want to view these changes or just want to skip ahead

* a live preview checkbox

* Some dialog improvements

* Minor changes/adjustments
2021-09-23 21:25:35 +03:00
Manolis Papadeas 8f115a726e Fix #541 2021-09-22 21:54:16 +03:00
Laurenz Reinthaler ad37c67690
Add buttons for looking at different splash-screen artworks (#538)
Fix overlooked line of code
2021-09-22 16:06:30 +03:00
Manolis Papadeas d584ae0839 Launch of version 0.9 - selections & shapes update 2021-09-18 18:59:15 +03:00
Manolis Papadeas dc413eb724 Update the splash screen with 3 new artworks for v0.9
Art by Wishdream, Roroto and Kamilayza
2021-09-17 16:37:16 +03:00
Manolis Papadeas f3ea6b57cd Fix opening pre-v0.8 pxo files 2021-09-07 20:31:32 +03:00
Manolis Papadeas 7bbc01d978 Keep the tallscreen hsplit container invisible if we're changing panel layout mode in Zen mode 2021-09-06 17:55:26 +03:00
Manolis Papadeas 3d0d0b0335 Bump version to v0.9-rc3 2021-09-06 17:21:10 +03:00
Manolis Papadeas cae4f39a4b Hide the splash dialog when dragging and dropping a file 2021-09-06 15:36:28 +03:00
Manolis Papadeas da8bc0d057 Added a "Licenses" tab in the About menu, which displays Pixelorama's license as well as the software it depends on, such as Godot 2021-09-05 01:07:12 +03:00
Manolis Papadeas 37916b63ca Update the minimum value of the zoom level spinbox on project change 2021-09-04 16:59:23 +03:00
Manolis Papadeas 47b20ff5c3 Fix the canvas preview having incorrect zoom when switching between projects 2021-09-04 15:32:44 +03:00
Manolis Papadeas e4ba665c2a Always display the close button in tabs and let users close projects other than the current 2021-09-01 18:07:36 +03:00
Variable fb93143906
Dialog improvements (#530)
* Dialog Improvements

Preview now scales with resizing Dialog
2021-08-31 05:38:11 -07:00
Variable 32dc69fee6
Guide corrections (#528)
* Fixed guide size
2021-08-30 15:00:04 -07:00
Variable 75059b5b12
Selection fixes (#527)
* Fix for multiple cel selection issue

Now it will only apply selection to the selected cels that are **visible and unlocked**

* Fix for loss of selection data

This will hopefully fix the selection data loss on toggling layer buttons
2021-08-30 03:24:48 -07:00
Jeremy Behreandt c29254c2e8
DrawingAlgos Explicit Project DataType (#526)
I needed to add the data type to project for the scripts to compile.
2021-08-29 15:59:05 -07:00
Manolis Papadeas 680ab481f3 Don't transform content if layer is locked or invisible 2021-08-30 01:22:13 +03:00
Variable ab18e8bdb6
Transparency updates (#525)
* Update with theme instead of only value change

instantly updates with theme (old version updated on value change only)

* shortened some paths
2021-08-29 10:19:08 -07:00
Manolis Papadeas 3482314971 Fix project's selection bitmap having incorrect size when importing a pxo 2021-08-29 16:26:01 +03:00
Manolis Papadeas e088820c74 Bump version to v0.9-rc1 2021-08-28 20:01:05 +03:00
Manolis Papadeas 79e1ab5e61 Remove unneeded Global.update_hint_tooltips() call 2021-08-27 00:49:01 +03:00
Variable ddc69b8282
Editable zoom (#523)
* editable zoom change 1

* editable zoom change 2

* editable zoom change 3

* editable zoom change 4

* editable zoom change 4 part b

added upper limit automation for zoom
2021-08-26 14:23:51 -07:00
Manolis Papadeas 4e51b7211e Made the palette comments TextEdit a big taller 2021-08-26 05:00:05 +03:00
Manolis Papadeas 2518f72319 Fix Select by Color not working properly on non-square canvases 2021-08-25 16:43:04 +03:00
Manolis Papadeas a3f8c960ab Change the FPS value in the spinbox when loading a project in an empty project 2021-08-25 16:37:09 +03:00
Manolis Papadeas 180c775b72 Disable per pixel transparency for OSX
As a temporary workaround for #491
2021-08-24 17:34:58 +03:00
mrtripie de28a9d68e
Shading Tool Hue Shift Fixes + Tweaks (#522)
* Fixed issues with Shading tool Saturation and Value not always being right in Hue Shading mode

* Shading tool hue shifting fixes and tweaks

Co-authored-by: MrTriPie <MrTriPie>
2021-08-23 07:04:52 -07:00
Manolis Papadeas ed45c86649 Remove unused variables from Shading.gd 2021-08-21 17:00:37 +03:00
mrtripie c196a32ebc
Fixed issues with Shading tool Saturation and Value not always being right in Hue Shading mode (#519)
Co-authored-by: MrTriPie <MrTriPie>
2021-08-19 06:49:14 -07:00
Manolis Papadeas 58b1da41a1 Fix hue shifting brightening and darkening on colors between yellow and purple
By yellow and purple I mean hue 60 and hue 270 respectively
2021-08-18 21:53:42 +03:00
Manolis Papadeas e7f8417d0d Subtle toolbar UI changes 2021-08-18 20:13:56 +03:00
Manolis Papadeas 147a08f28b Use outlines textures for tool cursor icons
Instead of using the AutoInvertColors shader
2021-08-18 15:06:10 +03:00
Manolis Papadeas 3dfd597de4 Fix shading tool not working properly with multiple selected cels 2021-08-18 14:42:26 +03:00
Martin Novák 9ef7818c77
Tweak UI to use less empty space (#514)
* Tweak right side panels to use less empty space

* Add fake grabber to tools panel. Add a bottom margin. Fix a few issues with resizing.

* Fix tallscreen mode. Set a bit smaller animation timeline min height.

* Change Preferences visibility settings

* Update Main.tscn

* Fix crash when changing to tallscreen and then switching themes

Co-authored-by: Manolis Papadeas <35376950+OverloadedOrama@users.noreply.github.com>
2021-08-16 16:56:19 -07:00
Martin Novák b95496c57d
Fix dialog sizes (#512) 2021-07-30 16:05:50 -07:00
Manolis Papadeas 4292fcc51f Change behavior of selection quick-copy (Ctrl+Alt+mouse movement)
It should now keep the same image data until the transformation gets confirmed
2021-07-31 02:03:51 +03:00
Manolis Papadeas 06bd56866d Change selection shortcuts: Alt is now used to only move selection and Ctrl+Alt makes a quick copy of the selected content 2021-07-29 16:15:02 +03:00
Manolis Papadeas 1d20295f7d Keep images unlocked after editing them - Should close #331
Not sure if this actually solves the issue or just makes it more rare, but I haven't been able to reproduce any PoolVector locking issues so far. The problem was that images were remained locked essentially all the time, which seemed to cause issues. Maybe other PoolVectors could not get locked?
2021-07-25 21:49:37 +03:00
Manolis Papadeas 68cbf4cfb3 Remove unused method in Draw.gd
Global search for "restore_image" doesn't return anything, so I assume it's unused
2021-07-24 18:42:07 +03:00
Manolis Papadeas ef133f4f71 Fix issue where Cel's image setter was not being called 2021-07-24 18:17:44 +03:00
Manolis Papadeas 65051f0910 Bring back the image_changed setter of the Cel class
Caused issues when importing files
2021-07-22 16:33:20 +03:00
Manolis Papadeas c6a056bba6 Made cloning frames create linked cels if the linked cel button is toggled on - suggestion of #402 2021-07-22 03:10:00 +03:00
Manolis Papadeas 57bb7929df Fixed issue with linked cels where, if you had linked cels in one layer and then linked more cels of the same frame in another layer, their previews did not update automatically
Cel's image_texture was being reset due to the creation of new Cel instances in CelButton.gd (line 113)
2021-07-22 02:25:00 +03:00
Manolis Papadeas 9bec8f1b09 Preload more resources
Had to remove references to Brushes and Patterns classes from BrushesButton.gd and PatternButton.gd due to GDScript's cyclic reference bug
2021-07-21 18:29:52 +03:00
Manolis Papadeas 763a063de7 Made brushes work with the shading tool 2021-07-21 02:19:46 +03:00
Manolis Papadeas 0d5e9ce48a Fix crop image crashes on Windows and maybe also fixed buggy behavior?
Cropping images seem to be working fine now, or at least I haven't encountered any bugs so far
2021-07-21 01:24:39 +03:00
Manolis Papadeas 353702ebc4 Make top bar shape-related text disappear after shape has been drawn with the shape tools 2021-07-21 00:45:57 +03:00
Manolis Papadeas 28b8e000f9 Rewrite the crop image method
Should be a bit faster, but I still get weird bugs at random
2021-07-20 22:06:18 +03:00
Manolis Papadeas d0433bed6f Preload layer and cel button nodes in Project.gd
Just a minor optimization to avoid unnecessary loading
2021-07-20 21:03:15 +03:00
Manolis Papadeas 2c90991482 Closes #509 2021-07-18 14:28:33 +03:00
Manolis Papadeas 6de6c4b800 Closes #506 2021-07-14 18:06:07 +03:00
Manolis Papadeas a40203e5cc Bucket flood fill no longer affects separated selected parts of the canvas 2021-07-11 20:20:37 +03:00
Manolis Papadeas ad4b377bc8 Only click the layer button with the left mouse button 2021-07-10 05:19:09 +03:00
Manolis Papadeas 983d14c0d1 Fix deleting content not working with undo 2021-07-09 12:59:01 +03:00
Manolis Papadeas 55c5688f16 Fix changing cel opacity calling project.frames_changed()
It shouldn't happen
2021-07-09 03:38:06 +03:00
Manolis Papadeas 240e582070 Shape tool blue indicators now reflect their proper shape 2021-07-08 22:26:32 +03:00
Manolis Papadeas 873e2b8e9e The indicator's size of the shape tools should now change depending on the tool's thickness 2021-07-08 21:48:47 +03:00
Manolis Papadeas 2760049cfd Fix content transformation not getting confirmed when changes were done to frames and layers
Also fixes issue where frame/layer copying does not copy the transformed data
2021-07-08 20:46:56 +03:00
Manolis Papadeas 7b343cc30f Fix width and height fields in the create palette dialog that used to remain disabled when the dialog appeared again 2021-07-07 18:32:37 +03:00
Manolis Papadeas a46f21265e Update CHANGELOG & AboutDialog 2021-07-06 14:03:41 +03:00
Manolis Papadeas 0bcb65db62 Update AboutDialog.gd 2021-07-05 19:32:12 +03:00
Manolis Papadeas 4b191139f6 Fix timeline's resize grabber not responding immediatly
It seems that the Canvas-Timeline SplitContainer's split offset had a hardcoded value
2021-07-04 16:09:21 +03:00
Manolis Papadeas cd811d7e78 Fixed issue where "Layer 0" would be renamed when it changed position 2021-07-04 15:29:44 +03:00
Manolis Papadeas 9234005d1a Minor drawing optimization 2021-07-01 18:14:49 +03:00
Manolis Papadeas 43bd054df6 Update translations
Hopefully the final translations for 0.9?
2021-06-30 00:01:39 +03:00
Manolis Papadeas c71d371c8c Change shortcuts of the new tools 2021-06-28 21:52:45 +03:00
Manolis Papadeas 21e2cd6bd0 Dragging and dropping frames to re-arrange them no longer makes selected_cels empty 2021-06-27 18:15:06 +03:00
Manolis Papadeas 98d41fca14 Remove Global.find_node_by_name()
Use the built-in find_node() method instead.
2021-06-26 14:01:07 +03:00
Manolis Papadeas e4aff633bb Change "Current cel" strings to "Selected cels"
Because now we have the ability to select multiple cels
2021-06-25 17:58:41 +03:00
Manolis Papadeas 02278e5fee Fix crash when importing a new project on an empty project 2021-06-24 20:32:30 +03:00
Manolis Papadeas f5d07e660d Do not clear content from selection in selected cels when moving if Alt has been pressed beforehand
This is about Alt + mouse click when moving a selection. See https://github.com/Orama-Interactive/Pixelorama/issues/129#issuecomment-756799706 for more info
2021-06-23 20:38:17 +03:00
Manolis Papadeas 5b74a4292d Fix pasting not working properly on multiple selected cels 2021-06-22 01:46:52 +03:00
Manolis Papadeas db0799bc12 Added Ukrainian 2021-06-21 00:24:39 +03:00
Manolis Papadeas ac631e3e3d Transform selected content of multiple selected cels
Does not work with rotation. It might be a good idea to replace this whole system with one that uses a transformation matrix, to handle rotation and skewing more easily in the future. I'm not a huge fan of this current code.
2021-06-19 19:29:32 +03:00
Laurenz Reinthaler a899d2591d
Use CMD+Shift+H for showing the pixel grid on OSX (#494)
Co-authored-by: Laurenz Reinthaler <reinthalerlaurenz@gmail.com>
2021-06-15 13:03:19 -07:00
Manolis Papadeas 18592ed7c0 Minor UI changes 2021-06-15 01:03:46 +03:00
Manolis Papadeas 79b37a95b3 Fix palette importing not including all colors if they have more than 64 colors 2021-06-14 20:38:46 +03:00
Manolis Papadeas 791e966a71 Update Previews on all mouse events 2021-06-14 19:21:58 +03:00
Manolis Papadeas bdd06d42ce Added tool button size option in the Preferences 2021-06-14 02:14:31 +03:00
Manolis Papadeas 20f5a063fd Get palette colors from all selected cels 2021-06-13 18:27:48 +03:00
Manolis Papadeas de850ce8a1 Ability to select multiple cels and edit them all at once
A rather significant change, so, while I have tested it, it might still be buggy. Implements a part of #306.
2021-06-12 01:06:13 +03:00
Manolis Papadeas 73cce5b740 Set frame delay's min value at 0.01, does not let it become 0 2021-06-11 22:56:38 +03:00
Manolis Papadeas feece75935 Added Norwegian Bokmål 2021-06-11 19:38:34 +03:00
Manolis Papadeas 88e95ce35f Very minor code cleanup in 4 tools 2021-06-09 17:31:58 +03:00
Manolis Papadeas f1ea8e30b2 Fix animation tag spacing 2021-06-09 17:17:53 +03:00
Manolis Papadeas fd8b6b7385 Don't call Project.frame_changed() twice at the beginning 2021-06-07 20:05:50 +03:00
Manolis Papadeas e9bf310934 Implement layer and frame dragging and dropping to re-arrange them in the timeline
Part of #306
2021-06-06 02:19:34 +03:00
Manolis Papadeas 1a87321437 Added a Delete option in cel's right click menu
Delete doesn't actually delete a cel, it just clears its contents. Maybe renaming it to something else would be a good idea.
2021-06-05 13:38:32 +03:00
Manolis Papadeas e7a5b45536 Clicking on a layer button now selects the layer. Double clicking it allows renaming 2021-06-05 03:06:07 +03:00
Manolis Papadeas ecd08ce132 Add a right click popup menu on the frame buttons and move most of the frame related options there
These options used to be on the right click popup menu of the cel buttons. Now, cel options only contain Link/Unlink Cel, for now.
2021-06-05 02:37:33 +03:00
Manolis Papadeas 39b0baca84 Frame numbers in the timeline above the cels are now clickable buttons 2021-06-05 02:11:22 +03:00
Manolis Papadeas a4c9e0e8dd Use AutoInvertColors shader for the cursor tool icons 2021-06-05 02:01:04 +03:00
Manolis Papadeas a67855a7f2 Fix RestoreDefaultButton having an alpha value of 0.5 2021-06-04 22:13:48 +03:00
Manolis Papadeas ec1b29eb5e Let the user change icon colors regardless of theme 2021-06-04 21:44:05 +03:00
Manolis Papadeas 12ce12a292 Replace button icons with single-color textures that change color automatically depending on the theme
There is no longer any need for having specific graphics for each theme, as white colored textures can change their modulation to any color.
2021-06-03 22:42:08 +03:00
Manolis Papadeas fd45344e6b Escape cancels polygon selection making 2021-06-02 03:33:19 +03:00
Manolis Papadeas 489749e305 Fix division by zero crash 2021-06-01 18:43:23 +03:00
Manolis Papadeas 5e1c9dc73b Fix bug where you couldn't resize the selection after pasting 2021-06-01 18:19:16 +03:00
Manolis Papadeas 64e9d14a0e Use Texture resources instead of Image for tool cursor icons 2021-05-31 21:39:33 +03:00
Manolis Papadeas ed229565ad Resize selection with gizmo from center by holding Control after clicking 2021-05-31 03:04:10 +03:00
Manolis Papadeas 2a9420700b Fix image effect preview background not keeping its aspect ratio 2021-05-30 19:20:56 +03:00
Manolis Papadeas 207b3a5630 Update ShaderEffect.gd 2021-05-30 17:42:50 +03:00
Manolis Papadeas 43e733fe65 Fix Move tool's snap to grid movement and take grid offset into account 2021-05-28 17:43:50 +03:00
Manolis Papadeas 6d2f02b782 Let the user change border color and toggle the marching ants effect in the preferences 2021-05-28 03:46:16 +03:00
Manolis Papadeas 5a93af7477 Fix palette highlight not being shown over the selected swatch 2021-05-27 03:14:19 +03:00
Manolis Papadeas 1e6460e439 Keep colors of a palette if the width gets bigger and the height gets smaller 2021-05-26 15:48:26 +03:00
Manolis Papadeas bd84fbbe39 Rename the Lighten/Darken tool to Shading tool 2021-05-26 02:17:49 +03:00
Manolis Papadeas bd085786d5 Fixed issue when pasting and the clipboard image is empty 2021-05-25 22:50:35 +03:00
Manolis Papadeas a77cc05446 Made brush creation from selection a separate menu option
Also works with Ctrl+B. Copying no longer creates a project brush.
2021-05-25 22:48:37 +03:00
Manolis Papadeas 950f075269 Fix resizing palette issue
Having one dimension less than 8 and one higher than 8 caused issues. This should now be fixed.
2021-05-25 14:24:30 +03:00
Manolis Papadeas 4e8acdf002 Updated Translations.pot and some tool hint tooltips 2021-05-25 02:51:10 +03:00
Variable 0257adb97b
Set project name (#490)
* Set project name. Also fixed a bug

Added ability to set project name also fixed a bug that "if the aspect ratio button is pressed and a template of different width and height were selected, then the button also applied on them e.g a template of (but it shouldn't)"
Example: write 1 in width, 2 in height, enable aspect ratio, and then try to change template... a template of 256x240 will give 120x240

* Add files via upload

* Adjust save name to project name

* Add files via upload
2021-05-24 07:03:56 -07:00
Variable 62dc608eea
"Fill inside" option in pencil tool (#489)
I modified some code from  "EIRTeam/Pixelorama" and merged it with pencil tool.
2021-05-23 14:58:19 -07:00
Manolis Papadeas 1b286a95ab Optimize AutoInvertColors shader
Not sure if that single if statement counts as branching code, but it's generally a good idea to avoid if statements in shader code, so I used step instead.
2021-05-22 16:08:11 +03:00
Igor Santarek c5d1e3b52b
Fix for #341. :) (#488) 2021-05-21 15:55:06 -07:00
Manolis Papadeas 5b6f4ebe3e Added Polygon selection tool
Cursor icon is temporary. It works by clicking multiple times on the places you want to create edges, and to complete the polygon you either have to click at the first edge (if you hover the mouse, a circle appears in that position), or you can auto-fill by double clicking.
2021-05-18 01:56:55 +03:00
Manolis Papadeas de649c2057 Simplified AutoInvertColors shader 2021-05-17 03:08:25 +03:00
Manolis Papadeas 6499c0d3d5 Auto invert preview colors based on the screen color
Basically, when the background color of the screen at certain points is dark, the preview at that spot is white, and when it is bright, the preview is white at that spot. This helps to keep the previews always distinguishable, regardless of the background color.
2021-05-17 02:24:49 +03:00
Manolis Papadeas 61e7633365 Optimize Lasso tool's draw_preview()
Do not have it run when we're not creating a selection
2021-05-16 18:55:34 +03:00
Manolis Papadeas b8d055fe01 Added lasso / free select tool
Temporary icon, probably. Should work without problems, but more testing would be nice.
2021-05-16 03:52:13 +03:00
Manolis Papadeas 909f9480cc Correct rectangular and elliptical selection mirroring 2021-05-16 03:19:49 +03:00
Manolis Papadeas d13c5c1063 Added ellipse selection tool
Icons most likely temporary. A bit problematic when the selection is in negative coords and the preview does not work well with mirroring and mirror view. Same is true for the shape tools.
2021-05-14 03:48:33 +03:00
Manolis Papadeas 6b9f860618 Fix brushes being drawn flipped horizontally
My bad!
2021-05-13 21:50:55 +03:00
Manolis Papadeas b28e89e5c4 Users can now resize the left tool bar
Useful since the number of tools has started to grow a lot, and some monitors may not have enough vertical space for all of them.
2021-05-13 01:15:11 +03:00
Manolis Papadeas 336594272c Fix selection resizing issue after having moved the content first 2021-05-12 16:27:35 +03:00
Manolis Papadeas 1827381439 Remove unnecessary image.lock() lines 2021-05-12 15:51:31 +03:00
Manolis Papadeas e8b36bbc61 Fix symmetry guide crash when opening pxo files
Related to the PoolVectorArray locking issue (#331). This still doesn't fix the issue itself, but at least Pixelorama does not crash anymore. It is still possible, though, to fail to load a guide when opening a project. Opening it again may solve the issue.
2021-05-12 15:35:20 +03:00
Manolis Papadeas 99ce07b3ab Added a new line tool
One of the most requested tools has finally been added!
2021-05-12 04:35:20 +03:00
Manolis Papadeas 36652c6b56 Update a palette string 2021-05-11 21:03:11 +03:00
Manolis Papadeas 9e7de0022e Change strings of the select menu 2021-05-11 19:48:16 +03:00
Manolis Papadeas 0b9eb2bbed Change the project's name before saving the pxo file 2021-05-11 14:51:14 +03:00
Manolis Papadeas 1b80100588 Stop movement if content transformation has been confirmed while content is being moved 2021-05-11 04:41:30 +03:00
Manolis Papadeas 969b096efc Alt + mouse click when resizing with gizmos now works as intended when there is an active transformation occurring 2021-05-11 04:15:42 +03:00
Manolis Papadeas 47e83d7163 Added UndoRedo support for selection transformations for tool options and fixed resize content behavior 2021-05-11 00:27:57 +03:00
Manolis Papadeas c859834f7c Fix crash when deleting a frame or layer and there is a transformation occurring 2021-05-10 22:34:40 +03:00
Manolis Papadeas 24da4bd703 Fix selection resizing not keeping the original bitmap after gizmo release 2021-05-10 19:59:55 +03:00
Manolis Papadeas e86dde2fb5 Do not require confirmation when transforming a selection with invisible contents 2021-05-10 18:44:12 +03:00
Variable 729c3ae1af
Tall wide screen corrections (#478)
* a minor visibility change.

made the nodes that were not needed in wide-screen "Invicible"
the visibility will now be controlled procedurally

* Added some lines of code in "change_ui_layout()"

The added lines will control node visibility changes to adjust to current screen mode

* added a line to fix tall-screen "zen-mode"
2021-05-10 08:05:15 -07:00
Manolis Papadeas 70d5fad9fd Make selection tool options not editable when there is no selection 2021-05-09 00:56:23 +03:00
Manolis Papadeas 6adb01aac1 Cursor shape no longer changes when a gizmo is being dragged and the mouse cursor goes above another gizmo 2021-05-08 16:06:02 +03:00
Manolis Papadeas 9b54f8a387 Resize selection without contents if Alt is pressed before clicking on a gizmo 2021-05-08 03:54:32 +03:00
Manolis Papadeas 3876c97674 Resizing gizmos with Shift keeps the aspect ratio of the selection
This was harder to implement than I thought. It may need some more testing.
2021-05-08 03:40:28 +03:00
Manolis Papadeas 356ddc0038 Implement moving selections with arrow keys
Moves selection with contents by default.
Control + arrow keys = Moves & snaps selection to grid.
Alt + arrow keys = Moves the selection itself without the contents.
2021-05-07 04:33:28 +03:00
Manolis Papadeas e75b6e7d67 Made Rectangle Selection and Magic Wand tools work with symmetry 2021-05-04 21:26:04 +03:00
Manolis Papadeas ea8bfcd25d Remove drawn_rect from Selection.gd and use draw_preview() in RectSelect.gd instead 2021-05-04 19:26:06 +03:00
Manolis Papadeas 5f84629144 Update AboutDialog.gd 2021-05-04 13:57:40 +03:00
Manolis Papadeas 3db2673309 Prepare for v0.8.3-stable 2021-05-04 13:44:06 +03:00
Manolis Papadeas 6203b3a71c Minor UI changes in the tool options of shape tools 2021-05-04 13:26:07 +03:00
Manolis Papadeas 0ba940c886 Implement snap to grid while moving selections and using the Move tool
Mouse click + Ctrl to snap to grid while moving.
2021-05-04 02:45:14 +03:00
Manolis Papadeas 7cbbf4399d Implement Alt + mouse movement to quickly copy & move selection contents without cutting them from their original position 2021-05-03 21:10:49 +03:00
Manolis Papadeas 20275fc465 Snap movement to axis by holding Shift after mouse clicking
Works with the Move tool and with the Selection tools.
2021-05-03 18:33:51 +03:00
Manolis Papadeas 0a35615c24 Added a displace origin option to Rectangle, Ellipse and Rectangle Selection tools
Works with Mouse Click + Alt. Needs to be documented in the tooltips.
2021-05-03 03:11:12 +03:00
Manolis Papadeas 8f846fe04a Fix out of bounds errors with selection intersection 2021-05-03 03:09:32 +03:00
Manolis Papadeas 3ad3697c84 Fix issue with gizmos not working if the user has moved the selection with contents first 2021-05-03 02:08:53 +03:00
Manolis Papadeas 8f1c6bb3d3 Move selection with contents by default with all selection tools
Now, if you want to move the selection itself without its contents, you have to do Ctrl + Alt + Mouse click. Works the same with all selection tools.
2021-05-03 02:00:07 +03:00
Manolis Papadeas 4a1fcc4ca7 Add position and size as selection tool options
This allows the user to easily move and resize selections
2021-05-01 03:10:23 +03:00
Manolis Papadeas 0b3424be80 Make selection tool scenes inherit from SelectionTool.tscn
Useful for them to be able to share common tool options
2021-04-28 04:00:40 +03:00
Manolis Papadeas 708a1ddc20 Organize the selection tool files in a new folder 2021-04-28 03:06:03 +03:00
Manolis Papadeas b3d581bad4 Create a parent SelectTool script where all selection tools extend from 2021-04-28 02:57:48 +03:00
Manolis Papadeas a7cec3424a Restore project brush creation when copying 2021-04-24 14:50:36 +03:00
Manolis Papadeas 320c538bc3 Add enter and escape as input actions 2021-04-23 23:47:42 +03:00
Manolis Papadeas afd7cc43c9 Rename move_content methods to transform_content 2021-04-23 23:37:07 +03:00
Manolis Papadeas 83d9800fc1 Fix selection being moved by one pixel when being resized & temp_rect has negative size 2021-04-23 19:18:41 +03:00
Manolis Papadeas 4412671a08 Add selection intersection with Ctrl + Shift + Mouse click 2021-04-22 18:12:45 +03:00
Manolis Papadeas ecdf689afd Add 1:1 rectangle tool creation and expanding from click position as its center
Works similar to the rectangle & ellipse drawing tools. Shift for 1:1, Ctrl for expanding from center.

Shift + mouse click = add to selection
Ctrl + mouse click = subtract from selection
Mouse click + Shift = Create a 1:1 (square) selection
Mouse click + Ctrl = Create a selection that expands from center
Mouse click + Shift + Ctrl = Create a 1:1 (square) selection that expands from center

A combination like Shift + Mouse Click + Shift will add to selection while also making a 1:1 selection
2021-04-22 16:45:26 +03:00
Manolis Papadeas 58ef2420c9 Fix issue when resizing selection after moving it 2021-04-22 03:50:16 +03:00
Manolis Papadeas 687f2619a1 Change the order of the top menus 2021-04-22 03:34:04 +03:00
Manolis Papadeas 28cfe9bf77 Got rid of the deprecated enabled_focus_mode
Godot 3.3 has arrived!
2021-04-22 02:11:35 +03:00
Manolis Papadeas dbda57396b Fix selection_offset not being reset to 0 when the bitmap's position is back to positive coordinates 2021-04-21 18:22:43 +03:00
Manolis Papadeas 515e75f3dd Gizmos resizing no longer re-flips the image when temp_rect is negative 2021-04-21 18:16:42 +03:00
Manolis Papadeas b420bebb3e Fix gizmos being able to get edited when there is no selection 2021-04-21 17:35:37 +03:00
Darshan Phaldesai dca76afe17
Shader based invert, desaturate and HSV dialogs (#475)
* Shader based invert, desaturate and HSV dialogs

* Bug fixes
2021-04-21 05:31:33 -07:00
Manolis Papadeas a712f822d7 Fixed bug when copying while moving content 2021-04-21 15:25:17 +03:00
Manolis Papadeas 3852b419dd Image effects will not longer get applied to locked and/or hidden layers. 2021-04-21 00:48:36 +03:00
Manolis Papadeas ea606a072a Make layers uneditable when they're invisible 2021-04-21 00:12:05 +03:00
Manolis Papadeas d70c6a22c4 New tool: Magic Wand (temporary icon) 2021-04-20 15:53:16 +03:00
Manolis Papadeas f1b98f662e Call move_content_confirm() when layers and frames change 2021-04-19 19:55:29 +03:00
Manolis Papadeas 1d5b44fad2 Fix Copy & Delete to work on the currently selected parts of the image
This also fixed a crash when deleting while content is being moved/resized
2021-04-19 19:05:05 +03:00
Manolis Papadeas fccd37360a New tool: Select by Color (temporary icon)
When the user clicks on a pixel, all pixels of the same color are being selected. Shift adds to the selection, Ctrl subtracts. The icon and the hint tooltip are temporary.
2021-04-19 18:50:43 +03:00
Manolis Papadeas dd2bec4c19 Pasting does not directly paste on the canvas, it is now confirmable instead
This lets the user easily cancel the pasting and move just the pasted area around.
2021-04-19 14:39:58 +03:00
Manolis Papadeas baba43d274 Change the way of how tool icon blue-orange backgrounds work
Instead of having a gazillion icons for each tool and its blue-orange variations, which led us to create 4 different textures for each tool, now we only need one texture for each tool and each theme. The blue-orange background has been made into a different TextureRect for each button.

This makes it easier for people to create new tools. Now, each new tool requires 3 textures (to cover every theme), instead of 12(!). I'm hoping to bring the number down to 1 in a future commit, by automating the theme color converting process.
2021-04-18 15:36:08 +03:00
Manolis Papadeas b735bc760f Optimize Project.get_selection_rectangle
It doesn't call bitmap_to_image() anymore.
2021-04-18 15:26:15 +03:00
Manolis Papadeas 38711d2ccf Fix HTML5 shader issue
The MarchingAntsOutline was failing to compile on the Web platform due to the for loop not having constant expressions inside the shader. "Loop index cannot be initialized with non-constant expression"
2021-04-17 22:33:13 +03:00
Manolis Papadeas 27cb0d2d2f
New selection system (#474)
* Basic move tool

* Added marching ants effect on the selection borders

* Rename SelectionRectangle to SelectionShape, make it have non-rectangular shape and multiple SelectionShapes can exist

- Create multiple selection rectangles
- Merge them together if they intersect
- Move the selections (without contents as of right now)
- Gizmos are being drawn but they are not functional yet

Code is very ugly.

* Sort vectors counter-clockwise to be used as polygon borders

I did this, no idea if it works properly, probably won't be used but I thought I'd keep it saved somewhere

* More experiments I may or may not need

Trying to generate a polygon from the individual selected pixels

* Change default rectangle select behavior and ability to clip polygons using Control

* Fix rectangle selection clipping

* Split polygon into two with selection subtracting

* Move selection with contents with the move tool

Code is still a mess, don't bother looking.

* Move some methods from SelectionShape.gd to Selection.gd

The purpose of this is to generalize some selection code, so that it applies to all polygons, the entire selection. More will follow.

* UndoRedo for border moving

Nothing else in the selections system works properly in UndoRedo right now. Needs:

- UR support for creating selections
- UR support for modifying selections (merging and cutting selections together)
- UR support for removing selection
- UR support for moving content

& for all the rest of the remaining features

* Moving all of the selection shape logic to Selection.gd

Handle all of the polygons there instead of having them as individual nodes. Should be easier to handle undo/redo this way. This commit probably breaks move tool + selection tool and undo/redo. Code is still a mess. For your sanity, I hope you are not reading this. I promise I will clean up.

* Move tool works again

Buggy and messy, of course.

* Remove unneeded code and restore selection move undoredo logic

* Made Selection.gd have one big preview_image for when moving content, instead of each polygon having its own image

Could be further optimized for some specific cases. We could also remove selected_pixels from SelectionPolygon.

* UndoRedo support for creating, deleting, merging and clipping selections

UndoRedo support for moving content not added in this commit. Should work but needs more testing. This PR also removes selected_pixels from the SelectionPolygon class.

* Confirm & cancel selection movement, should support undoredo properly too

Press Enter or do any editing to confirm movement, Escape to cancel. I will most likely add UI buttons for confirm and cancel too.

* Mirror View affects selection

* Restore Cut, Copy, Paste and Clear Selection

Pasting now no longer requires a pre-existing selection and instead copies the selections themselves too.

* Created a new Select menu, which has Select All and Clear Selection as options

Clear Selection now also confirms content moving. TopMenuContainer code has changed to no longer rely on Global for the menu buttons.

* Draw gizmos as rectangles

No functionality yet. They may need to be turned to nodes, so that they can easily resize based on zoom level and check for mouse enter/exit events.

* Made gizmos get drawn in the sides and corners of the big bounding rectangle instead of individual selection parts

Still no functionality yet.

* Restore label text

* Minor optimization when clipping selections

This will execute the for loop less times

* Made a Gizmo class, cursor change on hover, has_focus = false on mouse click

Now I should actually make them resize when dragged, aye?

* Very basic gizmo resizing, still a WIP, does not work properly yet

* Start replacing the array of selected pixels with a BitMap

This should optimize the selection making a lot, and it also allows for easy border drawing without having to deal with polygons, thanks to the MarchingAntsOutline.shader

Still commit is still a WIP, image effects and brushes may not work properly yet.

Because the BitMap has a fixed size, the size of the project, moving the selection outside of canvas boundaries has proven to be a bit tricky. I did implement a hacky way of handling it, but it may be buggy and problematic. I'm still unsure whether this is the best way to handle the situation.

* Selection works with mirror view

* Draw a black rectangle when the user is making a rectangular selection

After they release the mouse, the black rectangle becomes the selection

* Make Selection.gd update when undoing/redoing

* Fix brushes not working properly with non-rectangular selections

* Added invert selection

* Cache has_selection as a variable for a speedup

* Fix conflict issues with the shape tools

* Made the bitmap image squared so the marching ants effect will be the same on both dimensions

There may be a better way to fix the issue, perhaps inside the shader itself.

* Some optimizations to call selection_bitmap_changed() less times

* Restored almost all of the image effects

Left to do:
- Change gradient's behavior. Unsure of how it will work with non-rectangular selections yet, but it should not generate pixels outside of the selection.
- Restore rotation
- Resize bitmap on image resize
- Remove the `pixels` array from the ImageEffect

* Fix Selection.gd not updating when changing project

* Resize the selection bitmap along with image resize

* Restored rotation's old behavior and finally got rid of the selected_pixels array

The rotation does not yet work properly with selections, but at least it now "works".

* Resize selection too when using gizmos

Left to do for gizmos:
- Proper cancel transformation
- Begin transformation
(currently named move_content_start but it should be renamed to something more general) when resizing gizmos
- Keep the original image and selection in memory and resize them. Meaning, gizmos should not resize the already resized data, but only resize the original. This is less destructive as there is no danger of data loss.
- Always resize on InputEventMouseMotion. This is going to be worse for performance, but it will look better for the user.

* Image and bitmap resizing now uses the original data and begin transformation on gizmo click

No matter how many times the user resizes on the current transformation, the original data will not be lost until they either confirm or cancel, so there is no data loss before confirmation/cancel.

* Cancel transformation now works properly when the selection has been resized

* Made gizmos resize on mouse motion, fix issues with negative bounding rectangle and when combined with the move tool

* Resizing can now get out of positive bounds, clearing and inverting now gets limited to the canvas bounds

Resizing currently does not work properly with negative (left & up) canvas boundaries

* Flip image when resizing and the bounding rectangle gets flipped

* Call move_content_confirm() when inverting selection

* Attempt to implement selection resizing that goes outside of the canvas boundaries (not working properly yet)

* Flip selection when resizing to negative bounding rectangle sizes

And fix preview_image vertical flipping

* Fix rotation so that it works (almost) properly with selections

Rotation algorithms now accept and only work with a given image, and the pivot has been added as a parameter

* Experimental gizmo rotation - does not work properly yet

Transforming the selection outside of the canvas is still broken.

* Fix some issues with moving selection out of canvas bounds

* Fix more issues with selection getting resized outside of canvas bounds

* Update marching ants effect properly when switching between projects

And make sure the frequency of the marching ants effect always looks roughly the same on all project sizes

* Made the rotation gizmo part of the gizmos array and resize them based on camera zoom

* Remove unneeded parameter from move_bitmap_values()

* Remove more unneeded parameters

* Move the selection only if the cursor is above it and neither shift nor control are currently pressed

* Gradient generation now works on non-rectangular selections

Although this behavior might not be the intended one

* Copy/paste marching ants effect offset

Useful for when the selection is in negative coords

* Fix issue with clear selection & UndoRedo

* Restore the ability to move selection when it's in negative coords

* Made the marching ants offset a Project variable

This fixes the issue of project switching and keeping the previous project's offset. Again, this is only relevant for when the selection is in negative coords.

* Made the "from current selection" palette preset work with the new selection system

* Fix out of bounds error when using the rectangular select tool on negative coords

* Some code cleanup

* Comment out the rotation gizmo for now, since it does not work properly

* Update marching ants shader params and gizmo sizes when the bitmap changes

* Move some methods around in Selection.gd
2021-04-17 11:30:12 -07:00
Manolis Papadeas 0c54470209 Update CHANGELOG & AboutDialog 2021-04-16 22:07:38 +03:00
Manolis Papadeas bcc0d359dc Restored LightenDarken's previous behavior
Fixes a minor issue from 6cce27a360
2021-04-16 21:47:03 +03:00
Manolis Papadeas f321b6d101 Remove paths from Main.tscn from the palette PR 2021-04-16 21:17:23 +03:00
Martin Novák 42696e7b37
Replace old palette system with a new one (#447)
* Replace old palette system with a new one

* Replace default json palettes with new resource versions

* Add missing translation strings

* Fix Erevoid's issues 2, 3 and 4

* Rewrite palette grid to improve performance
Add middle click scrolling

* Fix index conversion functions

* Fix palettes editing by copying them to XDG user write path

* Add Windows specific fixes

* Add import support for old json palette format

* Add create/edit palette settings check.
Hide add/delete color buttons when no palette is displayed.
2021-04-16 11:09:03 -07:00
kevinms 05eda55bc7
Fix hue and saturation getting reset when draging value slider to zero (#473) 2021-04-01 16:13:54 -07:00
Manolis Papadeas 6cce27a360 Do not run update_mask() method if there is no pressure sensitivity option
Major speedup for large images. update_mask() is meant for pen pressure only, so there is no reason to calculate it if we don't have pressure sensitivity enabled
2021-04-01 03:40:35 +03:00
DragonOfWar 943a69c0e3
Add Rectangle and Ellipse tools (#456)
* Add Shapes Tool (WIP)

* Add Alt button + Fill shape + Other stuff

* Add blue theme button textures

* Fix tool not previewing on right button

* Add config functions

* Fix ellipse bug

* Correctly added thickness

* Keep preview with CTRL

* Fix weird PoolVector behaviour

* Make preview follow mouse when pressing CTRL

* Moved shapes class to a separate script

* Update tooltip

* Enable mirrors

* Separate tools + jittery preview fix + more

* Add missing translation

* Add missing icons and keybindings

* Changed shape draw function buttons

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

* Update Main.tscn

* Update CanvasPreviewContainer.tscn

* Update UI.tscn

* tallscreen support - better display scale

* tallscreen support - better display scale

* Update UI.tscn

* Update Main.gd

* tallscreen support - better display scale

* tallscreen support - better display scale

* tallscreen support - alternate panel placement comment-784228607

* tallscreen support - code cleanup

* tallscreen support - color picker swap: comment-785032683

* prettier border

* tallscreen support - color picker

* tallscreen support - pullrequestreview-601156079

* tallscreen support - bugfix & review

Co-authored-by: ballerburg9005 <mathias.steiger@gmail.com>
2021-03-06 05:59:26 -08:00
Manolis Papadeas 35f97ebe6f
Fix issue where the window regains focus and draws immediatly
The issue occurred when the cursor exited the application window very fast while still on the canvas, thus Global.has_focus was still true, then lost focus. When Pixelorama regained focus, it would draw the tool even if the user clicked outside of the drawing canvas.
2021-02-25 07:00:50 -08:00
gamesplease 59862171e9
Add keyboard shortcut for Clear Selection (#457) 2021-02-17 09:53:01 -08:00
Variable f9c275d0a4
"SpriteSheet as layer" and "Replace Frame" import options (#453)
* fixed some more bugs

* Removed some more bugs

* Added "Replace Frame" option

It was originally made to use primarily in "Spritesheet (new layer)" but it thought it could also be useful to put it there as an import option

* Update PreviewDialog.tscn

* Update PreviewDialog.gd

* Update OpenSave.gd

* added import option for SpriteSheet and Frame

Now we can add SpriteSheets in current project and Replace frames in current project

* added functions for SpriteSheet and Frames

I added functions that would allow me to add SpriteSheet as new Layer. I also added an option for "Replace frame" (the function "open_image_at_frame()" is originally being used in "open_image_as_spritesheet_layer()" method but i decided to use it as an import option as well)

* Changed contribution name

* Changed contribution name

* Fixed some lines

* fixed sprite lines not updating
2021-02-07 06:43:44 -08:00
THWLF 45be4ee6b7
Added more standart devices from 8/16Bit era (#450) 2021-02-05 03:05:08 -08:00
Manolis Papadeas d5f8d8e899 Disable Window Transparency in the Web version, update CHANGELOG & Translations 2021-02-02 19:17:56 +02:00
Manolis Papadeas ce7320ad4f Renamed "Base" to "BaseTool" and made it a class 2021-02-02 17:48:17 +02:00
Variable dc469dd4b5
Var transparent mode (#444)
* allowed and enabled per_pixel_transparency

* Added a Transparency menu

* Added an Alternate screen for transparency

* Added transparency methods

Added the transparency methods plus modified fullscreen such that it resets transparency on toggling hence, Removing the issue of blackness

* Modified the shader to allow transparency

* Added a material to ViewportContainer

Fixed the bug that darkens image when decreasing opacity

* Update Global.gd

* Update Main.gd

* Update TopMenuContainer.gd
2021-02-02 07:29:19 -08:00
Manolis Papadeas 40f6a24fdc Made Zoom tool work on the second viewport too 2021-02-01 21:07:09 +02:00
Manolis Papadeas 097367ac45 Added a missing comma on a string 2021-02-01 17:48:28 +02:00
Manolis Papadeas c54b74f829 Having no active selection no longer treats all the pixels of the canvas as selected
A performance boost for when opening large images. Also fixed an issue with pixels being selected outside of the canvas boundaries, when the selection rectangle was outside the canvas and its size got reduced.
2021-01-31 15:09:54 +02:00
Manolis Papadeas 7f1594e1bc You can now resize cels in the timeline by holding Control and scrolling with the mouse wheel.
Addresses part of #306
2021-01-30 23:57:33 +02:00
Manolis Papadeas 77185b5263 Update tile mode rects when importing a project 2021-01-30 20:43:10 +02:00
Manolis Papadeas 5b3b91b247 Fix #445 by NOT replacing empty backups 2021-01-30 20:33:00 +02:00
kleonc 499251f44a
Fix potential index out of bounds error (#446) 2021-01-30 09:30:02 -08:00
Manolis Papadeas 27852b2694 Dragging and dropping individual cels in the timeline to change their position is now possible.
Addresses a part of #306
2021-01-29 22:00:48 +02:00
kleonc 4001a32f2b
Cache tile mode rects (#443)
* Cache tile mode rects

* Make TransparentChecker don't calculate tile mode rect on its own

* Minor fixes

- typo
- formatting
- moved unlock() call to the method where matching lock() was called
2021-01-28 11:21:48 -08:00
Manolis Papadeas 4db21dae95 ScaleImage dialog improvements
It now automatically sets the size to the current project's size, has a button to lock aspect ratio, and resizing based on percentage. Some UI changes to CreateNewImage too.
2021-01-27 00:45:12 +02:00
Manolis Papadeas 6edfbad663 Fixed a bug with the Zoom tool, removed Godot's version check from Tools.gd and updated AboutDialog, CHANGELOG and Translations 2021-01-26 16:34:25 +02:00
Variable eff0adbf21
Var pix centralize (#441)
* Added Centralize Image

* Add files via upload

* Added Centralize Image (fixd some lines)

* Added Centralize Image (fixes some lines)

* Fixed and removed some lines

* Fixed and removed some lines

* Removed unnecessary parameters

* Removed unnecessary parameters

* Update DrawingAlgos.gd
2021-01-26 06:03:38 -08:00
Manolis Papadeas 93bbfabb99 Refactored CreateNewImage dialog and added portrait & landscape buttons from #402
The lock aspect ratio button has been changed from a checkbox to a texture button and the template code has been refactored to use a Template class instead of enums. Only dark icons have been added for now.
2021-01-25 22:07:02 +02:00
Manolis Papadeas 6cb525ad92 Update changelog & AboutDialog 2021-01-23 00:27:28 +02:00
Manolis Papadeas f03dcfe230 Made Pan tool's shortcut change-able, and added missing translations 2021-01-21 01:58:15 +02:00
kleonc 85b0611ca0
Speedup Draw.update_mask() (#439) 2021-01-20 13:29:40 -08:00
kleonc 63838964b3
Renamed enums to follow recommended naming convention (#437) 2021-01-20 06:59:42 -08:00
kleonc eeb97f71e4
One shared offset for rectangular and isometric grids, added "Draw Grid over Tile Mode" toggle (#434)
* One shared offset for rectangular and isometric grids

* One draw call per grid

* Added "Draw Grid over Tile Mode" toggle
2021-01-19 16:17:33 -08:00
kleonc 9c520a65e9
Refactored isometric grid (#430)
* Move get_tile_mode_rect() method to the Project class

* Refactored isometric grid

Now it should be drawn properly in the target rect.
Settings (in pixels):
- cell's AABB size,
- offset from the canvas origin.
2021-01-18 12:59:26 -08:00
kleonc db9980a883
Draw Grid only over Canvas. Added PixelGrid. (#427)
* Draw grid only over the Canvas (when in tiling mode)

* Replace some magic numbers with enums.

It's too easy to break something when adding something new in here. Should be a little harder now.

* Added Pixel Grid.

- Pixel grid is shown only when it's enabled and camera is zoomed close enough.
- Settings: pixel_grid_show_at_zoom (as a percentage because that's what's shown in the settings panel), pixel_grid_color. Default values might need changing.
- To distinguish between grid and pixel grid default settings for grid width, grid height are changed.
- Now both grid and pixel grid are drawn above (after) tile mode. Grid is drawn above (after) pixel grid.
2021-01-16 10:24:46 -08:00
Manolis Papadeas 4da4f4ebb8 If it's trying to load a theme that doesn't exist, default to the first theme
Useful for cases where a user uses a version with a theme, and goes to a previous version where that theme does not exist
2021-01-10 18:20:17 +02:00
kleonc b1c0344d0b
Remove unneeded location variables (#425)
Co-authored-by: kleonc <kleonc@users.noreply.github.com>
2021-01-06 07:11:50 -08:00
kleonc 1b8520c1a9
Select new layer after adding it (#424)
Co-authored-by: kleonc <kleonc@users.noreply.github.com>
2021-01-06 06:18:41 -08:00
Manolis Papadeas 8daacbac5e Added "Performance" tab in Preferences that exposes options related to the application's FPS to the user
This also makes the behavior added in #394 toggle-able.
2021-01-05 20:01:50 +02:00
kleonc c18c705748
Update GUI for Cel.opacity on frame changed instead of on layer change (#420)
It's Cel's property and thus it changes when frame_changed is called (also layer_changed calls frame_changed on its own).

Co-authored-by: kleonc <kleonc@users.noreply.github.com>
2021-01-04 17:12:02 -08:00
kleonc 92a22fe9bc
Fix tiling opacity by drawing currently visible frame to a separate Viewport (#417)
- Now the current frame is drawn to a separate Viewport (with transparent background) taking into account only per layer opacity,
- Tiling is drawn by drawing current frame's ViewportTexture with tile mode opacity applied (using premultiply alpha blending).

Co-authored-by: kleonc <kleonc@users.noreply.github.com>
2021-01-04 09:30:15 -08:00
Manolis Papadeas 5f56cb523f Update copyright statements to present
Happy new year, everyone!
2021-01-03 21:03:20 +02:00
kleonc 9edc0c9bb9
TileMode opacity fix (#414)
Now opacity is multiplicative.

Co-authored-by: kleonc <kleonc@users.noreply.github.com>
2020-12-30 09:56:28 -08:00
Laurenz Reinthaler 2eeadf35a2
Allow greater values than 100 for SpinBoxes in FrameTagDialog.tscn (#408) 2020-12-27 13:05:35 -08:00
Laurenz Reinthaler b9c94e1b12
Resolve conflict with remapping shortcuts (#407) 2020-12-26 11:02:08 -08:00
Laurenz Reinthaler 2a7e668976
Add Pan Tool (#399) 2020-12-23 10:41:42 -08:00
Laurenz Reinthaler 425b11d4b2
Implement undo and redo while holding (#405) 2020-12-22 07:45:17 -08:00
Manolis Papadeas ab583a7354 Fixes #404
Issue #404 not found
2020-12-18 17:22:45 +02:00
Manolis Papadeas 16d2c336e9 Fixed FPS not being updated when Pixelorama first runs 2020-12-17 02:52:13 +02:00
Manolis Papadeas 031efc0cdb Make FPS project-specific and store it in the pxo files 2020-12-17 02:20:47 +02:00
Manolis Papadeas 05c9ef70d4 Put frame duration as a member of the Frame class
Instead of having a frame_duration[] array in the Project class. This makes the code much more readable and understandable, using less lines of code and, by avoiding an extra array, we also avoid potential out-of-bound array crashes.

The functionality for the user has not changed, and by testing so far I didn't find any issues.
2020-12-16 22:54:08 +02:00
Laurenz Reinthaler 329f4edc5c
Improve Cpu Usage while in Idle (#394)
Use focus insted of mouse
2020-12-15 07:30:47 -08:00
Manolis Papadeas 35eeaf4e90 Fixed an issue where Pixelorama crashed when a user coming from a new version to an old one and had selected a tool that doesn't exist in an older version 2020-12-13 21:42:45 +02:00