void BuildPadList(Vessel v) { launchpads = null; pad_list = null; var pads = new List<ExBuildControl.IBuilder> (); for (int i = 0; i < v.Parts.Count; i++) { var p = v.Parts[i]; pads.AddRange (p.Modules.OfType<ExBuildControl.IBuilder> ()); } if (pads.Count < 1) { control = null; } else { launchpads = new List<ExBuildControl> (); int control_index = -1; for (int i = 0; i < pads.Count; i++) { launchpads.Add (pads[i].control); if (control == pads[i].control) { control_index = i; } } if (control_index < 0) { control_index = 0; } var pad_names = new List<string> (); for (int ind = 0; ind < launchpads.Count; ind++) { var p = launchpads[ind]; if (p.builder.Name != "") { pad_names.Add (p.builder.Name); } else { pad_names.Add ("pad-" + ind); } } pad_list = new DropDownList (pad_names); Select_Pad (launchpads[control_index]); } }
void FindSites() { available_sites = ExSurveyTracker.instance.FindSites (vessel, 100.0); if (available_sites == null || available_sites.Count < 1) { Highlight (false); site = null; site_list = null; } else { var slist = new List<string> (); for (int ind = 0; ind < available_sites.Count; ind++) { slist.Add (available_sites[ind].SiteName); } if (!available_sites.Contains (site)) { Highlight (false); site = available_sites[0]; } site_list = new DropDownList (slist); } Debug.Log (String.Format ("[EL SS] {0}", site)); }