* Add ability to apply settings to multiple selected layers at once.
* Clean up plugin plumbing.
This commit is contained in:
parent
82e1ab7523
commit
128258cd62
5 changed files with 94 additions and 83 deletions
|
@ -20,8 +20,7 @@ local function ExportSpritesheetAdvanced()
|
|||
spr:close()
|
||||
end
|
||||
|
||||
local function ToggleIgnore()
|
||||
local layer = app.layer
|
||||
local function toggleIgnoreLayer(layer)
|
||||
if (layer.properties(extKey).ignored) then
|
||||
layer.properties(extKey).ignored = false
|
||||
else
|
||||
|
@ -30,8 +29,17 @@ local function ToggleIgnore()
|
|||
colorUtils.SetColorFromRoot(layer)
|
||||
end
|
||||
|
||||
local function ToggleExportAsSprite()
|
||||
local layer = app.layer
|
||||
-- Toggle ignore for all selected layers
|
||||
-- TODO: should this behavior change when selected layers start with mixed state?
|
||||
local function ToggleIgnore()
|
||||
for _, layer in ipairs(app.range.layers) do
|
||||
toggleIgnoreLayer(layer)
|
||||
end
|
||||
end
|
||||
|
||||
local function toggleExportAsSpriteLayer(layer)
|
||||
if not layer.isGroup then return end
|
||||
|
||||
if (layer.properties(extKey).exportedAsSprite) then
|
||||
layer.properties(extKey).exportedAsSprite = false
|
||||
else
|
||||
|
@ -40,6 +48,14 @@ local function ToggleExportAsSprite()
|
|||
colorUtils.SetColorFromRoot(layer)
|
||||
end
|
||||
|
||||
-- Toggle Merge on Export for all selected group layers
|
||||
-- TODO: should this behavior change when selected layers start with mixed state?
|
||||
local function ToggleExportAsSprite()
|
||||
for _, layer in ipairs(app.range.layers) do
|
||||
toggleExportAsSpriteLayer(layer)
|
||||
end
|
||||
end
|
||||
|
||||
local export = {
|
||||
ExportSpritesheetAdvanced = ExportSpritesheetAdvanced,
|
||||
ToggleIgnore = ToggleIgnore,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue