driver.love/0062-on.save_settings

20 lines
532 B
Plaintext

on.save_settings = function()
if Settings == nil then
Settings = {} -- just for initial schema migration
end
for key,node in pairs(Definitions) do
if type(key) == 'number' then
-- can't save the array side for now because of a limitation in the
Definitions[key] = nil
else
node.data = nil -- don't save uncommitted data for now
node.show_cursor = nil
node.editor = nil -- TODO: check for hierarchy
end
end
Settings[App_name] = {
viewport=Viewport,
definitions=Definitions,
}
return Settings
end