73 Commits

Author SHA1 Message Date
David Capello
8b5133b4c0 [lua] Fix context used in App.useTool() 2022-02-11 10:41:56 -03:00
David Capello
0c1e08138e [lua] Fix crash using app.useTool() when the active editor is in MovingPixelsState (fix #2933)
More information in https://github.com/aseprite/aseprite/pull/3166
2022-02-11 10:19:32 -03:00
David Capello
6e726025ee Merge branch 'main' into beta 2022-01-05 20:16:13 -03:00
lampysprites
3035d00283 [lua] Show errors that happen inside App.transaction 2021-12-12 19:20:12 +07:00
David Capello
db44eeb269 Merge branch 'main' into beta 2021-10-12 10:45:33 -03:00
David Capello
b9241e6d91 Refactor ask_access() with ResourceType argument 2021-10-07 19:34:40 -03:00
David Capello
cd342f5630 [lua] Add events handling with Sprite.events & App.events
Added a new Events object with :on() and :off() methods to start or
stop listening to a specific event respectively. This also allows to
add several callbacks for the same event.

Replaced the temporal Site.onChange & Sprite.onChange implementations.

Related to several issues (enable more possibilities for): #138, #1403, #1949, #2965, #2980
2021-10-07 18:56:39 -03:00
David Capello
ecbd845aae Merge branch 'main' into beta 2021-04-22 14:02:36 -03:00
David Capello
d7a1c71df0 lua: Add support for selection tools in app.useTool()
Fix https://github.com/aseprite/api/issues/37
2021-04-22 13:51:56 -03:00
David Capello
c19ac7a45c Move the cancel flag from ToolLoop to ToolLoopManager 2020-09-01 12:13:24 -03:00
David Capello
d8f6c666de Merge branch 'beta' into tilemap-editor 2020-07-30 16:49:17 -03:00
David Capello
7a534b0a4e [lua] Add Sprite{ fromFile="...", oneFrame=true } to load just one frame 2020-07-28 17:41:01 -03:00
David Capello
27e2a287bf [lua] Add possibility to draw tiles w/app.useTool{ tilemapMode=TilemapMode.TILES... } 2020-07-14 17:27:40 -03:00
David Capello
a10efb187b Merge branch 'master' into tilemap-editor 2020-06-01 16:21:32 -03:00
David Capello
7a74aef1a7 [lua] Use the correct "controller" when "tool" param is specified in app.useTool()
Fix regression introduced in 1ec502d242ddddadf497c9738986edcaed55000b
2020-05-28 12:01:34 -03:00
David Capello
1ec502d242 Add "ink" parameter to app.useTool() + minor needed refactors 2020-05-20 17:15:30 -03:00
David Capello
b922cfcc10 Refactor ToolLoop creation w/ToolLoopParams to add more options to app.useTool()
This will be used to add more testing capabilities to app.useTool()
2020-05-19 20:11:47 -03:00
David Capello
a80af2b304 Merge branch 'master' into tilemap-editor 2020-05-18 20:24:22 -03:00
David Capello
c99a566635 Refactor velocity sensor with tools::VelocitySensor class 2020-04-24 11:19:35 -03:00
David Capello
79f9e28ce8 Added pen pressure sensitivity (fix #710)
- Added support to detect eraser tip on Linux (#610)
- Related to #139
- Still needs works for gradients and better brush interpolations
  between stroke points
- Requested several times, e.g. https://community.aseprite.org/t/1077
  https://community.aseprite.org/t/1881, steam forum, etc.
2020-04-21 22:27:49 -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
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
66864beb77 lua: Fix crash calling app.refresh() from a script using -b -script from CLI 2020-02-05 12:18:12 -03:00
David Capello
1c8b8051a8 Rename FrameTag -> Tag 2019-10-01 14:55:08 -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
57d5fcba68 lua: Don't include -x64 in app.version 2019-05-27 23:53:57 -03:00
David Capello
23f00d87f6 lua: Add error if we specify and invalid tool in app.useTool() 2019-04-25 16:33:49 -03:00
David Capello
ad1a0af752 lua: Add a way to set/get the default app palette (and well-known palettes from resources) 2019-04-24 19:08:25 -03:00
David Capello
d35251d431 lua: Add Version() class 2019-04-21 00:04:49 -03:00
David Capello
8a821c83fd lua: Add Brush class and app.useTool{ brush } parameter 2019-04-18 22:33:48 -03:00
David Capello
0bf5d1de30 lua: Add functions to load/save palettes and images directly 2019-04-17 23:59:59 -03:00
David Capello
ebca165b2a Add support to modify activeFrame/Layer from scripts without UI 2019-04-13 16:25:21 -03:00
David Capello
8d359dd896 lua: Fix app.activeSprite setter 2019-04-13 11:17:17 -03:00
David Capello
2812a95f1e lua: Add params to app.useTool() to change the cel where we'll draw 2019-03-23 16:34:51 -03:00
David Capello
98080544cf lua: Rename app.toolStroke() -> app.useTool()
This function was called app.drawWithTool() first, but some tools do
not "draw" (e.g. eraser, selection-like tools, etc.). And then the
app.toolStroke() name could be confused with the Edit > Stroke
command.
2019-03-23 13:31:14 -03:00
David Capello
396824383f lua: Add app.activeTool + Tool object 2019-03-23 09:19:10 -03:00
David Capello
33c6fc5f40 lua: Fix tools tests when ENABLE_UI is not defined 2019-03-18 13:30:17 -03:00
David Capello
7aec117b5e Fix segfault on CLI mode because activeInk() tries to access to the color bar 2019-03-16 13:46:09 -03:00
David Capello
25189224b9 lua: Rename app.drawWithTool() -> app.toolStroke() 2019-03-16 13:15:06 -03:00
David Capello
1cb5949e9b lua: Add app.drawWithTool() function 2019-03-15 17:03:02 -03:00
David Capello
b2cafe4108 lua: Add app.params and --script-param
Now parameters for scripts can be specified from the CLI with
--script-params and from gui.xml or .aseprite-keys from <param>
sections.
2018-12-10 16:45:30 -03:00
David Capello
ca6d038af3 lua: Add support to use app.activeFrame with a Frame object 2018-11-28 12:05:17 -03:00
David Capello
aceec4e4d8 lua: Add app.refresh() function 2018-11-27 10:24:13 -03:00
David Capello
165cd3bdf0 lua: Use active cel info in Range when there is no timeline range enabled
With this change we can always use app.range collections (e.g. app.range.editableImages)
for our filters in the scripts.
2018-11-23 16:08:49 -03:00
David Capello
bf916fe029 lua: Add Range and RangeType 2018-11-23 13:10:12 -03:00
David Capello
34d1906034 lua: use ObjectId to refer doc objects from script variables
This should fix several crashes using objects in invalid ways where
the object doesn't exist anymore (e.g. an undo deleted referenced
objects in scripts).
2018-11-20 18:12:43 -03:00
David Capello
bdf3b25209 lua: add app.apiVersion property 2018-11-13 22:31:14 -03:00
David Capello
2adfcf8829 lua: app.activeFrame returns a Frame object now 2018-10-31 17:18:09 -03:00
David Capello
b27c685d70 lua: Add app.activeTag 2018-10-26 10:52:40 -03:00