Skip to content

Commit

Permalink
Add back the Ascent AP Toggle
Browse files Browse the repository at this point in the history
not sure why i deleted that, but it did have to change because of the
restructuring of the ascent autopilots.

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
  • Loading branch information
lamont-granquist committed Jun 23, 2023
1 parent 04637be commit 6048d7c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions MechJeb2/MechJebCore.cs
Expand Up @@ -280,6 +280,23 @@ public void OnTranslatronToggleHSAction(KSPActionParam param)
}
}

[KSPAction("#MechJeb_AscentAPtoggle")] //Ascent AP toggle
public void OnAscentAPToggleAction(KSPActionParam param)
{
MechJebCore masterMechJeb = vessel.GetMasterMechJeb();

MechJebModuleAscentBaseAutopilot autopilot = masterMechJeb.AscentSettings.AscentAutopilot;
MechJebModuleAscentMenu ascentMenu = GetComputerModule<MechJebModuleAscentMenu>();

if (autopilot == null || ascentMenu == null)
return;

if (autopilot.Enabled)
autopilot.aUsers.Remove(ascentMenu);
else
autopilot.Users.Add(ascentMenu);
}

private void EngageTranslatronControl(MechJebModuleThrustController.TMode mode)
{
MechJebCore masterMechJeb = vessel.GetMasterMechJeb();
Expand Down

0 comments on commit 6048d7c

Please sign in to comment.