Exemplo n.º 1
0
 private BoosterGuidanceCore CheckCore(Vessel vessel)
 {
     if (core == null)
     {
         core = BoosterGuidanceCore.GetBoosterGuidanceCore(vessel);
         if (core != null)
         {
             UpdateFromCore();
             Targets.SetVisibility(showTargets, showTargets && core.Enabled() && (FlightGlobals.ActiveVessel == core.vessel));
         }
         else
         {
             return(core);
         }
     }
     else
     {
         if (core.vessel != vessel)
         {
             Debug.Log("[BoosterGuidance] core.vessel!=vessel vessel=" + vessel + " map=" + MapView.MapIsEnabled);
             // Get new BoosterGuidanceCore as vessel changed
             core = BoosterGuidanceCore.GetBoosterGuidanceCore(vessel);
             UpdateFromCore();
         }
     }
     if (core == null)
     {
         Debug.Log("[BoosterGuidance] Vessel " + vessel.name + " has no BoosterGuidanceCore");
     }
     return(core);
 }
Exemplo n.º 2
0
        void EnableGuidance(BLControllerPhase phase)
        {
            BoosterGuidanceCore core  = BoosterGuidanceCore.GetBoosterGuidanceCore(FlightGlobals.ActiveVessel);
            KSPActionParam      param = new KSPActionParam(KSPActionGroup.None, KSPActionType.Activate);

            core.useFAR = hasFAR;
            Debug.Log("[BoosterGuidance] Vessel=" + FlightGlobals.ActiveVessel.name + " useFAR=" + core.useFAR);
            core.EnableGuidance(param);
            core.SetPhase(phase);
        }
Exemplo n.º 3
0
        void DisableGuidance()
        {
            BoosterGuidanceCore core = BoosterGuidanceCore.GetBoosterGuidanceCore(FlightGlobals.ActiveVessel);

            core.DisableGuidance();
        }