private void Start()
 {
     FARLogger.Info("Initiating RealChuteLite Chute Property Calculation");
     foreach (AvailablePart part in PartLoader.Instance.loadedParts)
     {
         Part prefab = part.partPrefab;
         if (prefab == null || !prefab.Modules.Contains <RealChuteFAR>())
         {
             continue;
         }
         //Updates the part's GetInfo.
         RealChuteFAR module = prefab.Modules.GetModule <RealChuteFAR>();
         DragCubeSystem.Instance.LoadDragCubes(prefab);
         DragCube semi     = prefab.DragCubes.Cubes.Find(c => c.Name == "SEMIDEPLOYED"),
                  deployed = prefab.DragCubes.Cubes.Find(c => c.Name == "DEPLOYED");
         if (semi == null || deployed == null)
         {
             FARLogger.Info("" + part.title + " cannot find drag cube for RealChuteLite");
             continue;
         }
         module.preDeployedDiameter = GetApparentDiameter(semi);
         module.deployedDiameter    = GetApparentDiameter(deployed);
         part.moduleInfos.Find(m => m.moduleName == "RealChute").info = module.GetInfo();
     }
 }
        public void GUIToggleWindow()
        {
            if (!visible)
            {
                var parachutes = new List <RealChuteFAR>();
                if (HighLogic.LoadedSceneIsEditor)
                {
                    parachutes.AddRange(EditorLogic.SortedShipList.Where(p => p.Modules.Contains <RealChuteFAR>())
                                        .Select(p => p.Modules.GetModule <RealChuteFAR>()));
                }
                else if (HighLogic.LoadedSceneIsFlight)
                {
                    parachutes.AddRange(vessel.FindPartModulesImplementing <RealChuteFAR>());
                }
                if (parachutes.Count > 1 && parachutes.Exists(p => p.visible))
                {
                    RealChuteFAR module = parachutes.Find(p => p.visible);
                    window.x       = module.window.x;
                    window.y       = module.window.y;
                    module.visible = false;
                }
            }

            visible = !visible;
        }
Пример #3
0
 //Copies stats from the info window to the symmetry counterparts
 private void CopyToCouterparts()
 {
     foreach (Part part in this.part.symmetryCounterparts)
     {
         RealChuteFAR module = part.Modules["RealChuteFAR"] as RealChuteFAR;
         module.minAirPressureToOpen = this.minAirPressureToOpen;
         module.deployAltitude       = this.deployAltitude;
     }
 }
Пример #4
0
 private void Start()
 {
     foreach (AvailablePart part in PartLoader.Instance.parts)
     {
         Part prefab = part.partPrefab;
         if (prefab != null && prefab.Modules.Contains("RealChuteFAR"))
         {
             //Updates the part's GetInfo.
             RealChuteFAR module = prefab.Modules["RealChuteFAR"] as RealChuteFAR;
             DragCubeSystem.Instance.LoadDragCubes(prefab);
             DragCube semi = prefab.DragCubes.Cubes.Find(c => c.Name == "SEMIDEPLOYED"), deployed = prefab.DragCubes.Cubes.Find(c => c.Name == "DEPLOYED");
             module.preDeployedDiameter = GetApparentDiameter(semi);
             module.deployedDiameter    = GetApparentDiameter(deployed);
             part.moduleInfos.Find(m => m.moduleName == "RealChute").info = module.GetInfo();
         }
     }
 }
Пример #5
0
 private void Start()
 {
     foreach (AvailablePart part in PartLoader.Instance.parts)
     {
         Part prefab = part.partPrefab;
         if (prefab != null && prefab.Modules.Contains <RealChuteFAR>())
         {
             //Updates the part's GetInfo.
             RealChuteFAR module = prefab.Modules.GetModule <RealChuteFAR>();
             DragCubeSystem.Instance.LoadDragCubes(prefab);
             DragCube semi = prefab.DragCubes.Cubes.Find(c => c.Name == "SEMIDEPLOYED"), deployed = prefab.DragCubes.Cubes.Find(c => c.Name == "DEPLOYED");
             if (semi == null || deployed == null)
             {
                 Debug.Log(part.title + " cannot find drag cube for RealChuteLite");
             }
             module.preDeployedDiameter = GetApparentDiameter(semi);
             module.deployedDiameter    = GetApparentDiameter(deployed);
             part.moduleInfos.Find(m => m.moduleName == "RealChute").info = module.GetInfo();
         }
     }
 }