Última atividade 1751859074

Revisão e4b2fd9992a7e454f34a2798b912b40490d947ea

Export Nova.lua Bruto Playground
1local dialog = Dialog()
2dialog:file{
3 id = "save_location",
4 label = "Save Location",
5 title = "Save Nova",
6 save = true,
7 filetypes = { "nv" },
8}
9dialog:button {
10 id = "save_button",
11 text = "Save",
12 onclick = function()
13 local sprite = app.sprite
14 local nova = {"||\n"}
15 for i, slice in ipairs(sprite.slices) do
16 table.insert(nova, ":slice:\n")
17 local x, y, w, h = slice.bounds.x, slice.bounds.y, slice.bounds.w, slice.bounds.h
18 table.insert(nova, (" . dimensions %d %d %d %d\n"):format(x, y, w, h))
19 table.insert(nova, (" . name %s\n"):format(slice.name))
20 end
21 local save_location = dialog.data.save_location
22 if save_location then
23 local file = io.open(save_location, "w")
24 file:write(table.concat(nova))
25 file:close()
26 end
27 end
28}
29local data = dialog:show().data