Exemple #1
0
        private void ShowResultDialog(ScienceData data)
        {
            Log.Info("ShowResultDialog");
            ScienceLabSearch labSearch = new ScienceLabSearch(FlightGlobals.ActiveVessel, data);

            _expDialog = ExperimentsResultDialog.DisplayResult(new ExperimentResultDialogPage(
                                                                   FlightGlobals.ActiveVessel.rootPart,
                                                                   data,
                                                                   data.baseTransmitValue,
                                                                   data.transmitBonus,
                                                                   false,
                                                                   string.Empty,
                                                                   false,
                                                                   labSearch,
                                                                   OnDiscardData,
                                                                   OnKeepData,
                                                                   OnTransmitData,
                                                                   OnSendToLab));

            ScienceSubject subjectByID  = ResearchAndDevelopment.GetSubjectByID(data.subjectID);
            var            refValue     = ResearchAndDevelopment.GetReferenceDataValue(data.dataAmount, subjectByID) * HighLogic.CurrentGame.Parameters.Career.ScienceGainMultiplier;
            var            scienceValue = ResearchAndDevelopment.GetScienceValue(data.dataAmount, data.scienceValueRatio, subjectByID, 1f) * HighLogic.CurrentGame.Parameters.Career.ScienceGainMultiplier;

            //Log.Info("ShowResultDialog, data: " + data.title + ", labValue: " + data.labValue + ", dataAmount: " + data.dataAmount + ", scienceValueRatio: " + data.scienceValueRatio  + " ,baseTransmitValue: " + data.baseTransmitValue + ", transmitBonus: " + data.transmitBonus + " ::: data.subjectID: " + data.subjectID + ", data.dataAmount: " + data.dataAmount + ", subjectByID: " + subjectByID.id + ", subjectByID.dataScale: " + subjectByID.dataScale + ", subjectByID.subjectValue: " + subjectByID.subjectValue + ", HighLogic.CurrentGame.Parameters.Career.ScienceGainMultiplier: " + HighLogic.CurrentGame.Parameters.Career.ScienceGainMultiplier +  ", refValue: " + refValue + ", scienceValue: " + scienceValue);
        }
Exemple #2
0
        public void ReviewDataItem(ScienceData sd)
        {
            ImpactMonitor.Log("Reviewing data from seismomenter");
            ScienceLabSearch labSearch = new ScienceLabSearch(null, sd);

            expDialog = ExperimentsResultDialog.DisplayResult(new ExperimentResultDialogPage(part, sd, 1f, 0f, false, "", true, labSearch, DumpData, KeepData, TransmitData, null));
        }
        private void _onPageSendToLab(ScienceData data)
        {
            ScienceLabSearch scienceLabSearch = new ScienceLabSearch(base.vessel, data);

            if (scienceLabSearch.NextLabForDataFound)
            {
                StartCoroutine(scienceLabSearch.NextLabForData.ProcessData(data, new Callback <ScienceData>(DumpData)));
            }
            else
            {
                scienceLabSearch.PostErrorToScreen();
            }
        }
        private void onSendToLab(ScienceData data)
        {
            ScienceLabSearch labSearch = new ScienceLabSearch(vessel, data);

            if (labSearch.NextLabForDataFound)
            {
                StartCoroutine(labSearch.NextLabForData.ProcessData(data, null));
                DumpData(data);
            }
            else
            {
                labSearch.PostErrorToScreen();
            }
        }
        public void TakeKometSample()
        {
            ScienceExperiment experiment = ResearchAndDevelopment.GetExperiment(kometExperimentID);
            ScienceSubject    subject    = ResearchAndDevelopment.GetExperimentSubject(experiment, ScienceUtil.GetExperimentSituation(part.vessel),
                                                                                       part.vessel.mainBody, string.Empty, string.Empty);

            //Create science data.
            ScienceData data = new ScienceData(experiment.baseValue, scienceXmitScalar, 1f, subject.id, subject.title);

            //Show results
            ScienceLabSearch           labSearch = new ScienceLabSearch(this.part.vessel, data);
            ExperimentResultDialogPage page      = new ExperimentResultDialogPage(part, data, data.baseTransmitValue, data.transmitBonus, false, "", true, labSearch, resetExperiment, keepResults, null, null);
            ExperimentsResultDialog    dlg       = ExperimentsResultDialog.DisplayResult(page);
        }
