local EarthRise = {
  Identifier = "os.apollo8.SetupEarthrise",
  Name = "Set Earthrise time",
  Command = [[
    openspace.time.setPause(true)
    openspace.time.setDeltaTime(1)
    openspace.time.setTime("1968 DEC 24 16:37:31")
    openspace.navigation.setNavigationState({
      Anchor = "Apollo8",
      Position = { 14.94592, 32.36777, -41.71296 },
      ReferenceFrame = "Root",
      Up = { 0.960608, -0.212013, 0.179675 }
    })
    openspace.setPropertyValue("*Trail.Renderable.Enabled", false)
  ]],
  Documentation = "Jump to right before the earthrise photo",
  GuiPath = "/Missions/Apollo/8",
  IsLocal = false
}

local Launch = {
  Identifier = "os.apollo8.SetupLaunch",
  Name = "Set Apollo 8 launch time",
  Command = [[
    openspace.time.setTime("1968-12-21T12:51:37.00")
    openspace.setPropertyValueSingle("Scene.Apollo8LaunchTrail.Renderable.Enabled", true)
  ]],
  Documentation = "Jump to time right before Apollo 8 liftoff, with its trail enabled",
  GuiPath = "/Missions/Apollo/8",
  IsLocal = false
}


asset.onInitialize(function()
  openspace.action.registerAction(EarthRise)
  openspace.action.registerAction(Launch)
end)

asset.onDeinitialize(function()
  openspace.action.removeAction(Launch)
  openspace.action.removeAction(EarthRise)
end)

asset.export("EarthRise", EarthRise.Identifier)
asset.export("Launch", Launch.Identifier)



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