public void LateUpdate() { FARAeroUtil.ResetEditorParts(); FARBaseAerodynamics.GlobalCoLReady = false; if (EditorLogic.fetch) { if (editorGUI == null) { editorGUI = new FAREditorGUI(); //editorGUI.LoadGUIParameters(); editorGUI.RestartCtrlGUI(); } if (EditorLogic.startPod != null) { var editorShip = FARAeroUtil.AllEditorParts; if (FARAeroUtil.EditorAboutToAttach() && count++ >= 10) { EditorPartsChanged = true; count = 0; } if (part_count_all != editorShip.Count || part_count_ship != EditorLogic.SortedShipList.Count || EditorPartsChanged) { FindPartsWithoutFARModel(editorShip); foreach (Part p in editorShip) { foreach (PartModule m in p.Modules) { if (m is FARBaseAerodynamics) { (m as FARBaseAerodynamics).ClearShielding(); } } } foreach (Part p in editorShip) { foreach (PartModule m in p.Modules) { if (m is FARPartModule) { (m as FARPartModule).ForceOnVesselPartsChange(); } } } part_count_all = editorShip.Count; part_count_ship = EditorLogic.SortedShipList.Count; EditorPartsChanged = false; } } } }
public void LateUpdate() { if (!CompatibilityChecker.IsAllCompatible()) { return; } FARAeroUtil.ResetEditorParts(); FARBaseAerodynamics.GlobalCoLReady = false; if (EditorLogic.fetch) { if (editorGUI == null) { editorGUI = new FAREditorGUI(); //editorGUI.LoadGUIParameters(); editorGUI.RestartCtrlGUI(); GameEvents.onEditorUndo.Add(editorGUI.ResetAll); GameEvents.onEditorRedo.Add(editorGUI.ResetAll); } if (EditorLogic.RootPart != null) { editorShip = FARAeroUtil.AllEditorParts; if (buttonsNeedInitializing) { InitializeButtons(); } /*if (EditorLogic.RootPart != lastRootPart) * { * lastRootPart = EditorLogic.RootPart; * EditorPartsChanged = true; * }*/ if (FARAeroUtil.EditorAboutToAttach() && count++ >= 20) { EditorPartsChanged = true; count = 0; } if (part_count_all != editorShip.Count || part_count_ship != EditorLogic.SortedShipList.Count || EditorPartsChanged) { UpdateEditorShipModules(); } } else if (!buttonsNeedInitializing) { DestroyButtons(); } } }
public void LateUpdate() { if (!CompatibilityChecker.IsAllCompatible()) { return; } FARAeroUtil.ResetEditorParts(); FARBaseAerodynamics.GlobalCoLReady = false; if (EditorLogic.fetch) { if (editorGUI == null) { editorGUI = new FAREditorGUI(); //editorGUI.LoadGUIParameters(); editorGUI.RestartCtrlGUI(); } if (EditorLogic.startPod != null) { var editorShip = FARAeroUtil.AllEditorParts; if (FARAeroUtil.EditorAboutToAttach() && count++ >= 10) { EditorPartsChanged = true; count = 0; } if (part_count_all != editorShip.Count || part_count_ship != EditorLogic.SortedShipList.Count || EditorPartsChanged) { FindPartsWithoutFARModel(editorShip); for (int i = 0; i < editorShip.Count; i++) { Part p = editorShip[i]; for (int j = 0; j < p.Modules.Count; j++) { PartModule m = p.Modules[j]; if (m is FARBaseAerodynamics) { (m as FARBaseAerodynamics).ClearShielding(); } } } for (int i = 0; i < editorShip.Count; i++) { Part p = editorShip[i]; for (int j = 0; j < p.Modules.Count; j++) { PartModule m = p.Modules[j]; if (m is FARPartModule) { (m as FARPartModule).ForceOnVesselPartsChange(); } } } part_count_all = editorShip.Count; part_count_ship = EditorLogic.SortedShipList.Count; EditorPartsChanged = false; } } } }