Commit Graph

1413 Commits

Author SHA1 Message Date
David Capello
5e34ae0ce2 Fix unused variable warnings 2023-09-27 19:57:41 -03:00
Gaspar Capello
a0331743de Fix Color Range uses last active selection instead of active selection (fix #4045) 2023-09-20 11:44:23 -03:00
Gaspar Capello
db0bc5c6bb Fix F6 shortcut to show the timeline thumbnail by default (fix #4020)
Before this fix, when the thumbnail size was 1, the "Toggle Timeline
Thumbnails" command (F6 key) seemed to not work until we changed
the timeline thumbnail size to 2 or more.
2023-09-20 11:43:43 -03:00
David Capello
d8814fa2f9 Add option to avoid drag & drop timeline range from edges
Related to #1498 in some way to start enabling new selection modes in
the timeline.
2023-09-19 12:07:14 -03:00
David Capello
e2d8ffab54 Add reset buttons + tooltips to timeline range options (#4024) 2023-09-18 17:33:38 -03:00
David Capello
7358626859 Add flip/rotate brush support to ChangeBrush command (#1222)
Implement part of:
https://github.com/aseprite/aseprite/issues/1222
https://steamcommunity.com/app/431730/discussions/1/1479856439033920884/
https://community.aseprite.org/t/flipping-rotating-the-current-brush/1854
2023-08-09 21:56:55 -03:00
David Capello
11644a7d16 Add Shift+F7 to toggle other layers visibility on Preview window 2023-07-19 10:56:16 -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
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
e84bee0f99 Minor changes removing "using namespace doc" from app/color.h 2023-07-17 15:02:15 -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
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
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
a6ccc45d5b Fix crash calling app.command.LoadPalette() when the UI is not available (fix #3847)
E.g.

  aseprite -b -script load.lua

When load.lua is:

  app.command.LoadPalette()

Was crashing the program.
2023-05-15 17:31:46 -03:00
David Capello
7a26281ce3 Change all selected cel properties when we select frames/layers (fix #3807)
The Cel Properties dialog wasn't working right when we selected a
range of layers or frames.
2023-05-15 15:20:16 -03:00
David Capello
691f99a291 Delay filter preview start to group several mouse events/param changes in one
This is needed on X11/Linux as we received a lot of mouse events at
the same time when the user drag the mouse. In this way we avoid
restarting the preview and making a high CPU usage just to stop/start
the filter without any kind of UI feedback.
2023-05-15 14:31:08 -03:00
David Capello
59f6b78e4f Use a task_token to cancel a filter when we are processing a row
Added FILTER_LOOP_THROUGH_ROW_BEGIN/END macros to simplify some
boilerplate code for each filter.

In this way if processing just one row takes too much time, canceling
the operation is faster.
2023-05-15 13:23:24 -03:00
David Capello
87075296ed Use app::Task instead of raw threads on FilterPreview
We can use a thread pool (avoid creating/destroying threads) and we
can continue the same task running when the filter restart (there is
no need to stop/wait and restart, because the filter task keeps
calling the applyStep() function anyway).
2023-05-12 10:22:10 -03:00
Gaspar Capello
2369f36322 Enable panning and zooming for filter window (fix #2563)
Now we can zoom and pan on Replace Color, Color Curve, Outline,
Convolution Matrix, etc. which are Filter Windows.
2023-05-11 18:01:36 -03:00
David Capello
c32b9b07a8 Centralize the warning message for incompatible files/forward compatibility (#3811, #3812)
Several changes were included:
- Fixes in TextBox widget to show it with proper size hint when it's
  outside a viewport
- Added the IncompatFileWindow with a message + link to know how to
  update Aseprite and solve the situation
- Moved CannotModifyWhenReadOnlyException from app/doc.h to
  app/transaction.h
2023-05-11 12:18:31 -03:00
Martín Capello
3f581a5dfa Add warning when loading unsupported property type and mark the file as read-only (fix #3812, fix #3811) 2023-05-08 17:37:05 -03:00
David Capello
6cbde57470 Add gridBounds parameter to NewLayer command 2023-04-19 13:25:54 -03:00
David Capello
1c6e583c87 [lua] Add require() function (fix aseprite/api#10)
This is the first attempt to finally implement the require() function
on Lua. The main problem was how to solve conflicts between plugins
that use the same library name. Here we separate each plugin like in a
namespace, so require(name) inside a plugin will save the module in
_LOADED["pluginName/libraryName"] to avoid conflicts with other
libraryName from other plugins.
2023-04-18 19:41:01 -03:00
David Capello
b28550faf5 Use new ScopedValue w/o old arg + C++17 class template argument deduction (CTAD) 2023-04-14 13:43:36 -03:00
David Capello
24846eae10 Add z-index property to cels (fix aseprite/Attachment-System#88)
* Now a Cel has a z-index property to change the order of layers per frame
* A new doc::RenderPlan class can calculate the order of cels to be rendered
* z-index is saved as a int16_t in the .aseprite files
* This new field can be set/get from Lua with Cel.zIndex
2023-04-10 19:23:16 -03:00
David Capello
da9f334214 Fix FullscreenPreview for SimpleRenderer
The SimpleRenderer outputs unpremultiplied RGB values when we render
in a transparent background, we have to indicate that to Skia now that
we're compositing os::Surfaces (SkiaSurfaces) directly in this
FullscreenPreview command.
2023-04-07 20:26:16 -03:00
David Capello
da0a8b7916 Show GPU option only in DEVMODE
We've update the label "GPU acceleration" to avoid confusion between
developers so they know that this option is not enabled in the final
release.
2023-04-03 16:09:26 -03:00
David Capello
8c7b94a934 Add support to render the background directly on screen
Renderer::renderCheckeredBackground() function was used only for the
FullscreenPreviewCommand, but now we use
ShaderRenderer::renderCheckeredBackground() to render the background
in the Editor too. So the sprite is painted in a backbuffer and then
composited with the already painted background using
Graphics::drawSurface().
2023-04-03 15:59:29 -03:00
Martín Capello
a7e155a391 Hide small preview window when going full screen preview (fix #3762) 2023-04-03 15:36:04 -03:00
David Capello
8247d53642 Enable several ShowSomething commands in non-UI environments
This is to allow using ShowGrid in test cases when the UI is not
available (most of these commands only modify the preferences).
2023-03-28 13:42:34 -03:00
David Capello
63a387d804 Fix crash right-clicking play button in the preview window is hidden
Regression introduced in 30a88c8e3d
2023-03-22 15:05:29 -03:00
David Capello
30a88c8e3d Put playback options into Frame > Playback submenu
This menu was accessible right-clicking the Play button in the
Timeline (and in the Preview window, with specific options for the
Preview).

This change includes some changes:

1. Now if a menu <item> in gui.xml doesn't specify a text field, the
   text of the command is used (to avoid double translation, the bad
   side is that we don't have a mnemonic specified).
2. Menu::showPopup() can be used with submenus from the root menu, to
   do this we have to remove the menu item owner temporarily before we
   show the menu as popup (see the change in Menu::showPopup())
3. We can specify a special active DocView for commands with
   UIContext::SetTargetView, this is used to set the Preview editor as
   active view for commands like TogglePlayOnce, etc.
2023-03-21 17:18:05 -03:00
David Capello
298981732e Don't change grid settings from Preferences if they aren't modified (fix #3479) 2023-03-16 18:08:40 -03:00
Martín Capello
d88eb80fe6 Fix theme initialization for theme variants widget 2023-02-27 11:59:20 -03:00
Martín Capello
ea43c5f6c8 Adjust styles to make them work with the new buttonset 2023-02-27 09:44:42 -03:00
Martín Capello
cc3c421391 Initialize theme for HueSaturationWindow 2023-02-27 09:43:48 -03:00
David Capello
c900327675 Add switch for "multiple windows" in Edit > Preferences > General
As the "multiple windows" feature is still buggy (#3556) and we've
disabled it by default, it's nice to make this option more visible (in
the General section) so users reliant on this will find the switch
quickly.
2023-02-24 17:11:51 -03:00
David Capello
1b3998af01 Minor change in doc::Tileset internal structure
Merged m_tiles and m_datas in one vector.
2023-02-13 17:20:40 -03:00
David Capello
0775b0d8ba Take care of an empty tileset in doc::Tilesets collection
We cannot delete a tileset yet from Aseprite UI, but now an extension
can do it through Sprite:deleteTileset(). Deleting the non-last
tileset will create an Tilesets array with an empty (nullptr) slot on
it (so tileset indexes are not changed, and for the future, if some
external file is referencing that tileset index, the reference will be
kept).

Related to https://github.com/aseprite/Attachment-System/issues/19
2023-01-17 17:49:21 -03:00
David Capello
c910efe2f4 Fix compilation on Windows, now Button::Click doesn't receive an Event& 2023-01-12 13:01:56 -03:00
David Capello
39d1fb56d4 Remove ui::Event& args from ui::Button::Click signal
This is to simplify code and to match ui::MenuItem::Click and
ui::Button::Click signals (so then we can write some generic code
using Button::Click or MenuItem::Click).
2023-01-12 11:00:16 -03:00
David Capello
f5bc573bfc Remove base::thread, we use std::thread 2023-01-05 16:43:09 -03:00
David Capello
988cba2c2b Add "Copy Path" option when right-clicking a sprite tab 2023-01-05 14:23:15 -03:00
David Capello
822a309724 Several fixes/rewording for --tagnames-format CLI and GUI 2022-12-23 09:59:01 -03:00
David Capello
658a583c7b Assign default/restore tagname format in Export Sprite Sheet UI 2022-12-23 09:53:04 -03:00
Nathan Pannell
bc9e201255 Added cli option --tagname-format 2022-12-23 09:11:58 -03:00
Gaspar Capello
6d6dfb96a9 Add user data to tiles (fix #3626)
Co-authored-by: David Capello <david@igara.com>
2022-12-17 14:13:49 -03:00
David Capello
ea17eae524 Fix several bugs copying name/userData when we clone tilesets
Found on #3630

Co-authored-by: Gaspar Capello <gaspar@igara.com>
2022-12-17 13:42:51 -03:00
David Capello
683954b8fd Enable DeselectMask and MaskAll commands when ENABLE_UI=off 2022-11-02 10:26:51 -03:00
David Capello
38c0400927 Fix Doc::isModified() when we are in a similar UndoState to the saved one
If the current UndoState doesn't modify the "saved state" (e.g. there
is a sequence of undoes/redoes that doesn't modify the saved version
of the sprite compared to the current one), we can indicate that we
are in the saved state anyway (!Doc::isModified).
2022-11-02 09:58:18 -03:00
David Capello
e703de535e Show saved undo state in Edit > Undo History window (fix #3578)
Some extra changes introduced:
* DocUndo & CmdTransaction were simplified: removing the saved
  counter, and storing a specific UndoState pointing to the state that
  matches the version in the disk
* DocUndo::onDeleteUndoState() can generate a
  impossibleToBackToSavedState() if the saved state is deleted. This
  might fix some bugs where a "save changes" dialog weren't displayed
  after undoing and making changes (probably related to #3542, but not
  sure)

Some extra work is needed to avoid showing the "save changes" dialog
if we are close to the saved state and only non-modification undo
states separate us from there. E.g. if we open a file, select the
canvas, and close it, Aseprite now shows the "save changes" dialog,
this wasn't true in previous versions.
2022-11-02 09:57:52 -03:00
David Capello
49e4e10311 Fix bug where Layer > Open Group didn't update the Timeline rows 2022-10-24 17:17:06 -03:00
David Capello
3691b9a16c Merge branch 'repeat-tag' 2022-10-24 11:05:24 -03:00
David Capello
9601c02812 Add option to play/preview with subtags & repetitions 2022-10-20 14:41:24 -03:00
David Capello
e78e1e9a54 Remove current_editor, replace with Editor::activeEditor()
Finally removed src/app/modules/editors.h file.
2022-10-20 12:31:22 -03:00
David Capello
4f96d37b1f Add repeat field to animation tags (#1275, #1740) 2022-10-19 12:25:06 -03:00
David Capello
17a5b3f3fc Replace base::mutex with std::mutex
* Removed base::mutex & base::scoped_lock
* We can use std::lock_guard with deduced template args (as we're
  using C++17 now)
2022-10-18 16:20:34 -03:00
David Capello
616f74ae2d Minor changes when accessing "properties_grid" widget 2022-10-13 09:40:54 -03:00
Joshua Ogunyinka
ed26fdd806 Add missing language strings in other uncategorized sections 2022-10-12 14:57:23 -03:00
Joshua Ogunyinka
6c55847151 Add more missing language strings for filtering/editing 2022-10-12 14:54:50 -03:00
Joshua Ogunyinka
aaa69a3d81 Add more missing language strings when importing/exporting sprite sheets 2022-10-12 14:40:01 -03:00
Joshua Ogunyinka
a4bc897f76 Add missing language strings for preview editor/new brush/inks/mask by color 2022-10-12 14:36:31 -03:00
Joshua Ogunyinka
a6aa84981f Add more missing language strings when changing sprite's pixel format 2022-10-12 14:23:40 -03:00
Joshua Ogunyinka
05c4326ada Add missing language strings for all components using the status bar 2022-10-12 14:23:30 -03:00
Joshua Ogunyinka
bf88fa2bd1 Add missing language strings when loading/saving components 2022-10-12 14:21:21 -03:00
Joshua Ogunyinka
05ece3fad1 Add missing language strings in sprite size command 2022-10-12 13:49:24 -03:00
Joshua Ogunyinka
974c13dd33 Add missing language strings in sprite properties & import sprite sheet 2022-10-12 13:38:22 -03:00
Joshua Ogunyinka
6bc0d312d2 Add missing language strings in the layer properties 2022-10-12 13:24:09 -03:00
Joshua Ogunyinka
ab56186d79 Update commands strings when language change 2022-10-12 13:22:26 -03:00
Joshua Ogunyinka
bbfae36d8f Add missing language strings for preference window 2022-10-12 13:20:41 -03:00
Joshua Ogunyinka
de44545930 Add missing language strings for keyboard shortcuts
Co-authored-by: David Capello <david@igara.com>
2022-10-12 13:20:35 -03:00
David Capello
ba3452b059 Merge branch 'main' into beta 2022-09-29 17:23:11 -03:00
Martín Capello
4ff4274deb Refactor some conditional expressions to fix a compiler warning 2022-09-28 17:08:11 -03:00
David Capello
88594bfa0e Merge branch 'main' into beta 2022-09-28 16:20:03 -03:00
David Capello
008df4d03a Add ui::Paint = os::Paint = SkPaint
So now we can have access to Skia SkPaint instance directly from
Aseprite UI code (and set the shader, and other properties that are
not yet well-wrapped in laf-os).

We've simplified ui::CheckeredDrawMode with
ui::set_checkered_paint_mode() function, as now the checkered
background shader is stored in ui::Paint (SkPaint) instead of
ui::Graphics state.
2022-09-28 15:49:30 -03:00
David Capello
896c02c67f Fix several bugs converting layers (copy user data, blend mode and opacity) 2022-09-23 12:30:22 -03:00
Martín Capello
826fc1a5fd Remember layer index between export operations 2022-09-13 17:09:58 -03:00
David Capello
f925e22561 Don't encourage the usage of layerIndex param in ExportSpriteSheetParams
Until we don't have a standarized way to indicate layers by indexes.
2022-09-05 17:19:53 -03:00
David Capello
d5f54da021 Avoid hardcoded number of initial items added in the layers combobox 2022-09-05 17:19:53 -03:00
Martín Capello
acdb501fc8 Use layer index to avoid conflicts when exporting sprites with layers that have the same name (fix #2656) 2022-09-05 17:19:53 -03:00
David Capello
2f34e25f06 Merge branch 'export' into beta 2022-08-19 18:05:36 -03:00
David Capello
acb246e26b Add "Sprite Grid" source option to Export Sprite Sheet (fix #1982)
In this way we can export each grid cell/tile as an individual sprite,
and use the extrude option on each grid cell. We've added the
--split-grid CLI option too.
2022-08-19 17:21:56 -03:00
David Capello
a2f61a3378 Add "File > Export > Export Tileset" option (#3240)
Now we can export one (or several) tilesets in one sprite sheet (using
the same options that are available in the Export Sprite Sheet dialog,
e.g. like extruding tiles, related to #1982 in some way).

Some changes:

* New "Source" field and fromTilesets param for ExportSpriteSheet
  command
* New ExportTileset command (which acts like ExportSpriteSheet but
  with fromTilesets=true by default)
* Added --export-tileset CLI option
2022-08-18 14:56:43 -03:00
David Capello
83857ea600 Merge branch 'main' into beta 2022-08-17 22:58:12 -03:00
David Capello
a66c170ded Add render::BgOptions to simplify some code 2022-08-17 22:40:25 -03:00
David Capello
4e12e427ef Rename "checked" -> "checkered" (background, drawing routines, etc.)
Also rename setBgCheckedSize -> setBgStripeSize in case we add new
background patterns (like horizontal/vertical/diagonal stripes, etc.)
2022-08-17 22:19:07 -03:00
David Capello
a13423bd70 Add the logic side to export the selection only (fix #645) 2022-08-12 20:11:25 -03:00
Gaspar Capello
e6c90334f9 Fix scrollbar for the Extensions list in Preferences is missing on the first open (fix #3456) 2022-08-10 12:01:28 -03:00
Gaspar Capello
12e59b887f Add remember new tilemap layer base index (fix #2735) 2022-08-04 14:30:11 -03:00
David Capello
3db8267270 Merge branch 'main' into beta 2022-07-19 10:35:13 -03:00
David Capello
da58670dd0 Revert "Add '{title}' and '{layer}' functionality to the Export dialog (fix aseprite/aseprite#3363)"
Fix crash reported on v1.2.36/v1.3-beta17, ctx->activeDocument() can
be nullptr.

This reverts commit 1f5e4cfc4f to fix #3431
2022-07-19 10:29:16 -03:00
David Capello
db1faf8f7b Merge branch 'main' into beta 2022-07-18 15:32:27 -03:00
David Capello
7c8153b5ec Use selection bounds if they're visible on ImportSpriteSheet by default 2022-07-18 12:47:54 -03:00
David Capello
1912053f33 Merge branch 'main' into beta 2022-07-15 17:30:39 -03:00
David Capello
f8f925c634 Merge branch 'main' into beta 2022-07-13 19:49:03 -03:00
Joseph-Eugene Winzer
da81c0266d Fix empty undo history crash (fix #3417)
m_undoHistory is not valid for tabs other than sprites. For example
opening the README or Home tab does not initialize the undo history,
thus aseprite will segfault when it tries to get its first entry.
2022-07-13 05:18:04 +02:00