Beispiel #1
0
        public void Update()
        {
            if (HighLogic.LoadedSceneIsEditor)
            {
                deflection = gimbalModule.gimbalRange;
            }

            if (part.isActiveAndEnabled && engineModule.finalThrust == 0 && engineModules.Count > 1 && vessel.ctrlState.mainThrottle > 0)
            {
                ModuleEngines maxThrustModule = engineModules[0];
                for (int i = 1; i < engineModules.Count; i++)
                {
                    if (engineModules[i].finalThrust > maxThrustModule.finalThrust)
                    {
                        maxThrustModule = engineModules[i];
                    }
                }
                engineModule = maxThrustModule;
            }

            if (EditorWindowGimbal.Instance.moduleToDraw != this)
            {
                return;
            }

            foreach (Part p in part.symmetryCounterparts)
            {
                if (p != null)
                {
                    EditorWindowGimbal.copyToModule(p.Modules["ModuleDynamicGimbal"] as ModuleDynamicGimbal, deflectionAtThrust);
                }
            }
        }
Beispiel #2
0
        public void Start()
        {
            if (!(HighLogic.LoadedSceneIsFlight || HighLogic.LoadedSceneIsEditor))
            {
                return;
            }
            Instance = this;

            moduleToDraw = null;

            display = new Display(160, 200);
            StartCoroutine(slowUpdate());
        }
Beispiel #3
0
 public override void OnSave(ConfigNode node)
 {
     if (!loaded)
     {
         return;
     }
     try
     {
         node = EditorWindowGimbal.toConfigNode(deflectionAtThrust, node, false, deflection);
         base.OnSave(node);
     }
     catch (Exception ex)
     {
         Log("Onsave failed");
         Log(ex.InnerException);
         Log(ex.StackTrace);
     }
 }