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); } } }
public void Start() { if (!(HighLogic.LoadedSceneIsFlight || HighLogic.LoadedSceneIsEditor)) { return; } Instance = this; moduleToDraw = null; display = new Display(160, 200); StartCoroutine(slowUpdate()); }
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); } }