Files
OpenSpace/data/assets/modules/skybrowser/hover_circle.asset
Emma Broman 19f0f707dc Issue/2174 - Show items with no GUI tag in asset in the GUI (#3133)
* Always add GUI properties, even if tag is not in the asset

To make objects wihtout GUI tag be included in the UI

* Hide the hover circle, to clean up scene menu list a little

* set root node gui hidden property to true

* Properly add the gui properties for all scene graph nodes (even root)

* Update GUI hash
2024-04-03 09:23:49 +02:00

54 lines
1.3 KiB
Lua

local transforms = asset.require("scene/solarsystem/sun/transforms")
local imageFolder = asset.resource({
Name = "Hover Circle Image",
Type = "HttpSynchronization",
Identifier = "misc_ring_image",
Version = 1
})
local circle = {
Identifier = "hoverCircle",
Parent = transforms.SolarSystemBarycenter.Identifier,
Renderable = {
Type = "RenderablePlaneImageLocal",
Size = 3.0E15,
Origin = "Center",
Billboard = true,
Texture = imageFolder .. "ring.png"
},
GUI = {
Name = "Hover Circle",
Description = [[A circular marker that shows the position on the night sky
of the object hovered in the sky browser UI. The circle will hide/show up
dynamically, depending on the interaction with the items in the UI]],
Path = "/SkyBrowser",
Hidden = true
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(circle)
openspace.skybrowser.setHoverCircle("hoverCircle")
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(circle)
end)
asset.export(circle)
asset.meta = {
Name = "SkyBrowser Hover Circle",
Version = "1.0",
Description = [[Includes a circular marker that shows the position on the night sky
of the object hovered in the sky browser UI]],
Author = "OpenSpace Team",
URL = "http://openspaceproject.com",
License = "MIT license"
}