public override void OnUpdate() { base.OnUpdate(); if (count == 0) { Events["installExperiment"].active = expData.canInstall(part.vessel); if (Events["installExperiment"].active) { if (type == ExperimentFactory.KEMINI_EXPERIMENTS) { Events["installExperiment"].guiName = "Install & Run " + expData.getAbbreviation(); } else { Events["installExperiment"].guiName = "Install " + expData.getAbbreviation(); } } Events["moveExp"].active = expData.canMove(part.vessel); if (Events["moveExp"].active) { Events["moveExp"].guiName = "Move " + expData.getAbbreviation(); } Events["finalize"].active = expData.canFinalize(); if (Events["installExperiment"].active) { Events["finalize"].guiName = "Finalize " + expData.getAbbreviation(); } Events["DeployExperiment"].active = false; } count = (count + 1) % 3; }
public override void installExperiment(ExperimentData exp) { switch (exp.getEquipmentNeeded()) { case EquipmentRacks.MSG: if (msgSlot.isEquipmentInstalled() && msgSlot.experimentSlotFree()) { msgSlot.installExperiment(exp); msgStatus = exp.getAbbreviation(); Fields["msgStatus"].guiActive = true; } else { NE_Helper.logError("installExperiment, installed: " + msgSlot.isEquipmentInstalled() + "; free: " + msgSlot.experimentSlotFree()); } break; case EquipmentRacks.USU: if (usuSlot.isEquipmentInstalled() && usuSlot.experimentSlotFree()) { usuSlot.installExperiment(exp); usuStatus = exp.getAbbreviation(); Fields["usuStatus"].guiActive = true; } else { NE_Helper.logError("installExperiment, installed: " + usuSlot.isEquipmentInstalled() + "; free: " + usuSlot.experimentSlotFree()); } break; } }
private void setExperiment(ExperimentData experimentData) { NE_Helper.log("MOVExp.setExp() id: " + experimentData.getId()); expData = experimentData; //contains = expData.getAbbreviation(); expData.setStorage(this); experimentID = expData.getId(); experiment = ResearchAndDevelopment.GetExperiment(experimentID); experimentActionName = "Results"; resetActionName = "Throw Away Results"; reviewActionName = "Review " + expData.getAbbreviation() + " Results"; useStaging = false; useActionGroups = true; hideUIwhenUnavailable = true; resettable = false; resettableOnEVA = false; dataIsCollectable = false; collectActionName = "Collect Results"; interactionRange = 1.2f; xmitDataScalar = 0.05f; if (chanceTexture) { setTexture(expData); } }
public override void installExperiment(ExperimentData exp) { if (exp.getEquipmentNeeded() == EquipmentRacks.EXPOSURE) { exposureSlot.installExperiment(exp); experimentName = exp.getAbbreviation() + ": " + exp.stateString(); } }
public override void installExperiment(ExperimentData exp) { switch (exp.getEquipmentNeeded()) { case EquipmentRacks.CIR: if (cirSlot.isEquipmentInstalled() && cirSlot.experimentSlotFree()) { cirSlot.installExperiment(exp); cirStatus = exp.getAbbreviation(); Fields["cirStatus"].guiActive = true; } else { NE_Helper.logError("installExperiment, installed: " + cirSlot.isEquipmentInstalled() + "; free: " + cirSlot.experimentSlotFree()); } break; case EquipmentRacks.FIR: if (firSlot.isEquipmentInstalled() && firSlot.experimentSlotFree()) { firSlot.installExperiment(exp); ffrStatus = exp.getAbbreviation(); Fields["ffrStatus"].guiActive = true; } else { NE_Helper.logError("installExperiment, installed: " + firSlot.isEquipmentInstalled() + "; free: " + firSlot.experimentSlotFree()); } break; case EquipmentRacks.PRINTER: if (printerSlot.isEquipmentInstalled() && printerSlot.experimentSlotFree()) { printerSlot.installExperiment(exp); prStatus = exp.getAbbreviation(); Fields["prStatus"].guiActive = true; } else { NE_Helper.logError("installExperiment, installed: " + printerSlot.isEquipmentInstalled() + "; free: " + printerSlot.experimentSlotFree()); } break; } }
public override void installExperiment(ExperimentData exp) { switch (exp.getEquipmentNeeded()) { case EquipmentRacks.KEMINI: if (keminiSlot.isEquipmentInstalled() && keminiSlot.experimentSlotFree()) { keminiSlot.installExperiment(exp); keminiStatus = exp.getAbbreviation(); Fields["keminiStatus"].guiActive = true; keminiSlot.experimentAction(); } else { NE_Helper.logError("installExperiment, installed: " + keminiSlot.isEquipmentInstalled() + "; free: " + keminiSlot.experimentSlotFree()); } break; } }
/// <summary> /// Sets or clears the stored experiment /// </summary> /// <param name="experimentData">Experiment data.</param> private void setExperiment(ExperimentData experimentData) { NE_Helper.log("MOVExp.setExp() id: " + experimentData.getId()); expData = experimentData; //contains = expData.getAbbreviation(); expData.setStorage(this); experimentID = expData.getId(); if (expData.getId() == "") { experiment = null; } else { experiment = ResearchAndDevelopment.GetExperiment(experimentID); } experimentActionName = Localizer.GetStringByTag("#ne_Results"); resetActionName = Localizer.GetStringByTag("#ne_Discard_Results"); reviewActionName = Localizer.Format("#ne_Review_1_Results", expData.getAbbreviation()); useStaging = false; useActionGroups = true; hideUIwhenUnavailable = true; resettable = false; resettableOnEVA = false; dataIsCollectable = false; collectActionName = Localizer.GetStringByTag("#ne_Collect_Results"); interactionRange = 1.2f; xmitDataScalar = 0.05f; if (chanceTexture) { setTexture(expData); } RefreshMassAndCost(); }
internal void showDialog(List <ExperimentStorage> targets, ExperimentData experimentData) { NE_Helper.log("start"); this.targets = targets; exp = experimentData; NE_Helper.log("init done"); if (exp == null || targets == null || targets.Count == 0) { this.enabled = false; return; } // Highlight source part sourcePart = exp.store.getPart(); sourcePart.SetHighlightColor(dullOrange); sourcePart.SetHighlightType(Part.HighlightType.AlwaysOn); sourcePart.SetHighlight(true, false); // Create a list of destination parts and highlight them for (int i = 0, count = targets.Count; i < count; i++) { Part p = targets[i].part; if (p == sourcePart || destinationParts.Contains(p)) { continue; } destinationParts.Add(p); p.SetHighlightColor(dullCyan); p.SetHighlightType(Part.HighlightType.AlwaysOn); p.SetHighlight(true, false); } smInfo = ScreenMessages.PostScreenMessage(Localizer.Format("#ne_Select_a_part_to_transfer_1_to_ESC_to_cancel", exp.getAbbreviation()), 15, ScreenMessageStyle.UPPER_CENTER); smInfo.color = Color.cyan; this.enabled = true; NE_Helper.LockUI(); }
private void onAddExperiment(ExperimentData e) { setExperiment(e); Events["chooseEquipment"].guiName = Localizer.Format("#ne_Remove_1", e.getAbbreviation()); }