aseskunk/src/aseskunk.lua

51 lines
1.3 KiB
Lua

local dlg
function init(plugin)
plugin:newCommand {
id = "SkunkTest",
title = "Skunk Test",
group = "cel_popup_properties",
onclick = function()
dlg = Dialog{
title = "AseSkunk",
onclose = function()
save_dlg_bounds(plugin)
end
}
dlg:button {
text = "meow",
onclick = function()
end
}
dlg:show {
wait = false
}
load_dlg_bounds(plugin)
end
}
end
function save_dlg_bounds(plugin)
plugin.preferences.dlg_bounds_x = dlg.bounds.x
plugin.preferences.dlg_bounds_y = dlg.bounds.y
plugin.preferences.dlg_bounds_width = dlg.bounds.width
plugin.preferences.dlg_bounds_height = dlg.bounds.height
end
function load_dlg_bounds(plugin)
if plugin.preferences.dlg_bounds_x then
app.alert("loading!")
dlg.bounds = Rectangle(
plugin.preferences.dlg_bounds_x,
plugin.preferences.dlg_bounds_y,
plugin.preferences.dlg_bounds_width,
plugin.preferences.dlg_bounds_height
)
end
end
function exit(plugin)
save_dlg_bounds(plugin)
end