Exemplo n.º 1
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);
 }