Ejemplo n.º 1
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
            ExperimentResultDialogPage page = new ExperimentResultDialogPage(part, data, data.transmitValue, data.labBoost, false, "", true, hasLab, Reset, Keep, Transmit, Process);
            ExperimentsResultDialog    dlg  = ExperimentsResultDialog.DisplayResult(page);
        }
 public void ReviewData()
 {
     foreach (ScienceData data in scienceData)
     {
         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);
     }
 }
Ejemplo n.º 3
0
 public void ReviewData()
 {
     foreach (ScienceData data in scienceData)
     {
         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);
     }
 }
Ejemplo n.º 4
0
        /* ************************************************************************************************
        * Function Name: ReviewDataCoroutine
        * Input: The current science experiment and a pretty screenshot
        * Output: None
        * Purpose: Called as a coroutine; the game will not wait for this function to finish executing
        * before the end of a frame. This displays the science report dialog box, of which the player can
        * interact with.
        * ************************************************************************************************/
        public System.Collections.IEnumerator ReviewDataCoroutine(ScienceData Data, Texture2D Screenshot)
        {
            yield return(new WaitForEndOfFrame());

            //GUIStyle ProgressStyle;
            //GUIStyle ScienceStyle;

            ExperimentResultDialogPage page = new ExperimentResultDialogPage
                                              (
                FlightGlobals.ActiveVessel.rootPart,          //hosting part
                Data,                                         //Science data
                Data.baseTransmitValue,                       //scalar for transmitting the data
                Data.labValue,                                //scalar for lab bonuses
                false,                                        //bool for show transmit warning
                "",                                           //string for transmit warning
                false,                                        //show the reset button
                new ScienceLabSearch(this.part.vessel, Data), //show the lab option
                new Callback <ScienceData>(_onPageDiscard),
                new Callback <ScienceData>(_onPageKeep),
                new Callback <ScienceData>(_onPageTransmit),
                new Callback <ScienceData>(_onPageSendToLab)
                                              );

            //page.scienceValue = 0f;
            ExperimentsResultDialog ScienceDialog = ExperimentsResultDialog.DisplayResult(page);

            //Store the old dialog gui information
//            ProgressStyle = ScienceDialog.guiSkin.customStyles.Where(n => n.name == "progressBarFill2").First();
//            GUIStyle style = ScienceDialog.guiSkin.box;
//            StyleDefault = style.normal;
//            SkinStored = ScienceDialog.guiSkin;

            ////Lets put a pretty picture on the science dialog.
//            ScienceStyle = ScienceDialog.guiSkin.box;
            ScienceStyle.normal.background = Screenshot;

//            ScienceDialog.guiSkin.window.fixedWidth = 587f;
            ScienceStyle.fixedWidth  = 512f;
            ScienceStyle.fixedHeight = 288f;
        }
Ejemplo n.º 5
0
 public void ReviewDataItem(ScienceData sd)
 {
     expDialog = ExperimentsResultDialog.DisplayResult(new ExperimentResultDialogPage(part, sd, 1f, 0f, false, "", true, false, DumpData, KeepData, TransmitData, null));
 }