Ejemplo n.º 1
0
        protected void drawGeoExperimentGUI()
        {
            //If user has switched the experiment to research, then we must record the elapsed time for that experiment.
            GeologyLabExperiments experiment = (GeologyLabExperiments)GUILayout.SelectionGrid((int)currentExperiment, experimentTypes, 2);

            if (experiment != currentExperiment && ModuleIsActive())
            {
                int elapsedTimeIndex;

                //Record current elapsed time.
                if (currentExperiment != GeologyLabExperiments.None)
                {
                    elapsedTimeIndex = (int)currentExperiment;
                    elapsedTimes[elapsedTimeIndex] = elapsedTime;
                }

                //Get the new elapsed time.
                elapsedTimeIndex = (int)experiment;
                elapsedTime      = elapsedTimes[elapsedTimeIndex];

                //Reset the research start time.
                cycleStartTime = Planetarium.GetUniversalTime() - elapsedTime;

                //Show tooltip
                checkAndShowToolTip();
            }

            //Record the new experiment
            currentExperiment = experiment;
        }
Ejemplo n.º 2
0
        public override void OnLoad(ConfigNode node)
        {
            base.OnLoad(node);

            currentExperiment = (GeologyLabExperiments)Enum.Parse(typeof(GeologyLabExperiments), node.GetValue("currentExperiment"));

            if (node.HasValue("experimentTimes"))
            {
                string experimentTimes = node.GetValue("experimentTimes");
                string[] times = experimentTimes.Split(new char[] { ';' });
                for (int index = 0; index < times.Length; index++)
                    elapsedTimes[index] = float.Parse(times[index]);
            }
        }
Ejemplo n.º 3
0
        public override void OnLoad(ConfigNode node)
        {
            base.OnLoad(node);

            currentExperiment = (GeologyLabExperiments)Enum.Parse(typeof(GeologyLabExperiments), node.GetValue("currentExperiment"));

            if (node.HasValue("experimentTimes"))
            {
                string   experimentTimes = node.GetValue("experimentTimes");
                string[] times           = experimentTimes.Split(new char[] { ';' });
                for (int index = 0; index < times.Length; index++)
                {
                    elapsedTimes[index] = float.Parse(times[index]);
                }
            }
        }
Ejemplo n.º 4
0
        protected string getExperimentName(GeologyLabExperiments experiment)
        {
            switch (experiment)
            {
            default:
            case GeologyLabExperiments.None:
                return("None");

            case GeologyLabExperiments.SoilAnalysis:
                return("Soil Analysis");

            case GeologyLabExperiments.MetallurgyAnalysis:
                return("Metallurgic Analysis");

            case GeologyLabExperiments.ChemicalAnalysis:
                return("Chemical Analysis");

            case GeologyLabExperiments.BiomeAnalysis:
                return("Biome Analysis");
            }
        }
Ejemplo n.º 5
0
        protected string getExperimentName(GeologyLabExperiments experiment)
        {
            switch (experiment)
            {
                default:
                case GeologyLabExperiments.None:
                    return "None";

                case GeologyLabExperiments.SoilAnalysis:
                    return "Soil Analysis";

                case GeologyLabExperiments.MetallurgyAnalysis:
                    return "Metallurgic Analysis";

                case GeologyLabExperiments.ChemicalAnalysis:
                    return "Chemical Analysis";

                case GeologyLabExperiments.BiomeAnalysis:
                    return "Biome Analysis";
            }
        }
Ejemplo n.º 6
0
        protected void drawGeoExperimentGUI()
        {
            //If user has switched the experiment to research, then we must record the elapsed time for that experiment.
            GeologyLabExperiments experiment = (GeologyLabExperiments)GUILayout.SelectionGrid((int)currentExperiment, experimentTypes, 2);
            if (experiment != currentExperiment && ModuleIsActive())
            {
                int elapsedTimeIndex;

                //Record current elapsed time.
                if (currentExperiment != GeologyLabExperiments.None)
                {
                    elapsedTimeIndex = (int)currentExperiment;
                    elapsedTimes[elapsedTimeIndex] = elapsedTime;
                }

                //Get the new elapsed time.
                elapsedTimeIndex = (int)experiment;
                elapsedTime = elapsedTimes[elapsedTimeIndex];

                //Reset the research start time.
                cycleStartTime = Planetarium.GetUniversalTime() - elapsedTime;

                //Show tooltip
                checkAndShowToolTip();
            }

            //Record the new experiment
            currentExperiment = experiment;
        }