Add new action to toggle dwarf planet visibility (closes #2674)

This commit is contained in:
Alexander Bock
2023-06-01 10:45:41 +02:00
parent 0c49bcf027
commit 3727d5ad71
2 changed files with 35 additions and 1 deletions

View File

@@ -0,0 +1,35 @@
local ToggleDwarfPlanetTrails = {
Identifier = "os.ToggleDwarfPlanetTrails",
Name = "Toggle dwarf planet trails",
Command = [[
local list = openspace.getProperty("{planetTrail_dwarf}.Renderable.Enabled")
for _,v in pairs(list) do
openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v))
end
]],
Documentation = "Toggle on/off trails for all dwarf planets in the solar system",
GuiPath = "/Trails",
IsLocal = true
}
asset.onInitialize(function()
openspace.action.registerAction(ToggleDwarfPlanetTrails)
end)
asset.onDeinitialize(function()
openspace.action.removeAction(ToggleDwarfPlanetTrails)
end)
asset.export("ToggleDwarfPlanetTrails", ToggleDwarfPlanetTrails.Identifier)
asset.meta = {
Name = "Actions - Toggle Dwarf Planet Trails",
Version = "1.0",
Description = "Asset providing actions to toggle all dwarf planet trails on and off",
Author = "OpenSpace Team",
URL = "http://openspaceproject.com",
License = "MIT license"
}

View File

@@ -28,7 +28,6 @@ local PlutoKeplerianTrail = {
Resolution = 1000,
Enabled = false
},
Tag = { "planetTrail_dwarf" },
GUI = {
Name = "Pluto Keplerian Trail",
Path = "/Solar System/Dwarf Planets/Pluto",