Files
OpenSpace/data/assets/base_keybindings.asset
Alexander Bock 57fafe48f4 Rename Lua function to bring them more in line with the function naming in C++ (#2840)
* Rename Lua function to bring them more in line with the function naming in C++
2023-08-05 19:20:08 +02:00

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)