コード例 #1
0
        internal void Copy(Hint oldHint)
        {
            hintDistance     = oldHint.hintDistance;
            hint             = oldHint.hint;
            hintTitle        = oldHint.hintTitle;
            scale            = oldHint.scale;
            situations       = oldHint.situations;
            absoluteDistance = oldHint.absoluteDistance;

            //  spawn = oldHint.spawn;
        }
コード例 #2
0
        internal Hint()
        {
            hintId           = Guid.NewGuid();
            hintDistance     = 1;
            absoluteDistance = 1000;
            hint             = "";
            hintTitle        = "";
            scale            = Scale.km;
            situations       = Vessel.Situations.LANDED;
//spawn = false; // if true, spawn keocache vessel when within this distance
            found = false;
        }
コード例 #3
0
 public KeoCacheData()
 {
     keocacheId          = System.Guid.NewGuid().ToString("N");
     keoCacheName        = "";
     scienceNodeRequired = "";
     found             = false;
     vessel            = null;
     spawned           = false;
     distanceFromCache = 1f;
     absoluteDistance  = 1000f;
     scale             = Scale.km;
     if (FlightGlobals.ActiveVessel != null)
     {
         latitude  = FlightGlobals.ActiveVessel.latitude;
         longitude = FlightGlobals.ActiveVessel.longitude;
     }
     description = "";
     hints       = new List <Hint>();
     //protoVessel =new ProtoVessel(new Vessel());
     //nextKeocacheId = "";
     lastHintFound = -1;
 }
コード例 #4
0
        void ShowGetProximity(string obj, ref double distance, ref double absoluteDistance, ref KeoCaching.Scale scale)
        {
            GUILayout.BeginHorizontal();
            GUILayout.Label(obj + "proximity distance:");

            double.TryParse(GUILayout.TextField(distance.ToString(), GUILayout.Width(100)), out distance);

            oldKm = scale == Scale.km;
            oldM  = scale == Scale.m;
            GUILayout.FlexibleSpace();
            km = GUILayout.Toggle(oldKm, "km");
            GUILayout.FlexibleSpace();
            m = GUILayout.Toggle(oldM, "m");
            GUILayout.FlexibleSpace();

            GUILayout.EndHorizontal();

            if (km && !oldKm)
            {
                scale = Scale.km;
            }
            if (m && !oldM)
            {
                scale = Scale.m;
            }
            if (km)
            {
                max = 1000;
            }
            if (m)
            {
                max = 10000;
            }

            GUILayout.BeginHorizontal();
            distance = (float)Math.Floor(GUILayout.HorizontalSlider((float)distance, 1f, max));

            GUILayout.EndHorizontal();
            absoluteDistance = distance;
            if (scale == Scale.km)
            {
                absoluteDistance *= 1000;
            }
        }