Commit Graph

101 Commits

Author SHA1 Message Date
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 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 e0e83f0d40 Add Dialog:file() (#1997, fix aseprite/api#7) 2019-02-13 16:15:04 -03:00
David Capello ddd7140841 Fix segmentation fault running cli/sheet.sh test from https://github.com/aseprite/tests 2019-02-12 18:28:37 -03:00
David N Campo bdd4202c35 Add Trim by Grid option in Export Sprite Sheet (#1926)
This adds the logic and UI part of Trim by Grid feature, the CLI part
is not yet implemented.
2019-02-07 14:07:42 -03:00
David Capello 67e0da478d Interpret the Extrude option just like one extra inner padding pixel in calculate_sheet_size() function 2019-01-25 15:59:44 -03:00
David Capello 86464bc63c Fix Best Fit option when Extrude option is checked 2019-01-25 15:57:40 -03:00
David Capello 9a0b0140bf Update texture size when the Extrude check-box is changed 2019-01-25 15:48:58 -03:00
David Capello 3910e20082 Minor changes in calculate_sheet_size() 2019-01-25 15:44:33 -03:00
David N Campo 6ba71343dc Calculate sprite sheet size correctly when extrude option is checked 2019-01-25 15:38:53 -03:00
David N Campo dee2dde520 Remember last user choice of 'Extrude' option in Export Sprite Sheet 2019-01-25 15:37:33 -03:00
David N Campo cf1711c2af Add 'Extrude' option to 'Export Sprite Sheet' command (fix #1890)
Merged #1978 (squashed). The only solved conflict was that now
ExportSpriteSheet use params, so we've added the "extrude" param to
ExportSpriteSheetParams.
2019-01-10 07:49:19 -03:00
David Capello 2c58169cbb Don't open generated sprite sheet if the params specified so 2019-01-09 20:41:29 -03:00
David Capello f4878c7bb8 Fix check for SpriteSheetType param in ExportSpriteSheet command 2019-01-09 10:16:51 -03:00
David Capello 4dd7febb99 lua: Add support to specify ExportSpriteSheet params 2019-01-08 16:42:01 -03:00
David Capello 271865e13d Remove unused Command::clone() member function 2019-01-07 17:03:38 -03:00
David Capello 4335f0c728 Add CommandWithNewParams to load command parameters from Lua tables directly
With these new classes (Param/NewParams/CommandWithNewParams(Base)) we
can load parameters for commands from a Lua table directly without
converting to a string. So instead of

   Lua value -> string -> C++ param type

We can do

   Lua value -> C++ param type

directly.
2019-01-07 16:42:55 -03:00
David Capello f2ed45e795 Replace base::UniquePtr -> std::unique_ptr 2018-08-08 17:27:26 -03:00
David Capello b8317805f8 Rename DocumentExporter -> DocExporter 2018-07-14 23:02:37 -03:00
David Capello 9c79ea2b77 Rename app::Document -> Doc 2018-07-07 11:54:44 -03:00
David Capello 139c5aac49 Add flag to compile CLI-only (fix #1279)
New cmake flag -DENABLE_UI=OFF can be used to turn off the GUI
and compile a CLI-only version of Aseprite.

Requested here too:
https://community.aseprite.org/t/1351
2018-05-07 00:11:50 -03:00
David Capello 0429282967 Add options to configure default extension in other commands (fix #1683)
Maybe too much configuration for my taste, but well, more configuration
is good.
2018-03-19 15:53:02 -03:00
David Capello 9f96ccbd39 Add option to ignore a warning overwriting files on Export Sprite Sheet (related to #917) 2018-03-12 16:44:19 -03:00
David Capello dee6ff6c7e Refactor: Use new base::paths type for list of filenames/extensions 2018-02-21 11:06:58 -03:00
David Capello e0a60b6748 Generate the list of command IDs from en.ini file 2017-12-01 15:10:21 -03:00
David Capello ccee49c02b Move command friendly names to the strings file
Related to #124
2017-11-30 23:41:45 -03:00
David Capello d3d107b0ac Add Trim option in Export Sprite Sheet 2017-11-29 16:17:30 -03:00
David Capello a9b183729f Translate all alerts to the en.ini file (#124) 2017-10-17 18:00:45 -03:00
David Capello 5ad681281d Fix exporting slices data in JSON files on Export Sprite Sheet 2017-05-26 14:36:43 -03:00
David Capello 1350d6d7f7 Add possibility to open multiple files at once (fix #1163) 2017-04-08 00:06:25 -03:00
David Capello 60ce295870 Move timeline code to app/ui/timeline/ folder 2017-03-26 13:33:12 -03:00
David Capello 347ccfbb78 Add --list-slices CLI option 2017-03-16 10:35:26 -03:00
David Capello 5c3f75c64b Merge branch 'master' into beta 2016-11-07 18:17:42 -03:00
David Capello ce6c85996e Update laf library (base/path is gone, use base/fs) 2016-11-01 19:14:05 -03:00
David Capello 3e9e49caf9 Allow to save specific layers/frames in Save Copy As (fix #1080) 2016-09-17 01:01:28 -03:00
David Capello a1ce0c5c73 Add support to specify multiple layers in CLI to export (fix #1174)
Now we can use --layer multiple times to modify the --save-as and
--sheet behavior to render only the filtered/selected layers. This can
be combined with --split-layers too.
2016-09-16 15:19:47 -03:00
David Capello f4b5340dfb Fix export of groups/layers via CLI
We have to propagate show/hide layers/groups visibility properly to
export them correctly. We use the same code that in the "Export Sprite
Sheet" for this (a new RestoreVisibleLayers class is separated for
this).
2016-09-16 11:15:47 -03:00
David Capello 3a9c2e8325 Fix "Export Sprite Sheet" for selected frames/layers
Now we can export a give group, layer, and (non-adjacent) selected
layers/frames.
2016-09-13 16:10:36 -03:00
David Capello 6bbd6b27ff Fix "Export Sprite Sheet" for selected layers using groups and children 2016-09-12 17:56:48 -03:00
David Capello a104afc670 Merge branch 'master' into beta 2016-09-12 17:53:01 -03:00
David Capello 18f9d2478f Fix cryptic error message using "Repeat Last Export" in some special cases (fix #1247)
We cannot use the sprite sheet type to know if the last export was
already done/defined by the user for a new sprite. We need a special
field to indicate if the export was done and we can repeat it last
export with the same configuration.
2016-09-06 22:07:57 -03:00
David Capello 20b726f73b Merge branch 'master' into beta 2016-08-31 19:53:52 -03:00
David Capello 595b2c14d2 Improve selection of layer in groups in Export Sprite Sheet 2016-08-29 15:53:14 -03:00
David Capello 5ecc356a41 Replace GPL license with the new EULA 2016-08-29 13:08:21 -03:00
David Capello f2f1c1008b Add support to move/copy non-adjacent layers/frames
Changes:
* With this patch we finally removed the LayerIndex class and member
  functions to access layers by index (like Sprite::firstLayer/layerLayer
  /layer/indexToLayer/layerToIndex() etc.). As layer groups can be
  expanded/collapsed, it doesn't make sense to use layer index to
  access layers directly from sprite.
* Now we use a layer_t (int) to access a list of browsable layers each
  time we want to iterate visible layers in the timeline.
* Replaced CelsRange() and Sprite::uniqueCels() param with
  SelectedFrames to iterate non-adjacent cels.
* Updated clipboard operations (copy/paste) in timeline to support
  layer groups.
* Updated Timeline control to support selecting multiple layer/frame
  ranges with Ctrl+ or Alt+click (fix #1157)
* Added more test units for DocumentRange operations (mainly for
  non-adjacent ranges).
2016-08-25 12:31:00 -03:00