예제 #1
0
        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);
            }
        }
예제 #2
0
        //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();
            }
        }
예제 #3
0
 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);
     }
 }
예제 #4
0
        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();
        }