mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-22 12:59:07 -06:00
Reload UI after adding screenspace renderables or assets (closes #1703)
This commit is contained in:
@@ -29,16 +29,18 @@ is_image_file = function(extension)
|
||||
extension == ".pic" or extension == ".pnm"
|
||||
end
|
||||
|
||||
local ReloadUIScript = [[ if openspace.hasProperty('Modules.CefWebGui.Reload') then openspace.setPropertyValue('Modules.CefWebGui.Reload', nil) end ]]
|
||||
|
||||
if is_image_file(extension) then
|
||||
identifier = basename_without_extension:gsub(" ", "_")
|
||||
return [[openspace.addScreenSpaceRenderable({
|
||||
Identifier = "]] .. identifier .. [[",
|
||||
Type = "ScreenSpaceImageLocal",
|
||||
TexturePath = "]] .. filename .. [["
|
||||
});]]
|
||||
});]] .. ReloadUIScript
|
||||
elseif extension == ".asset" then
|
||||
return [[openspace.printInfo("Adding asset: ']] .. filename .. [[' (drag-and-drop)");
|
||||
openspace.asset.add("]] .. filename .. [[");]]
|
||||
openspace.asset.add("]] .. filename .. [[");]] .. ReloadUIScript
|
||||
elseif extension == ".osrec" or extension == ".osrectxt" then
|
||||
return [[openspace.sessionRecording.startPlayback("]] .. basename .. [[")]]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user