void DrawMapViewTarget()
        {
            if (HighLogic.LoadedSceneIsEditor)
            {
                return;
            }
            if (!MapView.MapIsEnabled)
            {
                return;
            }
            if (!vessel.isActiveVessel || vessel.GetMasterMechJeb() != core)
            {
                return;
            }

            if (target == null)
            {
                return;
            }
            if (!(target is PositionTarget) && !(target is Vessel))
            {
                return;
            }
            if ((target is Vessel) && (!((Vessel)target).LandedOrSplashed || (((Vessel)target).mainBody != vessel.mainBody)))
            {
                return;
            }
            if (target is DirectionTarget)
            {
                return;
            }

            GLUtils.DrawMapViewGroundMarker(targetBody, targetLatitude, targetLongitude, Color.red);
        }
        void DoCoordinatePicking()
        {
            if (pickingPositionTarget && !MapView.MapIsEnabled)
            {
                pickingPositionTarget = false;                                                 //stop picking on leaving map view
            }
            if (!pickingPositionTarget)
            {
                return;
            }

            if (MapView.MapIsEnabled && vessel.isActiveVessel)
            {
                if (!GuiUtils.MouseIsOverWindow(core))
                {
                    Coordinates mouseCoords = GuiUtils.GetMouseCoordinates(mainBody);

                    if (mouseCoords != null)
                    {
                        GLUtils.DrawMapViewGroundMarker(mainBody, mouseCoords.latitude, mouseCoords.longitude, new Color(1.0f, 0.56f, 0.0f));
                        GUI.Label(new Rect(Input.mousePosition.x + 15, Screen.height - Input.mousePosition.y, 200, 50), mouseCoords.ToStringDecimal());

                        if (Input.GetMouseButtonDown(0))
                        {
                            SetPositionTarget(mainBody, mouseCoords.latitude, mouseCoords.longitude);
                            pickingPositionTarget = false;
                        }
                    }
                }
            }
        }
Exemple #3
0
 void DoMapView()
 {
     ReentrySimulation.Result drawnResult = GetResult();
     if (MapView.MapIsEnabled && this.enabled && drawnResult != null)
     {
         if (drawnResult.outcome == ReentrySimulation.Outcome.LANDED)
         {
             GLUtils.DrawMapViewGroundMarker(drawnResult.body, drawnResult.endPosition.latitude, drawnResult.endPosition.longitude, Color.blue, 60);
         }
     }
 }
        void DoMapView()
        {
            if (MapView.MapIsEnabled && vessel.isActiveVessel && this.enabled)
            {
                ReentrySimulation.Result drawnResult = GetResult();
                if (drawnResult != null)
                {
                    if (drawnResult.outcome == ReentrySimulation.Outcome.LANDED)
                    {
                        GLUtils.DrawMapViewGroundMarker(drawnResult.body, drawnResult.endPosition.latitude, drawnResult.endPosition.longitude, Color.blue, 60);
                    }

                    if (showTrajectory && drawnResult.outcome != ReentrySimulation.Outcome.ERROR && drawnResult.outcome != ReentrySimulation.Outcome.NO_REENTRY)
                    {
                        double interval = (drawnResult.endUT - drawnResult.input_UT) / 100;
                        GLUtils.DrawPath(drawnResult.body, drawnResult.WorldTrajectory(interval, worldTrajectory), Color.red);
                    }
                }
            }
        }