Add keyboard shortcuts.

This commit is contained in:
Anna Rose Wiggins 2024-07-30 20:44:35 -04:00 committed by annabunches
parent 93408efb9e
commit cb8e2791e7
5 changed files with 26 additions and 14 deletions

View File

@ -1,2 +1,2 @@
all: all:
zip ./advanced-spritesheets.aseprite-extension *.lua package.json LICENSE zip ./advanced-spritesheets.aseprite-extension *.lua *.aseprite-keys package.json LICENSE

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<keyboard version="1">
<commands>
<key command="ABASEExportSpritesheetAdvanced" shortcut="Ctrl+Alt+E" mac="Ctrl+Cmd+E"/>
<key command="ABASEToggleIgnoreLayer" shortcut="Ctrl+Alt+I" mac="Ctrl+Cmd+I"/>
<key command="ABASEToggleExportAsSprite" shortcut="Ctrl+Alt+M" mac="Ctrl+Cmd+M"/>
</commands>
</keyboard>

View File

@ -59,9 +59,11 @@ function init(plugin)
title="Toggle Merge Group", title="Toggle Merge Group",
group="abase_layer_settings", group="abase_layer_settings",
onclick=function() onclick=function()
cmd.ToggleExportAsSprite() if app.layer.isGroup then
cmd.ToggleExportAsSprite()
end
end, end,
onnenabled=function() onenabled=function()
return app.layer.isGroup return app.layer.isGroup
end end
} }
@ -71,9 +73,11 @@ function init(plugin)
title="Toggle Merge Group", title="Toggle Merge Group",
group="abase_layer_settings_popup", group="abase_layer_settings_popup",
onclick=function() onclick=function()
cmd.ToggleExportAsSprite() if app.layer.isGroup then
cmd.ToggleExportAsSprite()
end
end, end,
onnenabled=function() onenabled=function()
return app.layer.isGroup return app.layer.isGroup
end end
} }

View File

@ -2,18 +2,18 @@
"name": "advanced-spritesheets", "name": "advanced-spritesheets",
"displayName": "Advanced Spritesheets", "displayName": "Advanced Spritesheets",
"description": "Improved spritesheet export functionality for Aseprite.", "description": "Improved spritesheet export functionality for Aseprite.",
"version": "0.0.3", "version": "0.0.6",
"author": { "name": "Anna Wiggins", "author": { "name": "Anna Wiggins",
"email": "annabunches@gmail.com", "email": "annabunches@gmail.com",
"url": "https://annabunches.net" }, "url": "https://annabunches.net" },
"license": "GPL-3.0", "license": "GPL-3.0",
"categories": [ "Scripts" ], "categories": [ "Scripts", "Keys" ],
"contributes": { "contributes": {
"scripts": [ "scripts": [
{ "path": "./advanced-spritesheet-export.lua" }, { "path": "./advanced-spritesheet-export.lua" }
{ "path": "./abase-listeners.lua" }, ],
{ "path": "./abase-commands.lua" }, "keys": [
{ "path": "./abase-sprite.lua" } { "path": "./advanced-spritesheet-export.aseprite-keys"}
] ]
} }
} }

View File

@ -13,9 +13,9 @@ To install, go to Aseprite's Settings -> Extensions -> Add Extension, and select
## Usage ## Usage
* All layers are exported by default. To ignore a layer or group, select Layer -> Advanced Export -> Toggle Ignore. * All layers are exported by default. To ignore the active layer or group, select Layer -> Advanced Export -> Toggle Ignore. (default keyboard shortcut: Ctrl+Alt+I)
* To export a layer group as a single sprite, select Layer -> Advanced Export -> Toggle Merge Group. * To export a layer group as a single sprite, select Layer -> Advanced Export -> Toggle Merge Group. (default keyboard shortcut: Ctrl+Alt+M)
* Invoke the tool via File -> Export -> Export Sprite Sheet (Advanced). * Invoke the tool via File -> Export -> Export Sprite Sheet (Advanced). (default keyboard shortcut: Ctrl+Alt+E)
## Additional Notes ## Additional Notes