Add the ability to toggle planets in the customization/globebrowsing.asset (closes #1392)

Improve the handling of reading info files that have error messages
This commit is contained in:
Alexander Bock
2020-11-18 21:43:14 +01:00
parent 0a43247328
commit 88cab58f09
2 changed files with 44 additions and 12 deletions
@@ -205,11 +205,22 @@ openspace.globebrowsing.parseInfoFile = function (file)
HeightFile = nil
local dir = openspace.directoryForPath(file)
dofile(file)
file_func, error = loadfile(file)
if file_func then
file_func()
else
openspace.printError('Error loading file "' .. file .. '": '.. error)
return nil, nil, nil, nil
end
local name = Name or Identifier
local identifier = Identifier or Name
if name == nil and identifier == nil then
openspace.printError('Error loading file "' .. file .. '": No "Name" or "Identifier" found')
return nil, nil, nil, nil
end
local color = nil
if ColorFile then
color = {