mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-05 19:19:39 -06:00
- Add new action to instantly toggle all trails - Instead of 'H', the 'T' keybind now toggles all trails - Shift+T instantly toggles trails - Instead of 'W', the 'B' toggles the blackout of the rendering
38 lines
1.1 KiB
Lua
38 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)
|