private void setSite(LaunchSite newSite) { ConfigNode site = KSCLoader.instance.Sites.getSiteByName(newSite.name); if (site == null) { return; } if (KSCSwitcher.setSite(site)) { LastKSC.fetch.lastSite = activeSite = newSite.name; ScreenMessages.PostScreenMessage("Launch site changed to " + newSite.displayName, 2.5f, ScreenMessageStyle.LOWER_CENTER); showWindow = false; KSCReset.shouldCameraBeReset = true; print("*RSS* Launch site updated. Camera reset set to true"); } }
public SortedList <string, LaunchSite> getSitesGeographicalList() { SortedList <string, LaunchSite> siteLocations = new SortedList <string, LaunchSite>(); double lat, lon, dtmp; foreach (ConfigNode site in KSCLoader.instance.Sites.Sites) { ConfigNode pqsCity = site.GetNode("PQSCity"); LaunchSite temp = new LaunchSite(); temp.name = site.GetValue("name"); temp.displayName = site.GetValue("displayName"); double.TryParse(pqsCity.GetValue("latitude"), out lat); double.TryParse(pqsCity.GetValue("longitude"), out lon); temp.geographicLocation = new Vector2d(lat, lon); if (site.HasValue("description")) { temp.description = site.GetValue("description"); } if (site.HasValue("availableFromUT")) { if (double.TryParse(site.GetValue("availableFromUT"), out dtmp)) { temp.availableFromUT = dtmp; } } if (site.HasValue("availableUntilUT")) { if (double.TryParse(site.GetValue("availableUntilUT"), out dtmp)) { temp.availableUntilUT = dtmp; } } siteLocations.Add(temp.name, temp); } return(siteLocations); }
private void setSite(LaunchSite newSite) { ConfigNode site = KSCLoader.instance.Sites.getSiteByName(newSite.name); if(site == null) { return; } if(KSCSwitcher.setSite(site)) { LastKSC.fetch.lastSite = activeSite = newSite.name; ScreenMessages.PostScreenMessage("Launch site changed to " + newSite.displayName, 2.5f, ScreenMessageStyle.LOWER_CENTER); showWindow = false; KSCReset.shouldCameraBeReset = true; print("*RSS* Launch site updated. Camera reset set to true"); } }
public SortedList<string, LaunchSite> getSitesGeographicalList() { SortedList<string, LaunchSite> siteLocations = new SortedList<string, LaunchSite>(); double lat, lon, dtmp; foreach(ConfigNode site in KSCLoader.instance.Sites.Sites) { ConfigNode pqsCity = site.GetNode("PQSCity"); LaunchSite temp = new LaunchSite(); temp.name = site.GetValue("name"); temp.displayName = site.GetValue("displayName"); double.TryParse(pqsCity.GetValue("latitude"), out lat); double.TryParse(pqsCity.GetValue("longitude"), out lon); temp.geographicLocation = new Vector2d(lat, lon); if(site.HasValue("description")) { temp.description = site.GetValue("description"); } if(site.HasValue("availableFromUT")) { if(double.TryParse(site.GetValue("availableFromUT"), out dtmp)) { temp.availableFromUT = dtmp; } } if(site.HasValue("availableUntilUT")) { if(double.TryParse(site.GetValue("availableUntilUT"), out dtmp)) { temp.availableUntilUT = dtmp; } } siteLocations.Add(temp.name, temp); } return siteLocations; }
public void Start() { showWindow = false; scrollPosition = Vector2.zero; Sites = new List<ConfigNode>(); siteLocations = new SortedList<string, LaunchSite>(); ConfigNode RSSSettings = null; foreach(ConfigNode node in GameDatabase.Instance.GetConfigNodes("REALSOLARSYSTEM")) { RSSSettings = node; } if(RSSSettings == null) { throw new UnityException("*RSS* REALSOLARSYSTEM node not found!"); } if(RSSSettings.HasNode("LaunchSites")) { ConfigNode node = RSSSettings.GetNode("LaunchSites"); ConfigNode[] sites = node.GetNodes("Site"); double lat, lon, dtmp; foreach(ConfigNode site in sites) { if(site.HasValue("Name")) { ConfigNode pqsCity = site.GetNode("PQSCity"); if(pqsCity == null) { continue; } if(pqsCity.HasValue("latitude") && pqsCity.HasValue("longitude")) { Sites.Add(site); LaunchSite temp = new LaunchSite(); temp.Name = site.GetValue("Name"); double.TryParse(pqsCity.GetValue("latitude"), out lat); double.TryParse(pqsCity.GetValue("longitude"), out lon); temp.geographicLocation = new Vector2d(lat, lon); if(site.HasValue("description")) { temp.description = site.GetValue("description"); } if(site.HasValue("availableFromUT")) { if(double.TryParse(site.GetValue("availableFromUT"), out dtmp)) { temp.availableFromUT = dtmp; } } if(site.HasValue("availableToUT")) { if(double.TryParse(site.GetValue("availableToUT"), out dtmp)) { temp.availableToUT = dtmp; } } siteLocations.Add(site.GetValue("Name"), temp); } } } } loadTextures(); RenderingManager.AddToPostDrawQueue(2, this.onDraw); RenderingManager.AddToPostDrawQueue(3, this.onDrawGUI); print("*RSS* KSCSwitcher initialized"); }