mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-30 07:49:31 -05:00
0b91fd2642
- Lua style guides - FrameConversions - unloadMission, Add mission identifiers
39 lines
1.1 KiB
Lua
39 lines
1.1 KiB
Lua
asset.require("./base")
|
|
local allTrailsAction = asset.require("actions/trails/toggle_all_trails").ToggleTrails
|
|
local allTrailsInstantAction = asset.require("actions/trails/toggle_all_trails").ToggleTrailsInstant
|
|
|
|
|
|
|
|
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
|
|
}
|
|
|
|
|
|
asset.onInitialize(function()
|
|
openspace.action.registerAction(TogglePlanetLabels)
|
|
openspace.bindKey("L", TogglePlanetLabels.Identifier)
|
|
|
|
openspace.bindKey("T", allTrailsAction)
|
|
openspace.bindKey("SHIFT+T", allTrailsInstantAction)
|
|
end)
|
|
|
|
asset.onDeinitialize(function()
|
|
openspace.clearKey("SHIFT+T")
|
|
openspace.clearKey("T")
|
|
|
|
openspace.action.removeAction(TogglePlanetLabels)
|
|
openspace.clearKey("L")
|
|
end)
|
|
|
|
asset.export("TogglePlanetLabels", TogglePlanetLabels.Identifier)
|