Beispiel #1
0
 void RoleControl()
 {
     if (GUILayout.Button("<", Styles.normal_button, GUILayout.Width(15)))
     {
         Role = TCAEngineInfo.PrevRole(Role); Changed = true;
     }
     GUILayout.Label(TCAEngineInfo.RoleNames[(int)Role], GUILayout.Width(120));
     if (GUILayout.Button(">", Styles.normal_button, GUILayout.Width(15)))
     {
         Role = TCAEngineInfo.NextRole(Role); Changed = true;
     }
 }
 public EngineWrapper(ModuleEngines engine)
 {
     //init
     thrustController.setMaster(ThrustPI);
     zeroIsp = engine.atmosphereCurve.Evaluate(0f);
     name    = Utils.ParseCamelCase(engine.part.Title());
     if (engine.engineID.Length > 0 && engine.engineID != "Engine")
     {
         name += " (" + engine.engineID + ")";
     }
     //generate engine ID
     this.engine = engine;
     ID          = new EngineID(this);
     //get info
     info = engine.part.Modules.GetModule <TCAEngineInfo>();
     //find gimbal
     gimbal = engine.part.Modules.GetModule <ModuleGimbal>();
 }
Beispiel #3
0
 public EngineWrapper(ModuleEngines engine)
 {
     //generate engine ID
     this.engine = engine;
     name        = Utils.ParseCamelCase(engine.part.Title());
     if (engine.engineID.Length > 0 && engine.engineID != "Engine")
     {
         name += " (" + engine.engineID + ")";
     }
     ID = new EngineID(this);
     //init
     thrustController.setMaster(ThrustPI);
     zeroIsp = GetIsp(0, 0, 0);
     //get info
     info = engine.part.Modules.GetModule <TCAEngineInfo>();
     //find gimbal
     gimbal  = engine.part.Modules.GetModule <ModuleGimbal>();
     gimbals = new List <GimbalInfo>(engine.thrustTransforms.Count);
     if (gimbal != null)
     {
         for (int i = 0, eCount = engine.thrustTransforms.Count; i < eCount; i++)
         {
             var eT = engine.thrustTransforms[i];
             for (int j = 0, gCount = gimbal.gimbalTransforms.Count; j < gCount; j++)
             {
                 var gT = gimbal.gimbalTransforms[j];
                 if (Part.FindTransformInChildrenExplicit(gT, eT))
                 {
                     gimbals.Add(new GimbalInfo(eT, gT, gimbal.initRots[j]));
                     break;
                 }
             }
             if (gimbals.Count == i)
             {
                 gimbals.Add(null);
             }
         }
     }
 }
 public EngineWrapper(ModuleEngines engine)
 {
     //init
     thrustController.setMaster(ThrustPI);
     zeroIsp = engine.atmosphereCurve.Evaluate(0f);
     name = Utils.ParseCamelCase(engine.part.Title());
     if(engine.engineID.Length > 0 && engine.engineID != "Engine")
         name += " (" + engine.engineID + ")";
     //generate engine ID
     this.engine = engine;
     ID = new EngineID(this);
     //get info
     info = engine.part.Modules.GetModule<TCAEngineInfo>();
     //find gimbal
     gimbal = engine.part.Modules.GetModule<ModuleGimbal>();
 }