This merge required fixing a problem in driver.love: load_settings now only triggers when a settings file is present. It seems like better practice to perform business logic within on.initialize. on.load_settings should only be initializing globals.
E6LI4DSVQTJOWXBPO4JIZ2FUSIJFCXQFK3TRRYGAE6SY46O24LKQC
Settings = {}
App_name = load_manifest()
print('app name', App_name)
love.window.setTitle('driver.love - '..App_name)
-- backstop any default settings for this app, and stash everything to a global for on.save_settings
if settings == nil then
Settings = {}
else
Settings = settings
end
if Settings[App_name] == nil then
Settings[App_name] = {}
Settings[App_name].viewport = Viewport
Settings[App_name].definitions = get_default_map()
end
Viewport = Settings[App_name].viewport
Definitions = Settings[App_name].definitions
local names = {}
for name, _ in pairs(Definitions) do
table.insert(names, name)
end
local defs = get_multiple_definitions_from_app(names)
for name, def_editor in pairs(Definitions) do
if def_editor.type == nil then
def_editor.type = 'text'
end
if def_editor.bg == nil then
def_editor.bg = definition_background_color(name)
end
if def_editor.width == nil then
def_editor.width = 600
end
if defs[name] then
def_editor.data = load_from_iterator(defs[name]:gmatch("[^\r\n]+"))
else
-- app doesn't know about this definition
-- just delete it from the driver for now
print('deleting', name)
Definitions[name] = nil
end
end
end
Settings = settings
end
App_name = load_manifest()
print('app name', App_name)
love.window.setTitle('driver.love - '..App_name)
-- backstop any default settings for this app, and stash everything to a global for on.save_settings
if Settings[App_name] == nil then
Settings[App_name] = {}
Settings[App_name].viewport = Viewport
Settings[App_name].definitions = get_default_map()
end
Viewport = Settings[App_name].viewport
Definitions = Settings[App_name].definitions
local names = {}
for name, _ in pairs(Definitions) do
table.insert(names, name)
end
local defs = get_multiple_definitions_from_app(names)
for name, def_editor in pairs(Definitions) do
if def_editor.type == nil then
def_editor.type = 'text'
end
if def_editor.bg == nil then
def_editor.bg = definition_background_color(name)
end
if def_editor.width == nil then
def_editor.width = 600
end
if defs[name] then
def_editor.data = load_from_iterator(defs[name]:gmatch("[^\r\n]+"))
else
-- app doesn't know about this definition
-- just delete it from the driver for now
print('deleting', name)
Definitions[name] = nil
end
end