예제 #1
0
 public void SetTarget(TCAModule user, WayPoint wp = null)
 {
     if (wp == null)
     {
         TargetUsers.Remove(user);
         if (TargetUsers.Count == 0)
         {
             CFG.Target = null;
             if (vessel.targetObject is WayPoint)
             {
                 Target = null;
             }
         }
     }
     else
     {
         if (user != null)
         {
             TargetUsers.Add(user);
         }
         var t = wp.GetTarget();
         if (IsActiveVessel && wp != CFG.Target)
         {
             FlightGlobals.fetch.SetVesselTarget(t, true);
         }
         else
         {
             Target = t;
         }
         CFG.Target = wp;
         CFG.Target.Update(this);
     }
 }
        public void SetTarget(TCAModule user, WayPoint wp = null)
        {
            if (wp == null)
            {
                TargetUsers.Remove(user);
                if (TargetUsers.Count == 0)
                {
                    CFG.Target = null;
                    if (vessel.targetObject is WayPoint)
                    {
                        Target = null;
                    }
                }
            }
            else
            {
                if (user != null)
                {
                    TargetUsers.Add(user);
                }
                var t = wp.GetTarget();
                if (IsActiveVessel && wp != CFG.Target)
                {
//                {
                    FlightGlobals.fetch.SetVesselTarget(t, true);
                }
//					Utils.Message("Target: {0}", t.GetName());
//                }
                else
                {
                    Target = t;
                }
                CFG.Target = wp;
            }
        }
예제 #3
0
        public void SetTarget(WayPoint wp = null)
        {
            CFG.Target = wp;
            var t = wp == null? null : wp.GetTarget();

            if (t != null && IsActiveVessel)
            {
                Utils.Message("Target: {0}", t.GetName());
            }
            Target = t;
        }
예제 #4
0
 public void UpdateTarget(WayPoint wp)
 {
     if(wp != null && CFG.Target && wp != CFG.Target)
     {
         var t = wp.GetTarget();
         if(IsActiveVessel)
             FlightGlobals.fetch.SetVesselTarget(t, true);
         else Target = t;
         CFG.Target = wp;
         CFG.Target.Update(this);
     }
 }