Ejemplo n.º 1
0
        private void doCoordinatePicking()
        {
            if (pickingActive && !MapView.MapIsEnabled)
            {
                pickingActive = false;
                close();
            }

            CelestialBody body = PlanetariumCamera.fetch.target.celestialBody;

            if (body == null)
            {
                Vessel vessel = PlanetariumCamera.fetch.target.vessel;
                if (vessel != null)
                {
                    body = vessel.getCurrentBody().getCelestialBody();
                }
            }

            if (body == null)
            {
                pickingActive = false;
            }

            if (!pickingActive)
            {
                return;
            }

            Coordinates mouseCoords = GuiUtils.GetMouseCoordinates(body);

            if (this.coords != null)
            {
                GLUtils.DrawMapViewGroundMarker(body, this.coords.latitude, this.coords.longitude, radius, Color.red);
                double distance = getDistance(this.coords, mouseCoords, body);
                infoWindow.text = this.coords.ToStringDecimal() + "\nDistance: " + distance.ToString("F1") + " m";
            }

            if (mouseCoords != null)
            {
                GLUtils.DrawMapViewGroundMarker(body, mouseCoords.latitude, mouseCoords.longitude, body.Radius / 15, Color.yellow);

                if (Input.GetMouseButtonDown(0))
                {
                    this.coords = mouseCoords;
                }
            }
        }
Ejemplo n.º 2
0
        //Draw the mapview MechJeb target arrows
        private void drawTarget()
        {
            if (!selectingInMap)
            {
                return;
            }

            target.pickingPositionTarget = false;

            if (!MapView.MapIsEnabled)
            {
                return;
            }
            if (!v.isActiveVessel || v.GetMasterMechJeb() != core)
            {
                return;
            }

            GLUtils.DrawMapViewGroundMarker(SCANcontroller.controller.LandingTargetBody, coords.y, coords.x, palette.mechjebYellow);
        }