private void CLSBoardManualListParts() { Part p; foreach (ICLSPart clsp in CLSClient.GetCLS().getCLSVessel(tgtAirlockPart.vessel).Parts.Find(x => x.Part == tgtAirlockPart).Space.Parts) { p = clsp.Part; if (p.CrewCapacity > 0) { highlightParts.Add(p.flightID, p); p.Highlight(false); p.SetHighlightType(Part.HighlightType.Disabled); p.highlighter.ConstantOn(SpaceAvail(p) ? COLOR_AVAIL : COLOR_FULL); } } }
private void CLSBoardAuto() { Debug.Log("[AirlockPlus|BoardingPass] INFO: " + vessel.vesselName + " auto boarding " + tgtAirlockPart.vessel.vesselName + " via " + tgtAirlockPart.partInfo.name); ICLSSpace clsSpace = CLSClient.GetCLS().getCLSVessel(tgtAirlockPart.vessel).Parts.Find(x => x.Part == tgtAirlockPart).Space; // check in case of full vessel first if (clsSpace.Crew.Count >= clsSpace.MaxCrew) { Debug.Log("[AirlockPlus|BoardingPass] INFO: Auto boarding failed - CLS space full"); ScreenMessages.PostScreenMessage(scrmsgVesFull); // HACK: temporarily disable KerbalEVA for one update frame to prevent stock boarding from being registered alongside auto boarding // this prevents "spurious" stock "Cannot board a full module" message appearing alongside our auto boarding "Cannot board a full vessel" keva.enabled = false; autoBoardingFull = true; return; } // find part to board Part dest = null; if (SpaceAvail(tgtAirlockPart)) { // board the part itself if possible dest = tgtAirlockPart; } else { foreach (ICLSPart p in clsSpace.Parts) { if (SpaceAvail(p.Part)) { dest = p.Part; break; } } } if (dest == null) { Debug.Log("[AirlockPlus|BoardingPass] ERROR: Auto boarding target vessel at " + clsSpace.Crew.Count + "/" + clsSpace.MaxCrew + "of CLS space capacity, but somehow unable to find a part with space?!"); return; } keva.BoardPart(dest); }