Commit Graph

55 Commits

Author SHA1 Message Date
David Capello e39dc90001 [lua] Enclose key names for plugin preferences with ["..."] when it's required (#5412) 2025-09-19 15:27:00 -03:00
Martín Capello 8f0dea0988 Avoid syntax errors reading extension preferences
Fix #5412 by using brackets and double quotes to enclose the name of
the preferences' properties and avoid issues when they contain unicode
chars
2025-09-19 14:58:35 -03:00
Christian Kaiser 38bfd465ef Add .version and .displayName to Lua Plugin table 2025-01-07 11:19:21 -03:00
David Capello 09538f9a1a clang-format all files 2024-12-16 14:52:19 -03:00
Christian Kaiser 5860269358
Use new list_files, parse dates to check if sessions are old (#4660) 2024-09-19 15:50:02 -03:00
Christian Kaiser d62d279a34
Fix extensions wrongly being detected as "built-in" (#4625) 2024-09-04 15:42:47 -03:00
David Capello bf0a47545c Remove #if/endif ENABLE_UI conditional directives (fix #4619)
This was originated for #1279 (CLI-only Aseprite) which can be
achieved with LAF_BACKEND=none anyway.

In this way we simplify the development process, and checking for the
availability of the GUI can be done in run-time through App::isGui()
or Context::isUIAvailable().
2024-09-02 23:16:26 -03:00
David Capello e87f6df72b Avoid loading current dithering matrix on each mouse move (related to #4174)
With this change we are reusing the cached/loaded matrix on each
DitheringMatrixInfo struct, calling the
load_dithering_matrix_from_sprite() function just one time (not on
each brush preview/mouse movement).
2024-08-21 19:49:55 -03:00
Gaspar Capello 8f3af748b9
Don't allow to install third-party themes that override the default one (fix #4226) (#4335)
This 1) hides user themes whose name is the same as the default,
and are present in the user folders (i.e.  'extensions' and
'data/themes' folders), and 2) doesn't allow to install themes with
the same content/ID of the default aseprite-theme (fix #4226)
2024-07-29 16:02:05 -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
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
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 79745756ef Fix bug removing submenu-groups inside menu-groups created by plugins
Before this the ASSERT(group.items.empty()) in
AppMenus::removeMenuGroup() was failing when a plugin created
subgroups/submenus inside groups.

We have to remove plugins items in the reverse order that they were
added to uninstall them correctly.
2023-04-17 20:12:31 -03:00
David Capello d2fc1ae7b8 [lua] Add Plugin:newMenuSeparator() function 2023-03-20 18:25:21 -03:00
David Capello e4d3e7d4cf Add info about installed extensions w/Sentry breadcrumbs (#3729) 2023-03-13 16:12:03 -03:00
David Capello 23557a190b [lua] Add Plugin:newMenuGroup() to add submenus (fix #3731) 2023-03-09 16:41:37 -03:00
David Capello 88594bfa0e Merge branch 'main' into beta 2022-09-28 16:20:03 -03:00
Gaspar Capello 877ae9eeec Fix uninstalling (or updating) an extensions that has subdirectories results in an error (fix #3385)
Prior to this fix, any additional external files or directories within the Extension's directory tree, break the subdirectory removal iteration, resulting in empty subdirectories and a console error.
2022-09-22 11:30:48 -03:00
David Capello 8f44b521b6 Merge branch 'main' into beta 2022-06-10 10:31:13 -03:00
David Capello 39ba883f90 Fix bugs executing plugin init/exit() functions in different situations
Reinstalling a previously enabled plugin extension wasn't running the
init() function, and uninstalling it wasn't calling its exit()
function.
2022-06-07 15:02:54 -03:00
David Capello 2a59076f49 Merge branch 'main' into beta 2022-04-25 11:45:31 -03:00
David Capello 319824021b Keep plugin preferences when re-installing an extension (fix #3259) 2022-04-22 09:09:10 -03:00
David Capello 46626bb5ce Merge branch 'main' into beta 2022-04-13 23:01:12 -03:00
David Capello e4c2995326 Extensions now support defining keyboard shortcuts (#1403, #3239) 2022-04-13 22:46:48 -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 7ad1b7b965 Simplify handling of dithering matrices in extensions to avoid memory leaks 2020-04-23 23:41:08 -03:00
David Capello 5affdbbae1 Shox extensions in different categories in the Preferences dialog 2020-04-20 14:20:07 -03:00
David Capello ff3e9504fd Fix crash disabling extensions 2020-04-20 14:11:48 -03:00
David Capello c0d4264789 Fix crash loading some kind of .zip extensions w/filename w/Unicode chars 2020-04-17 10:58:47 -03:00
David Capello 2af6a0493e Fix recent list of files menu
This is a problem introduced with the plugin groups, but now we use a
group to store the list of recent files. With this commit we fixed
some bugs in the impl of menu groups.
2020-04-08 17:50:17 -03:00
David Capello 482fcd3b8c Fix crash when loading plugins from CLI and compilation when !ENABLE_UI 2020-04-07 10:56:48 -03:00
David Capello a7f3fc968a Fix compilation when !ENABLE_SCRIPTING 2020-04-07 10:44:26 -03:00
David Capello 298c2e24e8 Add possibility to put plugin:newCommand{} in specific menu locations identified as "groups" (#1949) 2020-04-02 23:18:08 -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 93c357a87e Take care of some special cases of extensions with __info.json inside 2018-11-28 10:31:02 -03:00
David Capello f2ed45e795 Replace base::UniquePtr -> std::unique_ptr 2018-08-08 17:27:26 -03:00
David Capello f481b979d4 win: Fix installing .zip extensions on Unicode paths
It looks like libarchive API is a little tricky, on Windows it needs
wide strings in the pathname. Even archive_entry_set_pathname_utf8()
cannot be used: there is no UTF8 -> wide string conversion inside
libarchive, I guess it's because archive_mstring_get_wcs() doesn't check
for AES_SET_UTF8 case.
2018-03-22 13:24:32 -03:00
David Capello 0e0b83b478 Now an extension can contain a language (#124, #1403) 2018-03-19 19:37:39 -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 72c1f9b765 Current theme can be uninstalled (so we can upgrade it)
Only the default theme cannot be uninstalled.
2017-06-23 15:19:00 -03:00
David Capello 7156c4ae98 Fix user extensions path on Windows 2017-06-23 15:09:41 -03:00
David Capello d0635c3c0b Fix construction of json11::Json object
Don't call Json() ctor directly (gcc error)
2017-06-23 10:29:24 -03:00
David Capello 81ccbee4a2 Safer method to delete installed extension files through __info.json 2017-06-23 08:29:21 -03:00
David Capello 4ccecdeda2 Show alert when we upgrade an existent extension 2017-06-23 07:53:31 -03:00
David Capello f37ccdc578 Replace taocpp/json with dropbox/json11 which compiles on MSVC 2017-06-14 19:50:44 -03:00
David Capello a20976d220 Move dithering matrices to extensions 2017-06-14 16:34:09 -03:00
David Capello 7ba6893ba2 Change path of user extensions to extensions/ instead of data/extensions/ 2017-06-14 12:06:30 -03:00
David Capello 919ce7c9d0 Uncompress extension in a folder named as the "name" attribute in the package.json file 2017-06-13 17:06:45 -03:00
David Capello 587b8b6dd7 Get default palette from extensions 2017-06-13 12:03:16 -03:00
David Capello c4d0273e4e Update themes list when extensions are enabled/disabled 2017-06-13 11:51:49 -03:00