//the part that is enabled and disabled public override void OnStart(StartState state) { base.OnStart(state); string[] transformGroupNames = transormNames.Split(','); models = new List<ModelTransforms>(); //---------------------------------------------------------- //create the list of transforms to be made switchable //---------------------------------------------------------- foreach (string transformName in transformGroupNames) { name = transformName.Trim(); List<Transform> transforms = new List<Transform>(); transforms.AddRange(part.FindModelTransforms(name)); ModelTransforms mt = new ModelTransforms(); mt.transforms = new List<Transform>(); mt.transforms.AddRange(transforms); models.Add(mt); } if (!HighLogic.LoadedSceneIsEditor) { Events["toggleModel"].guiActive = false; } updateActiveModel(); }
//the part that is enabled and disabled public override void OnStart(StartState state) { base.OnStart(state); string[] transformGroupNames = transormNames.Split(','); models = new List <ModelTransforms>(); //---------------------------------------------------------- //create the list of transforms to be made switchable //---------------------------------------------------------- foreach (string transformName in transformGroupNames) { name = transformName.Trim(); List <Transform> transforms = new List <Transform>(); transforms.AddRange(part.FindModelTransforms(name)); ModelTransforms mt = new ModelTransforms(); mt.transforms = new List <Transform>(); mt.transforms.AddRange(transforms); models.Add(mt); } if (!HighLogic.LoadedSceneIsEditor) { Events["toggleModel"].guiActive = false; } updateActiveModel(); }
//the part that is enabled and disabled public override void OnStart(StartState state) { base.OnStart(state); modelBaseField = Fields["numModel"]; modelUIChooser = (UI_ChooseOption)modelBaseField.uiControlEditor; string[] transformGroupNames = transformNames.Split(','); string[] transformGroupVisibleNames = transformVisibleNames.Split(','); models = new List <ModelTransforms>(); visibleNames = new List <string>(); //---------------------------------------------------------- //create the list of transforms to be made switchable //---------------------------------------------------------- for (int k = 0; k < transformGroupNames.Length; k++) { name = transformGroupNames[k].Trim(); List <Transform> transforms = new List <Transform>(); transforms.AddRange(part.FindModelTransforms(name)); ModelTransforms mt = new ModelTransforms(); mt.transforms = new List <Transform>(); mt.transforms.AddRange(transforms); models.Add(mt); if (transformGroupVisibleNames.Length == transformGroupNames.Length) { visibleNames.Add(transformGroupVisibleNames[k]); } else { visibleNames.Add(transformGroupNames[k]); } } //set the changes for the modelchooser modelUIChooser.options = visibleNames.ToArray(); //when there is only one model, we do not need to show the controls if (models.Count < 2) { modelBaseField.guiActive = false; modelBaseField.guiActiveEditor = false; } updateActiveModel(); }
//the part that is enabled and disabled public override void OnStart(StartState state) { base.OnStart(state); string[] transformGroupNames = transformNames.Split(','); string[] transformGroupVisibleNames = transformVisibleNames.Split(','); models = new List <ModelTransforms>(); visibleNames = new List <string>(); //---------------------------------------------------------- //create the list of transforms to be made switchable //---------------------------------------------------------- //int i = 0; //foreach (string transformName in transformGroupNames) for (int k = 0; k < transformGroupNames.Length; k++) { name = transformGroupNames[k].Trim(); List <Transform> transforms = new List <Transform>(); transforms.AddRange(part.FindModelTransforms(name)); ModelTransforms mt = new ModelTransforms(); mt.transforms = new List <Transform>(); mt.transforms.AddRange(transforms); models.Add(mt); if (transformGroupVisibleNames.Length == transformGroupNames.Length) { visibleNames.Add(transformGroupVisibleNames[k]); } else { visibleNames.Add(transformGroupNames[k]); } //i++; } if (models.Count < 2) { Events["toggleModel"].active = false; Events["toggleModelNext"].active = false; Events["toggleModelPrev"].active = false; } else if (models.Count == 2) { Events["toggleModel"].active = true; Events["toggleModel"].guiName = "Switch to: " + getName(numModel + 1); Events["toggleModelNext"].active = false; Events["toggleModelPrev"].active = false; } else if (models.Count > 2) { Events["toggleModel"].active = false; Events["toggleModelNext"].active = true; Events["toggleModelNext"].guiName = "Next: " + getName(numModel + 1); Events["toggleModelPrev"].active = true; Events["toggleModelPrev"].guiName = "Previous: " + getName(numModel - 1); } if (!HighLogic.LoadedSceneIsEditor) { Events["toggleModel"].guiActive = false; } updateActiveModel(); }