Ejemplo n.º 1
0
        protected override void DrawWindowPre(int id)
        {
            v = FlightGlobals.ActiveVessel;

            vlat = SCANUtil.fixLatShift(v.latitude);
            vlon = SCANUtil.fixLonShift(v.longitude);

            //Grab the active scanners on this vessel
            sensors = SCANcontroller.controller.activeSensorsOnVessel(v.id);

            //if (maptraq_frame >= Time.frameCount - 5) //Still not sure what this actually does
            if (true)
            {
                //Check if region below the vessel is scanned
                if (SCANUtil.isCovered(vlon, vlat, data, SCANtype.AltimetryLoRes))
                {
                    sensors |= SCANtype.Altimetry;
                }
                else if (SCANUtil.isCovered(vlon, vlat, data, SCANtype.AltimetryHiRes))
                {
                    sensors |= SCANtype.Altimetry;
                }
                if (SCANUtil.isCovered(vlon, vlat, data, SCANtype.Biome))
                {
                    sensors |= SCANtype.Biome;
                }
            }
        }
Ejemplo n.º 2
0
 public SCANwaypoint(double lat, double lon, string n)
 {
     way           = null;
     band          = FlightBand.NONE;
     root          = null;
     param         = null;
     name          = n;
     longitude     = SCANUtil.fixLonShift(lon);
     latitude      = SCANUtil.fixLatShift(lat);
     landingTarget = true;
 }
Ejemplo n.º 3
0
 internal SCANwaypoint(Waypoint p)
 {
     way           = p;
     band          = FlightBand.NONE;
     root          = p.contractReference;
     param         = null;
     name          = way.name;
     longitude     = SCANUtil.fixLonShift(way.longitude);
     latitude      = SCANUtil.fixLatShift(way.latitude);
     landingTarget = false;
 }
Ejemplo n.º 4
0
 internal SCANwaypoint(StationaryPointParameter p)
 {
     way = reflectWaypoint(p);
     if (way != null)
     {
         band          = FlightBand.NONE;
         root          = p.Root;
         param         = p;
         name          = way.name;
         longitude     = SCANUtil.fixLonShift(way.longitude);
         latitude      = SCANUtil.fixLatShift(way.latitude);
         landingTarget = false;
     }
 }
Ejemplo n.º 5
0
 //Method to handle vessel info
 private bool vesselInfo(Vessel scanV, Rect r, int i, bool b)
 {
     if (scanV == null)
     {
         return(false);
     }
     if (scanV.mainBody == v.mainBody)
     {
         if (!showVesselInfo)
         {
             SCANuiUtil.drawVesselLabel(r, null, -1, scanV);
             return(true);
         }
         float lon = (float)SCANUtil.fixLonShift(scanV.longitude);
         float lat = (float)SCANUtil.fixLatShift(scanV.latitude);
         float alt = scanV.heightFromTerrain;
         if (alt < 0)
         {
             alt = (float)scanV.altitude;
         }
         string text = string.Format("[{0}] {1} ({2:F1}°,{3:F1}°; {4:N1}m)", i, scanV.vesselName, lat, lon, alt);
         if (SCANuiUtil.readableLabel(text, b))
         {
             if (Event.current.clickCount > 1)
             {
                 Event.current.Use();
                 FlightGlobals.SetActiveVessel(scanV);
                 ScreenMessages.PostScreenMessage(scanV.vesselName, 5, ScreenMessageStyle.UPPER_CENTER);
             }
         }
         SCANuiUtil.drawVesselLabel(r, null, i, scanV);
         fillS(-10);
         return(true);
     }
     return(false);
 }