Exemple #6
0
        private void OnSendToLab(ScienceData data)
        {
            _expDialog = null;
            ScienceLabSearch labSearch = new ScienceLabSearch(FlightGlobals.ActiveVessel, data);

            if (labSearch.NextLabForDataFound)
            {
                StartCoroutine(labSearch.NextLabForData.ProcessData(data));
                DumpData(data);
            }
            else
            {
                labSearch.PostErrorToScreen();
                //UpdateUI();
            }
        }
Exemple #7
0
        private void ShowResultDialog(ScienceData data)
        {
            ScienceLabSearch labSearch = new ScienceLabSearch(FlightGlobals.ActiveVessel, data);

            _expDialog = ExperimentsResultDialog.DisplayResult(new ExperimentResultDialogPage(
                                                                   FlightGlobals.ActiveVessel.rootPart,
                                                                   data,
                                                                   data.baseTransmitValue,
                                                                   data.transmitBonus,
                                                                   false,
                                                                   string.Empty,
                                                                   false,
                                                                   labSearch,
                                                                   OnDiscardData,
                                                                   OnKeepData,
                                                                   OnTransmitData,
                                                                   OnSendToLab));
        }
        public void ReviewDataItem(ScienceData data)
        {
            ScienceLabSearch           labSearch = new ScienceLabSearch(FlightGlobals.ActiveVessel, data);
            ExperimentResultDialogPage page      = new ExperimentResultDialogPage(
                part,
                data,
                data.baseTransmitValue,
                data.transmitBonus,
                true,
                Localizer.Format("#autoLOC_TST_0051", Mathf.Round(data.baseTransmitValue * 100)),     //#autoLOC_TST_0051 = If you transmit this data it will only be worth: <<1>>% of the full science value
                true,
                labSearch,
                _onPageDiscard,
                _onPageKeep,
                _onPageTransmit,
                _onPageSendToLab);

            ExperimentsResultDialog.DisplayResult(page);
        }
        public void ReviewDataItem(ScienceData data)
        {
            ScienceLabSearch           labSearch = new ScienceLabSearch(FlightGlobals.ActiveVessel, data);
            ExperimentResultDialogPage page      = new ExperimentResultDialogPage(
                part,
                data,
                xmitDataScalar,
                data.transmitBonus,
                true,
                Localizer.Format("#autoLOC_TST_0051", Mathf.Round(data.baseTransmitValue * 100)),
                true,
                labSearch,
                _onPageDiscard,
                _onPageKeep,
                _onPageTransmit,
                _onPageSendToLab);

            ExperimentsResultDialog.DisplayResult(page);
        }
Exemple #10
0
        public void ReviewDataItem(ScienceData data)
        {
            ScienceLabSearch           labSearch = new ScienceLabSearch(FlightGlobals.ActiveVessel, data);
            ExperimentResultDialogPage page      = new ExperimentResultDialogPage(
                part,
                data,
                xmitDataScalar,
                data.labBoost,
                true,
                "If you transmit this data it will only be worth: " + Mathf.Round(data.transmitValue * 100) + "% of the full science value",
                true,
                labSearch,
                _onPageDiscard,
                _onPageKeep,
                _onPageTransmit,
                _onPageSendToLab);

            ExperimentsResultDialog.DisplayResult(page);
        }
