/// <summary> /// Here when a ship is loaded in the editor. /// </summary> /// <param name="construct"></param> /// <param name="loadType"></param> private void OnShipLoaded(ShipConstruct construct, CraftBrowserDialog.LoadType loadType) { try { Logging.Log("Ship loaded, " + construct.Count + " parts. "); LogPreferredAssignments(construct); AssignmentLogic.AssignKerbals(construct); LogVesselManifest(); } catch (Exception e) { Logging.Exception(e); } }
/// <summary> /// Here when the ship is modified. /// </summary> /// <param name="construct"></param> private void OnShipModified(ShipConstruct construct) { try { if (Crewable.CanList(construct)) { Logging.Log("Ship modified, " + construct.Count + " parts."); AssignmentLogic.AssignKerbals(construct); } } catch (Exception e) { Logging.Exception(e); } }
/// <summary> /// Here when an event happens to the part in the editor. /// </summary> /// <param name="eventType"></param> /// <param name="part"></param> private void OnEditorPartEvent(ConstructionEventType eventType, Part part) { try { if (eventType != ConstructionEventType.PartAttached) { return; } if (Crewable.CanList(CurrentShipConstruct)) { Logging.Log("Attached " + Logging.ToString(part) + "."); AssignmentLogic.AssignKerbals(CurrentShipConstruct); } } catch (Exception e) { Logging.Exception(e); } }