local ToggleMoonShading = {
  Identifier = "os.apollo.ToggleMoonShading",
  Name = "Toggle Moon shading",
  Command = [[
    openspace.setPropertyValueSingle(
      "Scene.Moon.Renderable.PerformShading",
      not openspace.getPropertyValue("Scene.Moon.Renderable.PerformShading")
    )
  ]],
  Documentation = "Toggles the shading of the Moon",
  GuiPath = "/Missions/Apollo",
  isLocal = false
}

local FocusMoon = {
  Identifier = "os.apollo.FocusMoon",
  Name = "Focus on Moon",
  Command = [[
    openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.Aim", "")
    openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.Anchor", "Moon")
    openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.RetargetAnchor", nil)
  ]],
  Documentation = "Set camera focus on the Moon",
  GuiPath = "/Missions/Apollo",
  isLocal = false
}

local FocusEarth = {
  Identifier = "os.apollo.FocusEarth",
  Name = "Focus on Earth",
  Command = [[
    openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.Aim", "")
    openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.Anchor", "Earth")
    openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.RetargetAnchor", nil)
  ]],
  Documentation = "Set camera focus on the Earth",
  GuiPath = "/Missions/Apollo",
  isLocal = false
}


asset.onInitialize(function()
  openspace.action.registerAction(ToggleMoonShading)
  openspace.action.registerAction(FocusMoon)
  openspace.action.registerAction(FocusEarth)
end)

asset.onDeinitialize(function()
  openspace.action.removeAction(FocusEarth)
  openspace.action.removeAction(FocusMoon)
  openspace.action.removeAction(ToggleMoonShading)
end)



asset.meta = {
  Name = "Actions - Apollo missions",
  Version = "1.0",
  Description = "Actions related to the Apollo missions",
  Author = "OpenSpace Team",
  URL = "http://openspaceproject.com",
  License = "MIT license"
}
