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; }
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; }
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; }
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; } }