Add new keybindings Shift+H to toggle all trails including the ISS (closes #3005)

This commit is contained in:
Alexander Bock
2024-01-24 14:58:54 +01:00
parent 04ff09814d
commit 689bae756a

View File

@@ -1,5 +1,6 @@
asset.require("./base")
local trailAction = asset.require("actions/trails/toggle_trails_planets_moons").ToggleTrails
local allTrailsAction = asset.require("actions/trails/toggle_all_trails").ToggleTrails
@@ -14,22 +15,23 @@ local TogglePlanetLabels = {
]],
Documentation = "Turns on visibility for all solar system labels",
GuiPath = "/Solar System",
IsLocal = false,
Key = "l"
IsLocal = false
}
asset.onInitialize(function()
openspace.action.registerAction(TogglePlanetLabels)
openspace.bindKey(TogglePlanetLabels.Key, TogglePlanetLabels.Identifier)
openspace.bindKey("L", TogglePlanetLabels.Identifier)
openspace.bindKey("h", trailAction)
openspace.bindKey("H", trailAction)
openspace.bindKey("SHIFT+H", allTrailsAction)
end)
asset.onDeinitialize(function()
openspace.clearKey("h")
openspace.clearKey("SHIFT+H")
openspace.clearKey("H")
openspace.action.removeAction(TogglePlanetLabels)
openspace.clearKey(TogglePlanetLabels.Key)
openspace.clearKey("L")
end)
asset.export("TogglePlanetLabels", TogglePlanetLabels.Identifier)