Ejemplo n.º 1
0
 //Applies the preset on the chute
 internal void ApplyPreset(Preset preset)
 {
     Preset.ChuteParameters parameters = preset.parameters[id];
     this.material = this.pChute.materials.GetMaterial(parameters.material);
     this.templateGUI.materialsID  = this.pChute.materials.GetMaterialIndex(parameters.material);
     this.templateGUI.preDepDiam   = parameters.preDeployedDiameter;
     this.templateGUI.depDiam      = parameters.deployedDiameter;
     this.templateGUI.isPressure   = parameters.minIsPressure;
     this.templateGUI.predepClause = this.templateGUI.isPressure ? parameters.minPressure : parameters.minDeployment;
     if (templateGUI.isPressure)
     {
         this.parachute.minDeployment = float.Parse(parameters.minDeployment);
     }
     else
     {
         this.parachute.minPressure = float.Parse(parameters.minPressure);
     }
     this.templateGUI.deploymentAlt = parameters.deploymentAlt;
     this.templateGUI.cutAlt        = parameters.cutAlt;
     this.templateGUI.preDepSpeed   = parameters.preDeploymentSpeed;
     this.templateGUI.depSpeed      = parameters.deploymentSpeed;
     if (this.textures != null)
     {
         if (this.textures.ContainsCanopy(parameters.chuteTexture))
         {
             this.templateGUI.chuteID = this.textures.GetCanopyIndex(parameters.chuteTexture);
         }
         if (this.textures.ContainsModel(parameters.modelName))
         {
             this.templateGUI.modelID = this.textures.GetModelIndex(parameters.modelName);
         }
     }
     this.templateGUI.typeID       = parameters.type;
     this.templateGUI.calcSelect   = parameters.calcSelect;
     this.templateGUI.getMass      = parameters.getMass;
     this.templateGUI.useDry       = parameters.useDry;
     this.templateGUI.mass         = parameters.mass;
     this.templateGUI.landingSpeed = parameters.landingSpeed;
     this.templateGUI.deceleration = parameters.deceleration;
     this.templateGUI.refDepAlt    = parameters.refDepAlt;
     this.templateGUI.chuteCount   = parameters.chuteCount;
 }
Ejemplo n.º 2
0
 //Applies the preset on the chute
 internal void ApplyPreset(Preset preset)
 {
     Preset.ChuteParameters parameters = preset.parameters[id];
     this.material     = pChute.materials.GetMaterial(parameters.material);
     this.materialsID  = pChute.materials.GetMaterialIndex(parameters.material);
     this.preDepDiam   = parameters.preDeployedDiameter;
     this.depDiam      = parameters.deployedDiameter;
     this.isPressure   = parameters.minIsPressure;
     this.predepClause = this.isPressure ? parameters.minPressure : parameters.minDeployment;
     if (isPressure)
     {
         this.parachute.minDeployment = float.Parse(parameters.minDeployment);
     }
     else
     {
         this.parachute.minPressure = float.Parse(parameters.minPressure);
     }
     this.deploymentAlt = parameters.deploymentAlt;
     this.cutAlt        = parameters.cutAlt;
     this.preDepSpeed   = parameters.preDeploymentSpeed;
     this.depSpeed      = parameters.deploymentSpeed;
     if (pChute.textureLibrary == preset.textureLibrary || pChute.textureLibrary != "none")
     {
         if (textures.canopyNames.Contains(parameters.chuteTexture) && textures.canopies.Count > 0 && !string.IsNullOrEmpty(parameters.chuteTexture))
         {
             this.chuteID = textures.GetCanopyIndex(textures.GetCanopy(parameters.chuteTexture));
         }
         if (textures.modelNames.Contains(parameters.modelName) && textures.models.Count > 0 && !string.IsNullOrEmpty(parameters.modelName))
         {
             this.modelID = textures.GetModelIndex(textures.GetModel(parameters.modelName));
         }
     }
     this.typeID       = RCUtils.types.ToList().IndexOf(parameters.type);
     this.calcSelect   = parameters.calcSelect;
     this.getMass      = parameters.getMass;
     this.useDry       = parameters.useDry;
     this.mass         = parameters.mass;
     this.landingSpeed = parameters.landingSpeed;
     this.deceleration = parameters.deceleration;
     this.refDepAlt    = parameters.refDepAlt;
     this.chuteCount   = parameters.chuteCount;
 }