public void ButtonNodeExecute(bool state) { MechJebCore activeJeb = vessel.GetMasterMechJeb(); if (activeJeb == null) { return; } MechJebModuleManeuverPlanner mp = activeJeb.GetComputerModule <MechJebModuleManeuverPlanner>(); if (mp == null) { return; } if (state) { if (!activeJeb.node.enabled) { activeJeb.node.ExecuteOneNode(mp); } } else { activeJeb.node.Abort(); } }
public bool ButtonNodeExecuteState() { MechJebCore activeJeb = vessel.GetMasterMechJeb(); if (activeJeb == null) { return(false); } MechJebModuleManeuverPlanner mp = activeJeb.GetComputerModule <MechJebModuleManeuverPlanner>(); return(mp != null && activeJeb.node.enabled); }
private void ExecuteNode(int index, TextMenu.Item tmi) { UpdateJebReferences(); if (activeJeb != null) { MechJebModuleManeuverPlanner mp = activeJeb.GetComputerModule <MechJebModuleManeuverPlanner>(); if (mp != null) { // We have a valid maneuver planner, which means we can // tell MJ to execute a node. Or abort a node. if (activeJeb.node.enabled) { activeJeb.node.Abort(); } else { activeJeb.node.ExecuteOneNode(mp); } } } }