2024-07-30 01:25:14 +00:00
|
|
|
extKey = "annabunches/abase" -- this must come before we require 'abase-commands'
|
|
|
|
|
|
|
|
local cmd = require "abase-commands"
|
2024-07-30 03:22:57 +00:00
|
|
|
local listeners = require "abase-listeners"
|
2024-07-22 23:01:26 +00:00
|
|
|
|
|
|
|
function init(plugin)
|
|
|
|
plugin:newCommand{
|
2024-07-30 02:30:13 +00:00
|
|
|
id="ABASEExportSpritesheetAdvanced",
|
2024-07-22 23:01:26 +00:00
|
|
|
title="Export Spritesheet (Advanced)",
|
2024-07-30 01:25:14 +00:00
|
|
|
group="file_export_1",
|
|
|
|
onclick=function()
|
|
|
|
cmd.ExportSpritesheetAdvanced()
|
|
|
|
end,
|
|
|
|
onenabled=function()
|
|
|
|
return app.activeSprite ~= nil
|
|
|
|
end
|
|
|
|
}
|
|
|
|
|
|
|
|
plugin:newMenuSeparator{
|
|
|
|
group="layer_popup_merge"
|
2024-07-22 23:01:26 +00:00
|
|
|
}
|
|
|
|
|
2024-07-30 02:30:13 +00:00
|
|
|
plugin:newMenuSeparator{
|
|
|
|
group="layer_merge"
|
|
|
|
}
|
|
|
|
|
|
|
|
plugin:newMenuGroup{
|
|
|
|
id="abase_layer_settings",
|
|
|
|
title="Advanced Export",
|
|
|
|
group="layer_merge",
|
|
|
|
}
|
|
|
|
|
|
|
|
plugin:newMenuGroup{
|
|
|
|
id="abase_layer_settings_popup",
|
|
|
|
title="Advanced Export",
|
2024-07-30 01:25:14 +00:00
|
|
|
group="layer_popup_merge",
|
2024-07-30 02:30:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
plugin:newCommand{
|
|
|
|
id="ABASEToggleIgnoreLayer",
|
|
|
|
title="Toggle Ignore",
|
|
|
|
group="abase_layer_settings",
|
2024-07-30 01:25:14 +00:00
|
|
|
onclick=function()
|
|
|
|
cmd.ToggleIgnore()
|
|
|
|
end
|
2024-07-22 23:01:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
plugin:newCommand{
|
2024-07-30 02:30:13 +00:00
|
|
|
id="ABASEToggleIgnoreLayerPopup",
|
|
|
|
title="Toggle Ignore",
|
|
|
|
group="abase_layer_settings_popup",
|
|
|
|
onclick=function()
|
|
|
|
cmd.ToggleIgnore()
|
|
|
|
end
|
|
|
|
}
|
|
|
|
|
|
|
|
plugin:newCommand{
|
|
|
|
id="ABASEToggleExportAsSprite",
|
|
|
|
title="Toggle Merge Group",
|
|
|
|
group="abase_layer_settings",
|
|
|
|
onclick=function()
|
|
|
|
cmd.ToggleExportAsSprite()
|
|
|
|
end,
|
|
|
|
onnenabled=function()
|
|
|
|
return app.layer.isGroup
|
|
|
|
end
|
|
|
|
}
|
|
|
|
|
|
|
|
plugin:newCommand{
|
|
|
|
id="ABASEToggleExportAsSpritePopup",
|
|
|
|
title="Toggle Merge Group",
|
|
|
|
group="abase_layer_settings_popup",
|
2024-07-30 01:25:14 +00:00
|
|
|
onclick=function()
|
|
|
|
cmd.ToggleExportAsSprite()
|
|
|
|
end,
|
|
|
|
onnenabled=function()
|
|
|
|
return app.layer.isGroup
|
2024-07-22 23:01:26 +00:00
|
|
|
end
|
|
|
|
}
|
2024-07-30 03:22:57 +00:00
|
|
|
|
|
|
|
app.events:on(
|
|
|
|
"aftercommand",
|
|
|
|
function(ev)
|
|
|
|
if (ev.name == "NewLayer") then
|
|
|
|
listeners.RecolorLayers()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
)
|
2024-07-30 01:25:14 +00:00
|
|
|
end
|