// Remove experimental parts when a tech is researched private void OnTechResearched(GameEvents.HostTargetAction <RDTech, RDTech.OperationResult> hta) { foreach (AvailablePart p in hta.host.partsAssigned) { ResearchAndDevelopment.RemoveExperimentalPart(p); } }
protected void LockParts() { foreach (AvailablePart part in parts) { ResearchAndDevelopment.RemoveExperimentalPart(part); } }
private void removeExperimentalParts() { AvailablePart partToAdd = PartLoader.getPartInfoByName("MerillCamera"); if (partToAdd != null && ResearchAndDevelopment.IsExperimentalPart(partToAdd)) { ResearchAndDevelopment.RemoveExperimentalPart(partToAdd); } }
protected override void OnCompleted() { if (remove) { foreach (AvailablePart part in parts) { ResearchAndDevelopment.RemoveExperimentalPart(part); } } }
protected override void OnDeadlineExpired() { if (add) { foreach (AvailablePart part in parts) { ResearchAndDevelopment.RemoveExperimentalPart(part); } } }
/** Removes experimental part. * TODO: Check if there is another active contract using this part in which case we have to keep it! */ private void removeExperimentalParts() { AvailablePart ap = ExperimentFactory.getPartForExperiment(ExperimentFactory.KEMINI_EXPERIMENTS, experiment); if (ap != null && ResearchAndDevelopment.IsExperimentalPart(ap)) { NE_Helper.log("Removing experimental part: " + ap.name); ResearchAndDevelopment.RemoveExperimentalPart(ap); } }
private void removeExperimentalPart(string sExperimentalPartName) { MerillData.log("plantmunflag: DECLINED contract with experimental part: " + sExperimentalPartName); if (sExperimentalPartName != null) { AvailablePart experimentalPart = PartLoader.getPartInfoByName(sExperimentalPartName); if (experimentalPart != null && ResearchAndDevelopment.IsExperimentalPart(experimentalPart)) { MerillData.log("plantmunflag: Locking part: " + sExperimentalPartName); ResearchAndDevelopment.RemoveExperimentalPart(experimentalPart); } } }
private static void ExperimentalPart(string partName, int count) { System.StartIgnoringEvents(); var partInfo = PartLoader.getPartInfoByName(partName); if (partInfo != null) { var currentExperimentalParts = Traverse.Create(ResearchAndDevelopment.Instance).Field <Dictionary <AvailablePart, int> >("experimentalPartsStock").Value; if (currentExperimentalParts.TryGetValue(partInfo, out var currentCount)) { if (currentCount > count) { ResearchAndDevelopment.RemoveExperimentalPart(partInfo); } else if (currentCount < count) { ResearchAndDevelopment.AddExperimentalPart(partInfo); } } else { ResearchAndDevelopment.AddExperimentalPart(partInfo); } } //Refresh RD nodes in case we are in the RD screen if (RDController.Instance && RDController.Instance.partList) { RDController.Instance.partList.Refresh(); RDController.Instance.UpdatePanel(); } //Refresh the part list in case we are in the VAB/SPH if (EditorPartList.Instance) { EditorPartList.Instance.Refresh(); } System.StopIgnoringEvents(); LunaLog.Log($"Experimental part received part: {partName} count {count}"); }
private void onPartResearched(AvailablePart availablePart) { ResearchAndDevelopment.RemoveExperimentalPart(availablePart); }