Files
OpenSpace/data/assets/base_keybindings.asset
Alexander Bock 705c898ccd Asset File cleanup (#2713)
* Updating all assets to new coding style
* Cleaning up asset files
* Moving default_actions and default_keybindings files
* Changing procedural globes to explicitly specified globes
* Move Spice loading explicitly to the initialize part and also deinitialize
* Removing unused asset files
  * Removing asset_helper
  * Removing scale_model_helper asset
  * Removing script_scheduler_helper
  * Removing testing_keybindings
  * Remove procedural_globe
2023-05-28 17:23:20 +02:00

36 lines
1012 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.getProperty("{solarsystem_labels}.Renderable.Enabled")
for _,v in pairs(list) do
openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(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)