mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-20 02:58:31 -05:00
Issue/2000 automatically update gui (#3289)
* Make it possible to query a propertyowner by uri with the getpropertytopic * Remove automatic reloading of ui from drag and drop script * Add function for uri for propertyowners * Add uri to the to_json for the propertyowner * Add comment for the propertyOwner function and update the comment for the property function to clearer distinguish between uris and identifiers * Go back to the old events but with uris instead as their member * Apply feedback from PR * Address PR comments --------- Co-authored-by: Ylva Selling <ylva.selling@liu.se>
This commit is contained in:
@@ -47,30 +47,28 @@ local is_geojson_file = function(extension)
|
||||
return extension == ".geojson"
|
||||
end
|
||||
|
||||
local ReloadUIScript = [[ if openspace.hasProperty('Modules.CefWebGui.Reload') then openspace.setPropertyValue('Modules.CefWebGui.Reload', nil) end ]]
|
||||
|
||||
if is_image_file(extension) then
|
||||
return [[
|
||||
openspace.addScreenSpaceRenderable({
|
||||
Identifier = openspace.makeIdentifier("]] .. basename_without_extension .. [["),
|
||||
Type = "ScreenSpaceImageLocal",
|
||||
TexturePath = "]] .. filename .. [["
|
||||
});]] .. ReloadUIScript
|
||||
});]]
|
||||
elseif is_video_file(extension) then
|
||||
return [[
|
||||
openspace.addScreenSpaceRenderable({
|
||||
Identifier = openspace.makeIdentifier("]] .. basename_without_extension .. [["),
|
||||
Type = "ScreenSpaceVideo",
|
||||
Video = "]] .. filename .. [["
|
||||
});]] .. ReloadUIScript
|
||||
});]]
|
||||
elseif is_asset_file(extension) then
|
||||
return [[
|
||||
if openspace.asset.isLoaded("]] .. filename .. [[") ~= true then
|
||||
openspace.printInfo("Adding asset: ']] .. filename .. [[' (drag-and-drop)");
|
||||
end
|
||||
openspace.asset.add("]] .. filename .. '");' .. ReloadUIScript
|
||||
openspace.asset.add("]] .. filename .. '");'
|
||||
elseif is_recording_file(extension) then
|
||||
return 'openspace.sessionRecording.startPlayback("' .. filename .. '")'
|
||||
elseif is_geojson_file(extension) then
|
||||
return 'openspace.globebrowsing.addGeoJsonFromFile("' .. filename .. '")' .. ReloadUIScript
|
||||
return 'openspace.globebrowsing.addGeoJsonFromFile("' .. filename .. '")'
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user