コード例 #1
0
ファイル: ChuteTemplate.cs プロジェクト: pcwilcox/RealChute
 /// <summary>
 /// Creates a new ChuteTemplate from the given ProceduralChute
 /// </summary>
 /// <param name="pChute">Module to create the object from</param>
 /// <param name="node">ConfigNode to load the data from</param>
 /// <param name="id">Index of the ChuteTemplate</param>
 public ChuteTemplate(ProceduralChute pChute, ConfigNode node, int id)
 {
     this.pChute = pChute;
     this.id = id;
     this.templateGUI = new TemplateGUI(this);
     if (node != null) { Load(node); }
 }
コード例 #2
0
ファイル: ChuteTemplate.cs プロジェクト: vosechu/RealChute
        /// <summary>
        /// Creates a ChuteTemplate from the given ProceduralChute
        /// </summary>
        /// <param name="pChute">Procedural chute to make the template from</param>
        /// <param name="secondary">If this is the secondary chute</param>
        public ChuteTemplate(ProceduralChute pChute, bool secondary)
        {
            this.pChute = pChute;
            this.secondary = secondary;
            this.pChute.materials.TryGetMaterial(chute.material, ref material);
            materialsID = this.pChute.materials.GetMaterialIndex(chute.material);
            if (this.pChute.textureLibrary != "none")
            {
                this.textures.TryGetCanopy(chuteID, ref canopy);
                this.textures.TryGetModel(modelID, ref model);
            }

            if (HighLogic.LoadedSceneIsEditor)
            {
                if (!this.pChute.initiated)
                {
                    if (this.textures.TryGetCanopy(currentCanopy, ref canopy)) { chuteID = this.textures.GetCanopyIndex(canopy); }
                    if (this.textures.TryGetModel(chute.parachuteName, ref model, true)) { modelID = this.textures.GetModelIndex(model); }
                    if (RCUtils.types.Contains(currentType)) { typeID = RCUtils.types.ToList().IndexOf(currentType); }
                }

                preDepDiam = chute.preDeployedDiameter.ToString();
                depDiam = chute.deployedDiameter.ToString();
                isPressure = chute.minIsPressure;
                if (isPressure) { predepClause = chute.minPressure.ToString(); }
                else { predepClause = chute.minDeployment.ToString(); }
                deploymentAlt = chute.deploymentAlt.ToString();
                cutAlt = chute.cutAlt.ToString();
                if (cutAlt == "-1") { cutAlt = string.Empty; }
                preDepSpeed = chute.preDeploymentSpeed.ToString();
                depSpeed = chute.deploymentSpeed.ToString();
            }
            position = this.part.FindModelTransform(chute.parachuteName).position;

            if (HighLogic.LoadedSceneIsFlight) { UpdateCanopy(); }
        }
コード例 #3
0
ファイル: ChuteTemplate.cs プロジェクト: kevin-ye/RealChute
 /// <summary>
 /// Creates a new ChuteTemplate from the given ProceduralChute
 /// </summary>
 /// <param name="pChute">Module to create the object from</param>
 /// <param name="node">ConfigNode to load the data from</param>
 /// <param name="id">Index of the ChuteTemplate</param>
 public ChuteTemplate(ProceduralChute pChute, ConfigNode node, int id)
 {
     this.pChute = pChute;
     this.id = id;
     Load(node);
 }
コード例 #4
0
ファイル: ChuteTemplate.cs プロジェクト: kevin-ye/RealChute
        //Copies all fields to the symmetry counterpart
        public void CopyFromOriginal(RealChuteModule module, ProceduralChute pChute)
        {
            Parachute sym = module.parachutes[id];
            ChuteTemplate template = pChute.chutes[id];
            parachute = pChute.rcModule.parachutes[id];

            material = sym.mat;
            parachute.deployedDiameter = sym.deployedDiameter;
            parachute.preDeployedDiameter = sym.preDeployedDiameter;
            isPressure = sym.minIsPressure;
            if (isPressure) { parachute.minPressure = sym.minPressure; }
            else { parachute.minDeployment = sym.minDeployment; }
            parachute.deploymentAlt = sym.deploymentAlt;
            parachute.cutAlt = sym.cutAlt;
            parachute.preDeploymentSpeed = sym.preDeploymentSpeed;
            parachute.deploymentSpeed = sym.deploymentSpeed;
            this.chuteID = template.chuteID;
            this.typeID = template.typeID;
            this.modelID = template.modelID;
            this.materialsID = template.materialsID;
            this.isPressure = template.isPressure;
            this.calcSelect = template.calcSelect;
            this.getMass = template.getMass;
            this.useDry = template.useDry;
            this.preDepDiam = template.preDepDiam;
            this.depDiam = template.depDiam;
            this.predepClause = template.predepClause;
            this.mass = template.mass;
            this.landingSpeed = template.landingSpeed;
            this.deceleration = template.deceleration;
            this.refDepAlt = template.refDepAlt;
            this.chuteCount = template.chuteCount;
            this.deploymentAlt = template.deploymentAlt;
            this.cutAlt = template.cutAlt;
            this.preDepSpeed = template.preDepSpeed;
            this.depSpeed = template.depSpeed;
        }