mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-09 04:59:56 -06:00
36 lines
1006 B
Lua
36 lines
1006 B
Lua
asset.require("./base")
|
|
local trailAction = asset.require("actions/trails/toggle_trails_planets_moons").ToggleTrails
|
|
|
|
|
|
|
|
local TogglePlanetLabels = {
|
|
Identifier = "os_default.TogglePlanetLabels",
|
|
Name = "Toggle planet labels",
|
|
Command = [[
|
|
local list = openspace.property("{solarsystem_labels}.Renderable.Enabled")
|
|
for _,v in pairs(list) do
|
|
openspace.setPropertyValueSingle(v, not openspace.propertyValue(v))
|
|
end
|
|
]],
|
|
Documentation = "Turns on visibility for all solar system labels",
|
|
GuiPath = "/Solar System",
|
|
IsLocal = false,
|
|
Key = "l"
|
|
}
|
|
|
|
asset.onInitialize(function()
|
|
openspace.action.registerAction(TogglePlanetLabels)
|
|
openspace.bindKey(TogglePlanetLabels.Key, TogglePlanetLabels.Identifier)
|
|
|
|
openspace.bindKey("h", trailAction)
|
|
end)
|
|
|
|
asset.onDeinitialize(function()
|
|
openspace.clearKey("h")
|
|
|
|
openspace.action.removeAction(TogglePlanetLabels)
|
|
openspace.clearKey(TogglePlanetLabels.Key)
|
|
end)
|
|
|
|
asset.export("TogglePlanetLabels", TogglePlanetLabels.Identifier)
|