local ToggleTrailsInstant = {
  Identifier = "os.ToggleTrailsInstant",
  Name = "Toggle planet and moon trails (instant)",
  Command = [[
    local list = openspace.getProperty("{planetTrail_solarSystem}.Renderable.Enabled")
    for _,v in pairs(list) do
      openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v))
    end

    local moonlist = openspace.getProperty("{moonTrail_solarSystem}.Renderable.Enabled")
    for _,v in pairs(moonlist) do
      openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v))
    end
  ]],
  Documentation = "Toggles the visibility of planet and moon trails",
  GuiPath = "/Solar System",
  IsLocal = false
}


asset.onInitialize(function()
  openspace.action.registerAction(ToggleTrailsInstant)
end)

asset.onDeinitialize(function()
  openspace.action.removeAction(ToggleTrailsInstant)
end)

asset.export("ToggleTrailsInstant", ToggleTrailsInstant.Identifier)
