Commit Graph

1413 Commits

Author SHA1 Message Date
David Capello
534163ae5f Fix painting issues in the debugger filling the line number column correctly 2021-10-25 17:40:12 -03:00
David Capello
1e57cd267d Merge branch 'main' into beta 2021-10-13 10:42:20 -03:00
David Capello
6dd128d637 Add main_area in debugger window to show only the buttons initially 2021-10-13 10:35:55 -03:00
David Capello
d077900fe5 Merge branch 'main' into beta 2021-10-13 10:15:39 -03:00
David Capello
212e9fbe6c New initial Lua debugger version (#1967)
Incomplete version of the Lua debugger.
Some available features:

* Break in next executed instruction
* Step in, over, out
* See & navigate stacktrace
* See local variables

Some missing features:

* Breakpoints
* Eval user expressions with local variables

The UX needs some improvement yet.
2021-10-12 16:52:14 -03:00
David Capello
f318a42f19 Merge branch 'main' into beta 2021-09-29 10:16:02 -03:00
David Capello
364f62ee4a Merge branch 'sentry' (fix #2857) 2021-09-23 21:09:27 -03:00
David Capello
0c604ca4ba Ask for consent to share crash data 2021-09-23 15:22:26 -03:00
David Capello
775e8f86be Merge branch 'main' into beta 2021-09-23 09:19:23 -03:00
David Capello
515952cf32 Enable Fill/Stroke commands when !ENABLE_UI 2021-09-23 09:18:14 -03:00
David Capello
5f9b6f494a Merge branch 'main' into beta 2021-09-22 17:54:57 -03:00
Gaspar Capello
83c18399a4 Fix incorrect cropping rectangle calculation in canvas size command in lua script
Prior to this fix, CanvasSize command via lua script results in bad canvas and image clipping.
2021-09-22 17:40:29 -03:00
David Capello
9e10a1c82c Merge branch 'main' into beta 2021-09-06 18:30:45 -03:00
David Capello
845f275ae7 Enable cycling colors when palette size=1 so RGB/HSV colors are converted to index=0 anyway
In this way after ChangeColor command to increase/decrease an index is
used, we always got an index selected (even index=0 if palette size=1)
2021-09-01 10:38:35 -03:00
David Capello
adc9c109da Merge branch 'main' into beta 2021-08-31 09:06:09 -03:00
Jeremy Behreandt
edb9f89456 Cyclic Color Change in Palettes
Made Change Color: Increment/Decrement Foreground/Background methods cyclic instead of clamped. At last palette element, incrementing selected color returns to first element. At first palette element, decrementing color returns to last element.
2021-08-31 01:10:18 -05:00
Joshua Ogunyinka
f85f24e847 fixed restoring grid preference on undo/redo (fix #2872) 2021-08-28 08:54:00 +04:00
David Capello
a5b41d2630 Merge branch 'main' into beta 2021-08-19 10:34:32 -03:00
David Capello
341408e902 Don't crash when saving palettes to .jpg format (fix #2654)
Now .jpg is not even show in the list of available format to save
palettes (same for other file format that don't support indexed color
mode).
2021-08-18 13:03:38 -03:00
David Capello
22a5c4c324 Merge branch 'main' into beta 2021-07-09 10:47:16 -03:00
David Capello
5a6bd465f5 Cache mouse cursors to avoid re-generating them on each setCursor()
This should improve the mouse movement, where a new mouse cursor was
created on each mouse movement with black & white pixels. It's a
regression introduced in ef4f691459
(which was originally introduced to improve the mouse movement
perception in a 100Hz monitor).

This might be a possible fix for:
https://github.com/aseprite/aseprite/issues/2713
2021-07-09 10:21:16 -03:00
David Capello
8f838ba36d Backport FullscreenMode command (#464)
Original from ae02600a63
2021-07-05 20:11:46 -03:00
David Capello
c42c5e1453 Backport new laf API to main branch of aseprite
Some features from the beta branch of aseprite & laf were backported
to the main branch of aseprite.

Related commits:
- New memory handling (db4504e816)
- New get event with timeout (e6ec13cc31)
- Convert os::NativeCursor to an enum (06a5b4f3ae)
- Adapt code to the new os::Display -> os::Window refactor (5d31314cdb)
- Save/load main window layout correctly and limit to current workarea (d6acb9e20f)
- Redraw window immediately on "live resizing" (d0b39ebade)
2021-07-05 17:51:29 -03:00
David Capello
66e77a7e49 Merge branch 'main' into beta 2021-06-29 21:15:57 -03:00
David Capello
f99b5218b9 Remove unused code from ReplaceColor command
The original intention was to save selected colors in the Replace
Color dialog so then showing up it again would restore those saved
color. But it never worked in that way and just by mistake it was
using the Foreground/Background pair of colors by default (which is
the desidered behavior now). So we are just removing the buggy code
that never worked. (Related to #2028 in some way.)
2021-06-29 16:31:51 -03:00
David Capello
e73d96262d Always use Foreground color in Select > Color Range (fix #2028) 2021-06-29 16:26:48 -03:00
David Capello
78abaf0292 Minor change in MaskColor add ConfigSection constant 2021-06-29 16:23:56 -03:00
David Capello
9609d2c827 Fix crash if we press F5/reload menus when we have a menu open (fix #2496) 2021-06-28 21:13:56 -03:00
David Capello
9f300bf55d Better handling of Cel Properties for multiple cels 2021-06-11 11:04:52 -03:00
David Capello
a4e7ac13c1 Fix crash in Cel properties dialog when range is enabled & active cel is empty 2021-06-11 10:45:49 -03:00
David Capello
fb88a5c1f1 Message::setPropagateToChildren() receives a bool argument 2021-06-07 17:17:18 -03:00
David Capello
eec9ed0bcc Fix a couple of minor leaked ui::Messages 2021-06-07 15:20:45 -03:00
Gaspar Capello
5f48d77786 Add octree quantization algorithm supports alpha channel
Before this commit, Octree wasn't support alpha channel.
Also the automatic quantization algorithm selection was removed because Octree support alpha channel now.
2021-06-04 10:06:06 -03:00
David Capello
a3f9143cbe Don't ask to adjust the Screen Scaling
For the default theme it makes sense (and maybe for most theme
variants it will make sense to avoid adjusting the screen
scaling). But maybe other themes will want to adjust the scale
automatically when choosing the variant.
2021-05-22 00:46:01 -03:00
David Capello
c99000a2c3 Add theme variants to switch easily between Light/Dark themes 2021-05-22 00:42:36 -03:00
David Capello
e7f0832ff3 Fix setting color space of all os::Windows 2021-05-21 21:44:30 -03:00
David Capello
2bc64cf5ff Add PalettePicks::invert() member function 2021-05-20 17:57:22 -03:00
David Capello
de8b6ff2b4 Add support to select used/unused tiles from multiple tilemap layers using the same tileset
With this commit we've also simplified the
SelectPaletteColorsCommand::selectTiles() function.
2021-05-20 17:49:16 -03:00
David Capello
bc824ed9e6 Fix crash calling PaletteSize without active sprite 2021-05-20 17:31:08 -03:00
David Capello
56ae29a9b4 Add different names to SelectPaletteColors and possibility to assign keyboard shortcuts to these items
Now we can assign keyboard shortcuts to the whole Palette menu.
2021-05-20 17:28:32 -03:00
David Capello
4b2947a81c Refactor SelectPaletteColorsCommand and enable it always for colors and in tilemap layers for tiles
The command doesn't depend on the current TilemapMode.
2021-05-20 16:26:21 -03:00
Gaspar Capello
3c6320a4b5 Add select used colors and select used tiles on palette options 2021-05-20 15:59:42 -03:00
David Capello
414165f078 Add support to resize sprites with tilemaps
This fixes Sprite > Sprite Size and File > Export when a resize
parameter != 100% is given.
2021-05-18 14:52:53 -03:00
David Capello
69a7faefa2 New default RgbMapAlgorithm to select what could works better at a given time 2021-05-09 20:53:09 -03:00
David Capello
1779e11f5e Use expandWindow() to expand/collapse some windows that were left behind in the refactor 2021-05-09 20:45:57 -03:00
David Capello
8a22fe220c Use configured algorithm to convert RGB -> Indexed by default 2021-05-09 12:58:27 -03:00
David Capello
660407c9b2 Switch multiple displays flag in runtime
Already created ui::Window are not modified and closed/reopened.
2021-04-20 14:14:54 -03:00
David Capello
b90c56487d Merge branch 'main' into beta 2021-04-16 14:13:05 -03:00
David Capello
4fe8c93c5c Fix regression cannot move/resize reference layers
Regression introduced in f3ab779bfd
2021-04-16 10:23:35 -03:00
David Capello
14c3cfe393 Fix conversions between layer <-> tilemap when grid origin != 0,0
We've changed a restriction for tilesets: grid's in doc::Tileset must
have origin=(0,0); and the origin of a doc::Grid only makes sense for
the sprite grid (where the origin is set by the user) or for a tilemap
cel (where the origin is the cel origin).
2021-04-15 21:26:45 -03:00
David Capello
de68fddbe7 Merge branch 'main' into beta 2021-04-13 19:12:46 -03:00
David Capello
a035f64d8d Simplify About dialog 2021-04-13 19:08:33 -03:00
David Capello
a012dac020 Merge branch 'main' into beta 2021-04-12 17:11:28 -03:00
David Capello
8b4746e813 Add option to disable the "open sequence of files" dialog 2021-04-12 16:57:02 -03:00
David Capello
2df3cd8a80 [lua] Add app.command.ImportSpriteSheet()
Feature request: https://community.aseprite.org/t/8482
2021-04-09 17:28:59 -03:00
David Capello
ae904428fa Merge branch 'main' into beta 2021-04-08 16:15:02 -03:00
David Capello
f3ab779bfd Don't transform hidden layers (fix #2680) 2021-04-08 11:24:55 -03:00
Martín Capello
fdbb3aec59 Fix alert when installing an extension
Before this, the alert's parent window was the main window instead of
the options window.
2021-04-05 14:31:48 -03:00
David Capello
bcd69495ce Fix several issues locating windows with multiple UI windows
We've refactored the code to support locating windows (and popups
windows + hot regions) correctly in both modes: with one ui::Display
and with multiple ui::Displays.

For this we've added a new ui::fit_bounds() function that works in
both modes.
2021-03-19 18:57:56 -03:00
David Capello
35bb3af6e2 Replace all base::Bind() with lambda functions 2021-03-05 20:09:42 -03:00
David Capello
8034b0cbcc Add support for multiple native windows (#139, #250, #962, etc.)
Each ui::Window now can have a related native os::Window. This
connection is done through the ui::Display class added recently in
c3d52f0bbe.
2021-03-02 13:50:49 -03:00
David Capello
f70e8d3ae7 Add ui::expandWindow() to change the size of a window dynamically 2021-03-02 08:44:35 -03:00
David Capello
44437e0d1f Add new ConvertLayer command ("Layer > Convert To" menu item)
Now we have an easy way to convert between:
  Background <-> Layers <-> Tilemaps

Deprecated (they are kept only for backward compatibility):
  BackgroundFromLayer
  LayerFromBackground
2021-02-23 11:32:08 -03:00
David Capello
7e732b3223 Don't use cmd::TrimCel() on tiles when manual mode is enabled
Applied the fix from e1402381a8 to all
places where cmd::TrimCel() is used.
2021-02-22 16:39:40 -03:00
David Capello
c3d52f0bbe Add ui::Display to support multiple windows in the future
This ui::Display is related to one native os::Window, so the dirty
region/invalid region is now part of a ui::Display instead of a
ui::Manager.

* Replaced ui::display_w/h() functions with ui::Display::size()
  and ui::get_desktop_size()
* The ui::Manager contains the main ui::Display, and in the future an
  ui::Window will have its own ui::Display
2021-02-18 12:34:42 -03:00
David Capello
5d31314cdb Adapt code to the new os::Display -> os::Window refactor 2021-02-02 15:59:28 -03:00
David Capello
289a6ab864 Merge branch 'master' into beta 2021-01-29 12:19:43 -03:00
Gaspar Capello
3035a5713d Fix crash deleting a group layer at the top level
The crash could be achieved by having just one group layer at the top
level (with some children) and trying to delete it using Layer >
Delete Layer menu option (without using the timeline range).

Report: https://igarastudio.zendesk.com/agent/tickets/1719
2021-01-15 17:02:10 -03:00
David Capello
b1016a419f Minor formatting changes 2021-01-05 14:43:43 -03:00
David Capello
e813773445 Merge branch 'feature-css-export' into css-export 2021-01-05 12:23:57 -03:00
David Capello
d3f3858859 Minor change "save_as_preset" -> "saveAsPreset"
This new camelCase style is prefered since the introduction of the Lua
scripting API.
2021-01-05 11:41:26 -03:00
mezz
3211831da3
Create and use new signal: PalettePresetsChange 2021-01-04 09:53:20 -10:00
mezz
be48c40dc5
Reload palette popup and refresh search results when saving a new preset 2020-12-29 20:45:37 -10:00
mezz
98a0bcb2d7
Add palette option to save as preset
This works the same as saving a palette normally, but opens the file dialogue to the default palette preset directory.
2020-12-29 19:56:02 -10:00
David Capello
91628daa9d Merge branch 'master' into beta 2020-12-22 15:48:15 -03:00
Gaspar Capello
116201d8a1 Add custom data to Sprite Properties Window (fix #1306) 2020-12-16 12:40:05 -03:00
David Capello
c0ac9208ff Fix layer name for new sprites to match the translation in new layer (fix #2549) 2020-11-27 19:27:13 -03:00
David Capello
26b75bdb57 Add option to specify/modify the tileset name 2020-11-10 17:48:09 -03:00
David Capello
0cf28840b5 Don't show tileset button in Layer Properties when it's open for a regular layer 2020-11-09 19:45:04 -03:00
Gaspar Capello
08f63f1b02 Fix cel and layer user data text input do not update when a fast layer change happen. 2020-11-05 18:42:32 -03:00
David Capello
db80c2a07e Real-time preview when editing tilemaps in Manual mode
In this way we can see the changes to all instances of the same tile
in the tilemap in real-time. The preview is done through a new
"preview tileset" that is used in the render concept (instead of the
preview image, a preview tileset is used as a temporal tileset to be
used for preview purposes only).
2020-11-04 16:54:12 -03:00
David Capello
505aa6119a Add option to change the "base index" from the layer properties 2020-10-30 21:11:58 -03:00
David Capello
a3286fc20a Minor refactor "first visible index" -> "base index" 2020-10-30 20:58:45 -03:00
David Capello
c2e5e69882 Simplify tilesets impl using tile index 0 = an empty tile
In this way we always have an empty tile available in the drawing
process. We've also added the Tileset::firstVisibleIndex field to
change the visible index of the tile 1 so we can offset the visible
number by the user (just as a visual aid / simulate old tilesets with
index=0=non-empty tile).
2020-10-30 16:33:34 -03:00
David Capello
bff884b4c8 Merge branch 'master' into beta 2020-10-22 12:18:30 -03:00
David Capello
38d1b8a8e2 Fix Flip command labels when assigning shortcuts (fix #2545) 2020-10-17 09:36:36 -03:00
David Capello
8b1f887720 Show tile numbers when moving tilemaps 2020-10-13 18:12:29 -03:00
Gaspar Capello
13addb4336 UI user data window integration 2020-10-13 11:07:10 -03:00
David Capello
120fb4dca4 Add support to copy/cut/paste/transform tilemaps 2020-10-02 19:03:53 -03:00
David Capello
edebb57f66 Refactor clipboard code
* Moved all clipboard:: functions inside app::Clipboard class
* Convert app:📋:ClipboardFormat enum to
  app::ClipboardFormat enum class
* Added app::Context::clipboard()
2020-09-25 11:14:52 -03:00
David Capello
b1c0d80356 Add support to clear/fill/stroke selections in tiles mode 2020-08-27 20:32:22 -03:00
David Capello
0c351f6fcf Now SwitchColors command works in tiles mode 2020-08-24 12:25:35 -03:00
Gaspar Capello
f630714547 Removed color functions from tag related code, fix backward compatibilty and added default color in tag constructor (before this, tests were failing) 2020-08-21 18:51:43 -03:00
Gaspar Capello
55a37d0e6b Add tag userdata
Some code from https://github.com/aseprite/aseprite/pull/2265

Co-authored-by: Clarence "Sparr" Risher <sparr0@gmail.com>
2020-08-21 18:51:05 -03:00
David Capello
5ee3ebdd71 Add fg/bg tiles selectors in ColorBar
Now fg/bg colors and fg/bg tiles are different widgets, and the
StatusBar can show tiles when the eyedropper is picking tiles.
2020-08-21 18:28:31 -03:00
David Capello
3623720dd4 Merge branch 'master' into beta 2020-08-18 11:05:37 -03:00
David Capello
b355f34a70 Export all groups (even collapsed ones) by default in JSON metadata (fix #2484) 2020-08-17 17:14:12 -03:00
David Capello
e37ddbd7de Merge branch 'tilemap-editor' into beta 2020-08-14 21:08:59 -03:00
David Capello
432e8d9943 Merge branch 'master' into beta 2020-08-12 14:23:32 -03:00
Gaspar Capello
d701ef9ffd Fix replace current pallete does not create a palette (fix #2480) 2020-08-11 10:19:37 -03:00
David Capello
2ffac6803c Merge branch 'beta' into tilemap-editor 2020-08-06 10:47:06 -03:00
David Capello
4e08d12f28 Merge branch 'master' into beta 2020-08-06 10:46:32 -03:00
David Capello
14fbee19f0 Fix cli_tests when Strings is not available 2020-08-04 18:11:18 -03:00
David Capello
d7a3da9518 Fix crash using opacity slider on CelProperties after deleting a cel
Crash report: https://igarastudio.zendesk.com/agent/tickets/1208
2020-08-04 10:42:28 -03:00
David Capello
d97565e4e0 [lua] Fix app.command.SetInkType{ type=... }
Related to https://community.aseprite.org/t/6532/3
2020-08-03 13:52:41 -03:00
David Capello
5edf30687b Add File > Scripts > Rescan option to rescan the available scripts
https://community.aseprite.org/t/6170/6
2020-08-03 13:51:40 -03:00
David Capello
d8f6c666de Merge branch 'beta' into tilemap-editor 2020-07-30 16:49:17 -03:00
David Capello
20d763ca4b Merge branch 'master' into beta 2020-07-30 16:48:43 -03:00
David Capello
8c0f81cbba Improve handling of image sequences when dropping files or opening multiple files
Now we can repeat the same action (Agree/Skip the all sequence of
images) for all the dropped files/selected files in the "Open File"
dialog (as in the CLI new behavior).
2020-07-30 16:27:23 -03:00
David Capello
1255b17738 Fix opening image sequences more times from CLI
We've also fixed the Agree/Skip dialog to show a checkbox and repeat
the same action for all image sequences.

Fixes:
https://github.com/aseprite/aseprite/issues/2128
https://github.com/aseprite/aseprite/issues/1936#issuecomment-451565903
2020-07-30 14:33:27 -03:00
David Capello
866d614737 [lua] Add "ui" and "bounds" params to CanvasSize (fix https://community.aseprite.org/t/4319) 2020-07-27 17:04:17 -03:00
David Capello
6b43f7ca05 Pick the new tiles after moving/copying them in the tileset 2020-07-16 18:51:12 -03:00
David Capello
a9974e37d3 Publish CopyTiles command with "CopyTiles" ID (instead of "MoveTiles" ID) 2020-07-16 18:48:08 -03:00
David Capello
c86b4a28a6 Fix typo 2020-07-14 17:27:03 -03:00
David Capello
515dace441 Merge branch 'beta' into tilemap-editor 2020-07-13 17:32:42 -03:00
David Capello
db4504e816 Refactor laf-os memory handling 2020-07-07 19:06:48 -03:00
David Capello
8a3f32b47f Replace all base::Bind() with lambda functions 2020-07-03 21:51:46 -03:00
David Capello
d0ab7d720c Add support to pick tiles with eyedropper 2020-06-25 19:47:58 -03:00
David Capello
d0c95cf46f Add possibility to paint with tiles 2020-06-25 19:21:35 -03:00
David Capello
ae02600a63 Add FullscreenMode command (fix #464) 2020-06-24 21:34:55 -03:00
David Capello
bcf53fa54a Merge branch 'octree' into beta 2020-06-17 23:33:41 -03:00
David Capello
81b6a99c2c Merge branch 'master' into tilemap-editor 2020-06-17 23:02:01 -03:00
David Capello
89a896d627 Fix Insert Text to use the sprite transparent color in indexed mode (fix #2444) 2020-06-16 21:24:32 -03:00
David Capello
bd1723313a Merge branch 'master' into tilemap-editor 2020-06-12 11:33:55 -03:00
David Capello
6290f18742 Fix Screenshot command compilation when ENABLE_STEAM is undefined 2020-06-11 16:42:54 -03:00
David Capello
2f472f0760 [steam] Add possibility to take screenshots and add them to the Steam library
Requests:
https://community.aseprite.org/t/6067
https://steamcommunity.com/app/431730/discussions/0/1482109512300945388/
https://steamcommunity.com/app/431730/discussions/0/1495615865218665223/
https://steamcommunity.com/app/431730/discussions/0/1708438376933048578/
2020-06-11 14:18:13 -03:00
David Capello
b41f1ace30 Move function to convert doc::Image -> os::Surface to app/util 2020-06-09 19:56:25 -03:00
David Capello
aa1943e609 Minor refactor using cmds directly instead of DocApi in Layer/Background from Background/Layer 2020-06-08 14:47:11 -03:00
David Capello
1068926f7b Reformat SwapCheckerboardColorsCommand file 2020-06-04 17:00:10 -03:00
David Capello
e4b224a0bd Merge branch 'swap-bg-colors' (fix #1812) 2020-06-04 16:59:41 -03:00
David Capello
a10efb187b Merge branch 'master' into tilemap-editor 2020-06-01 16:21:32 -03:00
David Capello
445e0abb0b [win] Add Tablet section on Edit > Preferences and restore old wintab behavior
Now on Windows it's more clear the different APIs to use (Windows
Pointer vs Wintab), the Wintab API works as before (generates mouse
events on WM_MOUSE message instead for each packet), and there is a
new Wintab mode to create events directly from packets (still a little
buggy with some tablets, but might be useful in other tablets to get
more precision for fast strokes).
2020-05-30 16:54:35 -03:00
MorganDavid
39a2045a43 Added swap checkerboard colors command 2020-05-28 23:11:26 +01:00
David Capello
1b08d5248c Fix Flip command when ENABLE_UI is off 2020-05-27 14:48:16 -03:00
David Capello
1ec502d242 Add "ink" parameter to app.useTool() + minor needed refactors 2020-05-20 17:15:30 -03:00
David Capello
a80af2b304 Merge branch 'master' into tilemap-editor 2020-05-18 20:24:22 -03:00
David Capello
46f4002368 Fix crashes saving sprites with '%' char in their filename
To fix this we changed the way StatusBar text is handled (we are using
fmt::format() in StatusBar instead of printf-like ... args now).
2020-05-08 17:39:55 -03:00
David Capello
4cfa5e743e Add addition mode back for Hue/Saturation filter (fix #1848) 2020-04-23 12:05:09 -03:00
David Capello
5affdbbae1 Shox extensions in different categories in the Preferences dialog 2020-04-20 14:20:07 -03:00
David Capello
1f34d0e46e Add different formulas to convert RGB to Grayscale 2020-04-20 10:22:41 -03:00
David Capello
e56cc15326 Add possibility to use New Layer via Cut/Copy with ranges
Requested here: https://community.aseprite.org/t/5222
2020-04-17 16:13:22 -03:00
David Capello
fb68407e04 Add support to call Flip command without UI 2020-04-17 12:32:10 -03:00
Gaspar Capello
966daf5e34 Add RgbMap algorithm option in RGB -> Indexed color mode conversion dialog 2020-04-15 15:36:50 -03:00
Gaspar Capello
80cbb2caf5 Add combobox to select RGB5A5/Octree algorithms in ColorQuantization dialog 2020-04-15 11:07:13 -03:00
Gaspar Capello
696bb9a537 Add possibility to use OctreeMap in create_palette_from_image() 2020-04-14 20:01:25 -03:00
Gaspar Capello
886fdf8b3f Add OctreeMap as an alternative RgbMap implementation to RgbMapRGB53A
There is a new experimental option to switch between both RgbMap
implementations.
2020-04-10 15:47:24 -03:00
David Capello
b628e21e76 Replace MIN/MAX() macros with std::min/max() functions 2020-04-08 12:20:53 -03:00
David Capello
86259a64fc Replace MID() macro with base::clamp() function
In the future we will replace base::clamp() with std::clamp().
2020-04-07 19:47:16 -03:00
David Capello
6b6b9057bf Add support for scripts on extensions (#1949)
It still need some work to associate the command to menus easily.

Related issues:
  https://github.com/aseprite/aseprite/issues/1403
  https://github.com/aseprite/aseprite/issues/1949
  https://github.com/aseprite/api/issues/20
  https://community.aseprite.org/t/lua-script-extension-and-menu-api/5085
2020-04-02 20:21:21 -03:00
David Capello
d358e6055f Add auto-fit screen option (fix #789, fix #2267) 2020-03-30 09:16:14 -03:00
David Capello
09ea577a08 Match ui::MouseButton values to os::Event::MouseButton 2020-03-27 15:40:43 -03:00
Hamed Zaghaghi
123fa7d106 add css export 2020-03-24 05:51:02 +04:30
David Capello
c230e8f0ab Add options to save TGA files with 16/24/32bpp & uncompressed/compressed 2020-03-20 19:18:03 -03:00
David Capello
941219363b Keep "Export File" window position saved on preferences (fix #2300) 2020-03-19 09:50:18 -03:00
David Capello
7319309630 Merge branch 'master' into tilemap-editor 2020-03-17 00:25:24 -03:00
David Capello
a0882ba443 Move PACKAGE/VERSION, etc. to new ver-lib
* As we moved the VERSION macro to a .c file, we don't have to
  recompile the whole project when we change the version number.
* Removed the version number from gui.xml
* Removed the invalid first menu item that might appear in the root
  menu when the gui.xml version is outdated in debug mode.
2020-03-16 10:31:32 -03:00
David Capello
99cb95357a Add support to send crash reports from macOS 2020-03-06 14:45:13 -03:00
David Capello
f0e60d2068 Fix crashes using MaskByColor command after we cannot lock the sprite
If ContextWriter thrown an exception (i.e. we cannot lock the sprite
for writing purposes), the "Mask by Color" ui::Window would persist
with its signal slots, and it creates an unstable scenario where color
change signals are generated from sliders and crashes the program
because we were using a deleted ContextReader variable which was
stored in the stack in MaskByColorCommand::onExecute().
2020-02-26 12:49:23 -03:00
David Capello
776b7862d3 Add Space+N/Tab/1,2,3 to handle tilemap modes
* Space+N to create new tilemaps
* Space+Tab to switch the tileset visibility
* Space+1,2,3 to change to manual/auto/stack tileset modes
2020-02-17 16:36:18 -03:00
David Capello
e792d4e078 Add possibility to move tiles w/drag and drop + remap tiles 2020-02-17 09:06:02 -03:00
David Capello
9f6b18ddb3 A tilemap cannot be a background layer in the first release 2020-02-17 09:06:02 -03:00
David Capello
962ad545ad Disable merge down for tilemaps (at least for the first version of tilemaps) 2020-02-17 09:06:02 -03:00
David Capello
4d69106993 Fix crash merging a tilemap layer into a regular layer 2020-02-17 09:06:01 -03:00
David Capello
2baf405b37 Add support to apply filters to tiles 2020-02-17 09:06:01 -03:00
David Capello
12e1b4d934 Add dialog to create new tilemaps selecting the tileset specs 2020-02-17 09:06:01 -03:00
David Capello
f7b5304d77 Fix SelectTile command on tilemaps 2020-02-17 09:06:01 -03:00
David Capello
26139c4ae2 Add tilemap layers (#977)
This is the first commit with a simple tilemap editor. Still buggy but
functional in several ways. Several changes were made:

* NewLayer command can receive a tilemap=true to create a new tilemap
  layer
* New ToggleTilesMode command added to switch between the palette and
  the tileset in the ColorBar (the ColorBar was expanded to show
  colors or tilesets with a generic AbstractPaletteViewAdapter)
* All commands to create new layers were moved to Layer >
  New... submenu
* There are a new tileset chunk to save tilesets in .aseprite files,
  and a new kind of cels to save tilemaps
* Added doc::LayerTilemap, doc::Tileset, etc. and several other types
  to handle tilesets/tilemaps in the doc layer.
* Added doc::Grid class with grid specifications that indicates how a
  tilemap <-> tileset must be drawn
* Added and expanded cel operations to work with tilemaps and
  conversions between regular LayerImage cels <-> LayerTilemap cels
  (e.g. copy cels in the timeline between layer types)
2020-02-17 09:06:00 -03:00
David Capello
6b7a593858 Minor formatting change in SelectTileCommand 2020-02-14 14:32:28 -03:00
David Capello
47a568ee86 Resize selection correctly on "Sprite Size" even when the Bilinear method is used 2020-02-07 15:11:03 -03:00
David Capello
df74444347 Now ContextWriter will always wait 1/2 second to unlock the backup thread 2020-02-05 17:50:17 -03:00
David Capello
d316781e8a Remove usage of ContextWriter from all Command::onEnabled() impls 2020-02-05 17:39:56 -03:00
David Capello
1bb126fade Fix pasting text on empty cel when the timeline range is enabled
Bug report: https://community.aseprite.org/t/4489
2020-01-30 19:47:23 -03:00
David Capello
70a211d978 Fix Palette:setColor() and Color Range command when alpha != 255
Use the app::Color alpha property to create the color for an
image (app::color_utils::color_for_image()) in several cases.

Fixed https://community.aseprite.org/t/4548
2020-01-08 17:40:43 -03:00
David Capello
e68cc7dbf9 Fix crash exporting sprite sheets into .gif or .jpg files (formats with onAskUserForFormatOptions()) 2020-01-03 10:48:52 -03:00
David Capello
e553777d24 Fix warnings of unused varisables when !ENABLE_UI 2019-12-11 12:22:01 -03:00
David Capello
b7f41b811a Add Screenshot command 2019-12-05 12:05:18 -03:00
David Capello
70ff67e890 Clear save_copy preference values of saved copies (related to #1964) 2019-12-03 17:38:28 -03:00
David Capello
ea0e51e82d Export Sprite Sheet: Fixed exporting selected layers when Split Layers is not checked
Bug reported here: https://community.aseprite.org/t/4248/6
2019-11-29 11:50:33 -03:00
David Capello
aec82eccb2 Add recent file and folder after exporting sprite sheet (fix #2202) 2019-11-29 10:12:21 -03:00
David Capello
a85368c6c2 win: We need psapi to show memory info when ENABLE_DEVMODE is defined (fix #2205) 2019-11-28 12:18:16 -03:00
David Capello
94dcaf8008 Don't export sprite sheet image on preview or after cancel 2019-11-20 12:18:15 -03:00
David Capello
da37bec54d Fix unused var on release compilation 2019-11-15 10:46:37 -03:00
David Capello
c2acc973ee Add support to show multiple sections in Export Sprite Sheet 2019-10-29 16:37:06 -03:00
David Capello
f43f7e2ada Use latest Export Sprite Sheet used params when the document doesn't have preferences 2019-10-29 11:22:14 -03:00
David Capello
31efa1ce0f Minor changes in Export Sprite Sheet 2019-10-29 10:34:03 -03:00
David Capello
8a499ae175 Initialize Width/Height/Columns/Rows fields correctly in Export Sprite Sheet 2019-10-29 10:12:50 -03:00
David Capello
c0dfd76114 Change Export Sprite Sheet dialog with a tab-like UI 2019-10-26 13:24:27 -03:00
David Capello
ad12ec4a0d Export Sprite Sheet: Select old sprite tab when the preview is unchecked 2019-10-25 14:40:21 -03:00
David Capello
a74cec6369 Use "By Rows" as the default sprite sheet type in Export Sprite Sheet 2019-10-24 19:01:18 -03:00
David Capello
926accf7c7 Split layers/tags explicitly on export sprite sheet when the options to split layers/tags are used
This is mainly useful when we want to include the "{tag}" in the JSON
data but we don't want to split tags in the sprite sheet
layout (e.g. using a fixed # of rows in "By Rows" sprite sheet type
without breaking rows when the tag change between a couple of
samples).
2019-10-24 08:55:11 -03:00
David Capello
13d042f346 Add options to merge duplicates/ignore empty cels in Export Sprite Sheet 2019-10-23 21:09:56 -03:00
David Capello
0a2d5e171b Fix crash previewing Export Sprite Sheet in certain cases 2019-10-23 20:15:09 -03:00
David Capello
a0b389e87a Delete old cel of previewed sprite sheet ASAP 2019-10-23 14:51:08 -03:00
David Capello
cd68a4fe0a Add "Trim Sprite" to DocExporter/Export Sprite Sheet/--trim-sprite CLI 2019-10-22 21:27:15 -03:00
Gaspar Capello
558943ebec Fix Set Ink Type command crash when it is executed without UI 2019-10-22 19:20:49 -03:00
David Capello
536a4c5d3a Simplify Export Sprite Sheet with preview + changes to the UI
These changes include an option to split layers and tags
by rows (fix #1118)
2019-10-18 17:00:35 -03:00
David Capello
30b2585037 Save grid bounds inside .aseprite files and doc::Sprite (fix #688) 2019-10-10 15:08:59 -03:00
David Capello
aa66ff35a2 Refactor DocExporter::DataFormat -> SpriteSheetDataFormat 2019-10-07 17:22:27 -03:00
David Capello
fa246d9c60 Add Packed style to File > Export Sprite Sheet 2019-10-04 15:22:58 -03:00
David Capello
d99e642c55 Add split layers option in ExportSpriteSheet 2019-10-03 15:52:19 -03:00
David Capello
7a10139a87 Minor refactor in ExportSpriteSheet adding functions to update params from window widgets and update DocExporter from params 2019-10-03 10:08:46 -03:00
Gaspar Capello
b533e77b3f Fix export sprite sheet rows and columns calculation and others
Several things are changed to fix columns and rows calculation in de Export Sprite Sheet Dialog.
- onSizeChange() Conditions were added to consider padding and sprite sheet type in columns and rows calculation.
- onSheetTypeChange() Condition was added to consider best_fit mode, and consequent  columns and rows calculation.
 - On ExportSpriteSheetWindow creation, unnecessary conditions and onSizeChange execution were removed. Because, we need update columns, rows, fitWith and fitHeight according the current sprite data (done in onColumnsChange()), instead of the saved params.
- best_fit() function: type sprite sheet argument was added  to fix columns and rows calculation when Columns type sprite sheet is selected in best fit mode.
- best_fit() function: it was simplified by removing the “for” iterations since they were unnecessary. We found a simpler way to do that.
- best_fit() function: it have no longer gfx::Region and gfx::Rect variables, because, the calculation is simpler now.
- MID macros were replaced by base::clamp() function.
2019-10-02 17:03:42 -03:00
David Capello
1c8b8051a8 Rename FrameTag -> Tag 2019-10-01 14:55:08 -03:00
David Capello
cefeb9cbc0 Make "Duplicate Cels" commands behave like the timeline range is enabled even for the case of one cel
In this way we can use Alt+D to duplicate the active cel, and Alt+M to
link the active cel in the next frame.
2019-10-01 12:05:04 -03:00
David Capello
5e25d5a021 [lua] Add support to call AddColor from scripts 2019-10-01 09:37:04 -03:00
David Capello
944634542e Refresh screen/current palette automatically on Transaction::commit() (#378)
Removed app_update_current_palette() with this patch.
2019-10-01 09:24:03 -03:00
David Capello
75636afd64 Preserve cel links when we copy/move a range of cels/frames
This is a common solution in the DocApi wrapper that takes cares of
the duplicated cels that we're copying with copyCel() and that are
linked in the source, so then it maps the links into the destination.
Solving this in DocApi we fixed the problem on the timeline
drag-and-drop (doc_range_ops), copy/paste clipboard ranges, and merged
the code in NewFrame to duplicate (linked) cels.

We've also added 3 variants of Duplicate Cels with this change:
- Duplicate Cels: Copies the whole cel block without linking to
  previous cels.
- Duplicate Linked Cels: Copies the whole cel block linking all cels to
  previous cels.
- Duplicate Cels w/Layer Mode: Depending on the layer mode (continuous
  or not) the cels will be linked or not (this is how "duplicate
  linked cels" was working before, and was added just in case for
  backward compatibility).

Fixes: http://steamcommunity.com/app/431730/discussions/1/142261352649813598/
2019-09-26 19:09:23 -03:00
David Capello
8d5133fe09 Move editor_type() -> Editor::Type() 2019-09-23 20:02:19 -03:00
David Capello
79f4e892f1 Add missing strings for extensions panel 2019-09-23 08:54:04 -03:00
David Capello
d588777b40 Remove unnecessary calls to Doc::resetTransformation/generateMaskBoundaries() 2019-09-11 15:41:35 -03:00
David Capello
3e478d3efa Transform/scale/rotate multiple cels at the same time (fix #1148, #1172, #1238, #1364)
Requested in twitter, the forum, and in several other places and
frequently over all these years:
https://community.aseprite.org/t/scaling-multiple-frames-simultaneously/240
2019-09-05 15:03:13 -03:00
David Capello
ad1a39714e [lua] Add Image:resize() function
Closes: https://community.aseprite.org/t/3633
2019-08-13 18:16:30 -03:00
David Capello
f317f9594d Add support to use ColorQuantization from scripts 2019-08-12 16:42:30 -03:00
David Capello
35aaa18ee3 [lua] Add app.range.colors + Move/CopyColors commands
Closes: https://community.aseprite.org/t/2512
2019-08-10 14:37:18 -03:00
David Capello
744bd36408 Fix transparent color for sprites created w/NewSpriteFromSelection
Fixes https://community.aseprite.org/t/3629
2019-08-06 16:18:01 -03:00
David Capello
d32fd97da5 Replace base::SharedPtr with std::shared_ptr
We can remove our smart pointer (base::SharedPtr) as we're already
using C++11 compilers on all platforms.
2019-08-01 19:16:16 -03:00
David Capello
4264f199cd Create the ContextWriter+Tx from UI thread on filters (related to #2122)
When we create a Tx the active site is queried, and the UIContext
needs access to the UI to calculate the active site correctly.
2019-07-29 12:13:53 -03:00
David Capello
b5547251f5 We cannot create a ContextReader in the filter background thread
This is because ContextReader gets the activeSite, which (in case of
the UIContext) asks to the UI thread this information (app::Editor).
2019-07-26 12:06:21 -03:00
David Capello
f248d8ed65
Merge pull request #2117 from Gasparoken/refactor-sprite-size
Refactor sprite size command params
2019-07-26 10:49:54 -03:00
Gaspar Capello
3e1584e638 Refactor sprite size command params 2019-07-26 09:30:28 -03:00
David Capello
4c4c20ace6 [lua] Add support to use ColorCurve/ConvolutionMatrix commands from scripts 2019-07-25 22:23:38 -03:00
David Capello
1ef67cada4 lua: Support more filters from scripts (BrightnessContrast, Despeckle, HueSaturation, InvertColor, Outline) 2019-07-18 11:47:26 -03:00
David Capello
814250e325 Add support to call ReplaceColor from scripts when the UI is disabled (e.g. from CLI) 2019-07-16 16:36:09 -03:00
David Capello
9143523827 Add params to ReplaceColor command (now this filter can be used from a script without UI) 2019-07-16 09:31:25 -03:00
David Capello
655ce92836 Use a Tx instead of a Transaction on FilterManagerImpl (fix #2108) 2019-07-15 14:30:59 -03:00
David Capello
1ae29dfc3c Check if the context can show the new layer name dialog 2019-07-10 12:45:53 -03:00
David Capello
757fadeaf0 Add New Layer via Cut/Copy commands (fix #1567) 2019-07-02 15:28:05 -03:00
David Capello
a0ebecca50 Make NewLayerCommand compilable when ENABLE_UI is not defined 2019-06-28 18:53:23 -03:00
David Capello
fe4106457f Add "Edit > Paste Special > Paste As New Sprite" option (fix #1024) 2019-06-28 18:51:14 -03:00
David Capello
ff6538a68e Add Edit > Paste Special > Paste As New (Reference) Layer (fix #672, fix #1748) 2019-06-27 15:34:56 -03:00
David Capello
056eb28670 Fix crash destroying temporal docs (e.g. adding new reference layer) 2019-06-25 15:53:31 -03:00
David Capello
8405add137 Fix error using an invalid crop_image() with Width < 1, Height < 1 when using New Brush with right-click outside the canvas bounds 2019-06-07 18:39:36 -03:00
David Capello
45a09f1a15 Disable keepEditedSpriteData checkbox if dataRecovery is disabled 2019-06-07 15:12:39 -03:00
David Capello
2a364c3ad2 Fix saving general.keep_closed_sprite_on_memory_for preference with decimals 2019-06-07 13:27:31 -03:00
David Capello
c7d1e4a472 New option to configure how much time we keep a closed sprite on RAM 2019-06-07 13:17:21 -03:00
David Capello
91665c62c3 Fix bug showing invalid warning in Edit > Pref when "keep edited sprite data lifespan" wasn't modified 2019-05-27 23:53:57 -03:00
David Capello
54883012bb Put "Reopen Closed File" and "Clear Recent Files" options inside "File > Open Recent" menu 2019-05-27 23:53:57 -03:00
David Capello
cdb98d4cd5 Add File > Reopen Closed File command 2019-05-27 23:53:57 -03:00
David Capello
1b62515cd2 Add "Recover Files..." option in Home tab
We've changed the way the "recover files" option works:
* Now it's an option that is always available (so we can open files
  even from sessions that were correctly closed in the past)
* We can open sessions from other Aseprite versions (as in a "best
  effort" approach, if it works, ok, if it doesn't -> contact user
  support)
2019-05-27 23:53:57 -03:00
David Capello
25cec1543c Fix "Repeat Last Export": params weren' filled with DocPref if ui=false
The "Repeat Last Export" command needs to copy DocPref to params, even
when the UI not used (also we must copy the DocPref to the params only
if sprite sheet type is not defined, which means that a script didn't
specify it).
2019-05-27 23:53:57 -03:00
David Capello
2eba51a62d Fix minor warning 2019-05-11 13:42:50 -03:00
David Capello
bd18248be9 Fix compilation when ENABLE_SCRIPTING is defined 2019-05-08 15:53:55 -03:00
David Capello
dd8a49a19c Add option to disable changing the display color profile depending on the current monitor 2019-05-08 10:55:56 -03:00
David Capello
e8716cbb6e Improve context bar for slice tool (combobox of slices + action buttons) 2019-05-07 10:28:37 -03:00
David Capello
73de6c8b1d Add ability to edit multiple slices
Related to #721 and #1651, still need more work to give a better UX to
edit static and animated slices.
2019-05-02 16:26:13 -03:00
David Capello
e197a8670c Add an option to trim areas outside the canvas bounds on Sprite > Canvas Size (fix #1111) 2019-04-23 14:40:26 -03:00
David Capello
bbba80c809 Modify Canvas Size to be more "tool like" (easier to change the edges size, C keyboard shortcut) 2019-04-22 15:57:45 -03:00
David Capello
d24fc0a93a lua: Add Sprite:flatten() 2019-04-17 15:00:51 -03:00
David Capello
17895dce69 Support MergeDownLayer when ENABLE_UI is not defined 2019-04-17 00:16:52 -03:00
David Capello
dba3f3cdfb Minor improvement in ChangePixelFormat dialog
Moved the progress bar in other at the left of the OK button and the
progress bar appears only if we have to report a progress value > 0
2019-04-17 00:07:33 -03:00