Пример #1
0
        private void DoEditVehicle(GUIButton sender, object value)
        {
            if (value != null && EditorLogic.RootPart == null)
            {
                if (!string.IsNullOrEmpty(value.ToString()))
                {
                    var vehicle = KLVCore.GetVehicle(value.ToString());

                    if (vehicle != null)
                    {
                        StageManager.Instance.DeleteEmptyStages();

                        //Debug.Log(vehicle.SubassemblyName);
                        failedSubassembly = "";
                        if (DoLoadSubassembly(sender, vehicle.SubassemblyName))
                        {
                            DoAddSubassembly(sender, vehicle.SubassemblyName);

                            textVehicleName.SetText(vehicle.Name);
                            textVehicleName.SetEditing(true);
                            outputVehicleName = vehicle.Name;

                            textVehicleNote.SetText(String.IsNullOrEmpty(vehicle.Note) ? "Note..." : vehicle.Note);
                            textVehicleNote.SetEditing(true);
                            outputVehicleNote = vehicle.Note;

                            comboFamily.SetSelection(vehicle.Parent.Name);
                            comboFamily.SetExpanded(false);

                            for (int i = 0; i < vehicle.AllLaunchConfigs.Count; i++)
                            {
                                AddConfig(vehicle.AllLaunchConfigs[i]);
                                comboAllDestinations[i].SetExpanded(false);
                            }

                            editingVehicle = vehicle;
                        }
                        else
                        {
                            failedSubassembly = vehicle.SubassemblyName;
                        }
                    }
                }
            }
        }