Commit Graph

9196 Commits

Author SHA1 Message Date
David Capello
400456cbec Right-clicking a tileset mode button gives the possibility to set it as the default one
Feature request: https://community.aseprite.org/t/19487
2023-07-19 11:27:00 -03:00
David Capello
11644a7d16 Add Shift+F7 to toggle other layers visibility on Preview window 2023-07-19 10:56:16 -03:00
David Capello
32009723c5 [lua] Ask for access for package.loadlib() function 2023-07-19 09:15:15 -03:00
David Capello
64369281fa Update laf module 2023-07-18 21:48:44 -03:00
David Capello
890ed91d81 [x11] Disable the native file selector on X11 (#3974)
It looks like the mouse got captured by the Aseprite window if we
start the Zenity command using the mouse in certain way (e.g. when we
click the Open File link from the Home tab). The same doesn't happen
if we press Ctrl+O or click the File > Open menu.
2023-07-18 21:42:49 -03:00
Gaspar Capello
e9f078e66e Fix error decoding pico-8 GIFs (fix #3922) 2023-07-18 20:55:32 -03:00
Martín Capello
242555ab06 Allow changing the tileset assigned to a tilemap layer 2023-07-18 18:50:57 -03:00
Martín Capello
4926f4c1fc Show, duplicate and delete tilesets in Sprite Properties dialog (fix #3875) 2023-07-18 18:50:57 -03:00
David Capello
a2d8a080f5 [lua] Create app.window to access new main window properties (#3927)
We moved the app.width/heigth to app.window.width/height and
app.events.on('resize', ...) to app.window.events.on('resize', ...).
2023-07-18 17:54:57 -03:00
lampysprites
7ee866643b [lua] Add width and height properties to app 2023-07-18 15:50:22 -03:00
lampysprites
30b858d89e [lua] Add "resize" to app events 2023-07-18 15:50:19 -03:00
Gaspar Capello
98366d3dee Fix layer name cell resizing in timeline during gui scaling or theme change. 2023-07-18 15:39:59 -03:00
Gaspar Capello
264cd98ab4 Fix menu items that don't respect UI scale (fix #3843) 2023-07-18 15:39:59 -03:00
Gaspar Capello
081f1e535b Fix ButtonSet widget with icons resizing when UIScale is changed 2023-07-18 15:39:59 -03:00
Gaspar Capello
0c3d78b4ce Fix unexpected behavior during multiple cel selection + cel property changes (fix aseprite/aseprite#3886)
Prior to this fix, if a field was modified, all fields were overwritten with the values from the Cel Properties dialog.
2023-07-18 10:39:13 -03:00
David Capello
daf3e70e9d Fix warning about undefined blend mode conversions
This was added to avoid the "control reaches end of non-void function"
warning.
2023-07-17 19:29:07 -03:00
David Capello
e84bee0f99 Minor changes removing "using namespace doc" from app/color.h 2023-07-17 15:02:15 -03:00
David Capello
86a50e2e9a [lua] Add native API to decode/encode JSON text (fix #3233)
New json.decode(jsonText) and json.encode(luaTable) functions.

In this way we don't depend on third-party libraries to decode/encode
JSON text which is a quite common task (in tests and export scripts).
2023-07-17 09:25:13 -03:00
David Capello
00b75a76a8 Add displayName property for language extensions (fix #3964)
The default language (en.ini) has a new "display_name" property, but
probably we should remove it and transform the English language in an
extension (just as the default Aseprite theme).
2023-07-12 12:25:30 -03:00
David Capello
35e64ad2f3 Fix exporting selection to gif/fli/webp files (fix #3827) 2023-07-11 13:33:45 -03:00
David Capello
bd91a6430f Process os::Event::MouseEnter/Leave in correct order
When we received a MouseEnter/Leave, we were processing those laf-os
events immediately without taking care of all the MouseMove/Down/Up
events in the middle. Now we enqueue all the events as
messages (MouseEnter -> MouseMove/Down/Up -> MouseLeave).

This is important because when we process MouseLeave we are calling
setMouse(nullptr), which resets the mouse widget HAS_MOUSE flag, and
some widgets needs to know if they have the mouse above before the
MouseUp event. With this change we can remove the
Widget::hasMouseOver() function (that was checking the global
ui::get_mouse_position() instead of the HAS_MOUSE flag directly).

Another change was introduced to keep the old behavior now that
hasMouseOver() is not available: the ui::Manager doesn't assign the
HAS_MOUSE flag if the mouse is captured (it only assign the HAS_MOUSE
to the widget with the mouse captured, or to no widget, at least until
the capture is released).
2023-07-10 10:54:37 -03:00
David Capello
48275d51c2 [lua] Add new AfterAddTile event for tile management plugins
Replaced the App BeforePaintEmptyTilemap event (introduced in
c26351712a) with the new Sprite
AfterAddTile event triggered by draw_image_into_new_tilemap_cel().
This new event handles two cases:

1) When the user paints on an empty tilemap cel, a new tile is
   created, so the tile management plugin can handle AfterAddTile
   to know the existence of this new tile.  (This case was disabled
   with fae3c6566c, then handled with
   c26351712a, now handled with this
   patch).

2) When we copy & paste cels (or drag & drop cels) in the timeline
   between layers, if a new tile is created, the AfterAddTile is
   called and the plugin can associate tiles with its internal
   information (e.g. folders)

Related to: https://github.com/aseprite/Attachment-System/issues/135
2023-07-07 18:40:06 -03:00
Martín Capello
9db01bf82f Fix crash accessing theme dimensions/info in a plugin's init() function (fix #3913) 2023-07-06 18:21:36 -03:00
Martín Capello
b0b2fb378e Fix direction reset after scrolling the editor while playing an animation with "ping-pong" direction (fix #3903) 2023-07-06 17:54:06 -03:00
Gaspar Capello
f7bc918926 Fix crash when loading an extension with invalid dithering matrices (fix #3914)
Before this fix, when installing dithering matrices if Aseprite
couldn't find the file of some matrix described in the json, Aseprite
would crash (this happened during the installation of an erroneous
dithering matrices extension, and after every reboot of Aseprite).

The cause of the crash was the absence of the MainWindow instance
during the ContextBar creation. When an error occurs, the console is
called, but since MainWindows is not yet available, aseprite crashes.
2023-07-06 11:07:39 -03:00
TakWolf
3134bfaa30 Remove duplicate string in en.ini and extra whitespace 2023-07-06 10:59:04 -03:00
David Capello
c527d68c64 Fix Assign/Convert button labels in Sprite Properties dialog
Regression introduced in 974c13dd33
2023-07-06 10:36:41 -03:00
Zephyr Lykos
2f6655f57e Fix compilation on GCC13
See: https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes
Bug: https://bugs.gentoo.org/865117
Bug: https://bugs.gentoo.org/895616

Signed-off-by: Zephyr Lykos <self@mochaa.ws>
2023-06-29 14:19:43 -03:00
Martín Capello
204ee881be Prevent executing the logic for showing an alert when removing all sprite's layers and the UI is unavailable 2023-06-27 15:26:11 -03:00
Martín Capello
5bc432f289 Delete unused tilesets after deleting tilemaps (fix #3876) 2023-06-27 15:24:13 -03:00
Martín Capello
872267dc9b Avoid crash if the "New Layer" menu item is configured to ask the layer name 2023-06-27 15:24:13 -03:00
David Capello
556c621eeb Add native file dialog for Linux using zenity (fix #1953, fix #2354)
The Zenity utility is not perfect, there are several issues to improve
the UX, but it's good enough to offer a native file dialog on Linux
without depending on huge dynamic GUI libraries (GTK+, Qt, etc.).
2023-06-27 14:28:32 -03:00
Akylzhan
3e171d0f6a Change ColorEntry base to ExprEntry to support math expressions (fix #3900) 2023-06-23 13:11:07 -03:00
Gaspar Capello
da90a57ce0 Fix selected image is modified by moving the pivot point in certain positions (fix #3901)
Prior to this fix, there was a spurious movement on a selected image
simply by moving the pivot point. Steps to reproduce it:

- Select a canvas area
- Zoom at 300%
- Make the pivot visible and move it to a negative coordinate
  position (less than the origin 0,0)
- If you rotate/skew the image this problem cannot be reproduced
2023-06-14 12:04:00 -03:00
Gaspar Capello
a628bbb58b Fix changing brush size w/drag value when multiple editors are opened (fix #3884)
This fixes unnecessary propagation of kKeyDownMessage/kKeyUpMessage
messages across all open editors. The pressed key should be sent to
the active editor or the one with the mouse over it.
2023-06-06 10:02:37 -03:00
David Capello
fc24613b81 Add compatibility check for future tilemaps w/unsupported tile formats 2023-06-01 13:02:35 -03:00
David Capello
5c41d96db3 Reword notes about compressed data in .aseprite specs (fix #3897) 2023-06-01 11:38:03 -03:00
David Capello
2f54bcaf37 Fix crash (using freed memory) changing Screen/UI Scaling/Theme for a very specific ColorBar/PaletteView case (fix #3906)
We were able to reproduce this putting the black border of the
ColorBar's PaletteView touching its viewport, and changing from Screen
Scaling=200% & UI Scaling=100% to Screen Scaling=100% & UI
Scaling=200% (with the memory sanitizer on).
2023-05-31 14:57:37 -03:00
David Capello
fa79619c16 Update clang-format file 2023-05-24 14:23:42 -03:00
David Capello
637d71a276 [lua] Test Image:flip() with sprite and without sprite (#3854) 2023-05-18 13:20:41 -03:00
David Capello
ccc57800a8 [lua] Add support to use app.sprite = nil 2023-05-18 13:20:10 -03:00
David Capello
a98ad46a55 Use the existent doc::algorithm::FlipType instead of a new app::script::FlipType 2023-05-18 13:14:50 -03:00
Gaspar Capello
f3ed22e1a6 [lua] Add Image:flip() 2023-05-18 13:02:07 -03:00
David Capello
66ac837305 Fix brush and pasted image preview on empty cels (fix #3882)
Fix regression introduced in 24846eae10
using the new RenderPlan structure. We have to include empty/nullptr
cels in the plan to paint the preview image in the selected
layer/frame (the preview image is the one used for the brush preview,
and for the transformation preview when we paste the clipboard content
on the canvas).
2023-05-18 12:56:09 -03:00
David Capello
da70dd3892 Increment scripting API version 2023-05-18 12:42:35 -03:00
David Capello
c26351712a [lua] Add new 'beforepaintemptytilemap' app event
Now a tileManagementPlugin can customize the creation of empty tiles
when the user starts drawing on an empty cel.

To implement: https://github.com/aseprite/Attachment-System/issues/119
Related to: https://github.com/aseprite/Attachment-System/issues/127
2023-05-18 12:40:12 -03:00
David Capello
d329f38075 [lua] Add stopPropagation function to the beforecommand event
Related to:
https://github.com/aseprite/Attachment-System/issues/121
https://github.com/aseprite/Attachment-System/issues/127
2023-05-18 11:49:04 -03:00
David Capello
961dee4354 [lua] Add 'beforecommand' and 'aftercommand' app events
This will allow to implement custom horizontal/vertical flip:
https://github.com/aseprite/Attachment-System/issues/121

Related to:
https://github.com/aseprite/Attachment-System/issues/127
2023-05-18 11:29:23 -03:00
David Capello
63592f3e04 Update laf 2023-05-18 09:34:05 -03:00
David Capello
d5406cbc55 Fix bug reading UUID property from backup data/undo data 2023-05-17 12:36:17 -03:00