Files
OpenSpace/data/assets/base_keybindings.asset
Alexander Bock 67d114755c Shifting the keybindings (closes #1055)
- 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
2024-02-27 20:56:50 +01:00

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)