Exemple #11
0
        public void ShowResults(ScienceData data, ModuleScienceLab lab = null)
        {
            scienceLab = lab;
            bool hasLab = scienceLab != null ? true : false;

            if (lab != null)
            {
                contextBonus   = lab.ContextBonus;
                surfaceBonus   = lab.SurfaceBonus;
                homeworldBonus = lab.homeworldMultiplier;

                lab.ContextBonus        = 0;
                lab.SurfaceBonus        = 0;
                lab.homeworldMultiplier = 0;
            }

            //Now show the dialog
            ScienceLabSearch           labSearch = new ScienceLabSearch(this.part.vessel, data);
            ExperimentResultDialogPage page      = new ExperimentResultDialogPage(part, data, data.baseTransmitValue, data.transmitBonus, false, "", true, labSearch, Reset, Keep, Transmit, Process);
            ExperimentsResultDialog    dlg       = ExperimentsResultDialog.DisplayResult(page);
        }
        public void ReviewDataItem(ScienceData sd)
        {
            ScienceLabSearch labSearch = new ScienceLabSearch(null, sd);

            expDialog = ExperimentsResultDialog.DisplayResult(new ExperimentResultDialogPage(part, sd, 1f, 0f, false, "", true, labSearch, DumpData, KeepData, TransmitData, null));
        }
 public void ReviewDataItem(ScienceData data)
 {
     ScienceLabSearch labSearch = new ScienceLabSearch(FlightGlobals.ActiveVessel, data);
     ExperimentResultDialogPage page = new ExperimentResultDialogPage(
             part,
             data,
             data.transmitValue,
             data.labBoost,
             true,
             "If you transmit this data it will only be worth: " + Mathf.Round(data.transmitValue * 100) + "% of the full science value",
             true,
             labSearch,
             _onPageDiscard,
             _onPageKeep,
             _onPageTransmit,
             _onPageSendToLab);
     ExperimentsResultDialog.DisplayResult(page);
 }
 public void ReviewDataItem(ScienceData data)
 {
     var labSearch = new ScienceLabSearch(FlightGlobals.ActiveVessel, data);
     var page = new ExperimentResultDialogPage(
         part,
         data,
         xmitDataScalar,
         data.labBoost,
         false,
         "",
         true,
         labSearch,
         _onPageDiscard,
         _onPageKeep,
         _onPageTransmit,
         _onPageSendToLab);
     //If ResearchBodies is installed we check if the body is discovered or not. If it isn't we change the science results page text.
     if (Utilities.IsResearchBodiesInstalled && RBWrapper.RBactualAPI.enabled)
     {
         if (data.subjectID.Contains("TarsierSpaceTech.SpaceTelescope"))
         {
             if (data.title.Contains("Tarsier Space Telescope: Orbiting"))
             {
                 int index = data.title.IndexOf("looking at");
                 if (index != -1)
                 {
                     string bodyName = data.title.Substring(index + 11);
                     var keyvalue =
                         TSTMstStgs.Instance.RBCelestialBodies.FirstOrDefault(a => a.Key.theName == bodyName);
                     if (keyvalue.Key != null)
                     {
                         if (!keyvalue.Value.isResearched)
                         {
                             page.resultText =
                                 "We have collected a picture of a previously unknown body. If we return or transmit this data to home we will learn more about it.";
                             page.title = "Space Telescope picture of Unknown Body";
                         }
                     }
                 }
             }
         }
     }
     ExperimentsResultDialog.DisplayResult(page);
 }
		private void onSendInitialToLab(ScienceData data)
		{
			ScienceLabSearch labSearch = new ScienceLabSearch(vessel, data);

			if (labSearch.NextLabForDataFound)
			{
				StartCoroutine(labSearch.NextLabForData.ProcessData(data, null));
				DumpData(data);
			}
			else
				labSearch.PostErrorToScreen();
		}
 public void ReviewDataItem(ScienceData sd)
 {
     ScienceLabSearch labSearch = new ScienceLabSearch(null, sd);
     expDialog = ExperimentsResultDialog.DisplayResult(new ExperimentResultDialogPage(part, sd, 1f, 0f, false, "", true, labSearch, DumpData, KeepData, TransmitData, null));
 }
 private void _onPageSendToLab(ScienceData data)
 {
     ScienceLabSearch scienceLabSearch = new ScienceLabSearch(base.vessel, data);
     if (scienceLabSearch.NextLabForDataFound)
     {
         StartCoroutine(scienceLabSearch.NextLabForData.ProcessData(data, new Callback<ScienceData>(DumpData)));
     }
     else
     {
         scienceLabSearch.PostErrorToScreen();
     }
 }
 public void ReviewDataItem(ScienceData sd)
 {
     ImpactMonitor.Log("Reviewing data from seismomenter");
     ScienceLabSearch labSearch = new ScienceLabSearch(null,sd);
     expDialog = ExperimentsResultDialog.DisplayResult(new ExperimentResultDialogPage(part, sd, 1f, 0f, false, "", true, labSearch, DumpData, KeepData, TransmitData, null));
 }