protected virtual void DoSaveFamily(GUIButton sender, object value) { if (!string.IsNullOrEmpty(value.ToString()) && KLVCore.FamilyAvailable(value.ToString())) { if (editingFamily == null) { //Adding new family KLVCore.AddVehicleFamily(value.ToString()); } else { //Editing existing family editingFamily.SetName(value.ToString()); editingFamily = null; } KLVCore.Save(); KLVCore.UpdateAllVehicleNameSchemes(); UpdateFamilies(); textEditFamily.SetText(""); textEditFamily.SetEditing(false); SetFamilyEditState(false); } }
//Destinations private void DoRemoveDestination(GUIButton sender, object value) { if (!string.IsNullOrEmpty(value.ToString())) { KLVCore.RemoveDestination(value.ToString()); KLVCore.Save(); KLVCore.UpdateAllVehicleNameSchemes(); comboDestination.SetItems(KLVCore.GetAllDestinationName()); comboDestination.Deselect(); } }
private void DoAddDestination(GUIButton sender, object value) { if (!string.IsNullOrEmpty(value.ToString()) && KLVCore.DestinationAvailable(value.ToString())) { textAddDestination.SetEditing(false); textAddDestination.SetText(""); KLVCore.AddDestination(value.ToString()); KLVCore.Save(); KLVCore.UpdateAllVehicleNameSchemes(); comboDestination.SetItems(KLVCore.GetAllDestinationName()); //Open combo to view new addition MarkComboToExpand(true, comboDestination); } }
private void EndVehicleEdit(GUIButton sender = null, object value = null) { textVehicleName.SetEditing(false); textVehicleNote.SetEditing(false); textVehicleName.SetText(""); textVehicleNote.SetText(""); comboFamily.Deselect(); isAddingConfig = false; newConfigs = new List <LaunchConfig>(); textAllPayloads = new List <GUITextBox>(); comboAllDestinations = new List <DropDown>(); buttonAllRemoveConfigs = new List <GUIButton>(); selectedRootPart = null; editingVehicle = null; KLVCore.UpdateAllVehicleNameSchemes(); DoUpdateLists(); }