/// <summary> /// Here when the player manually changes the crew assignments in the editor. /// </summary> /// <param name="construct"></param> private void OnCrewChanged(ShipConstruct construct) { if (Crewable.CanList(construct)) { Logging.Log("Crew edited, persisting kerbal assignments."); AssignmentLogic.PersistKerbalAssignments(construct); LogVesselManifest(); } }
/// <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); } }