Exemple #1
0
        // Bung new situation into filter and recalculate everything
        public void UpdateSituation(object sender, NewSituationData e)
        {
//			_logger.Trace( "UpdateSituation" );
            _filter.CurrentSituation = new Situation(e._body, e._situation, e._biome, e._subBiome);
            RefreshFilter(sender, e);
            if (_filter.TotalCount > 0)
            {
                if (_filter.TotalCount - _filter.CompleteCount > 0)
                {
                    if (IsVisible( ))
                    {
                        if (_parent.Config.StopTimeWarp && (!_parent.Config.StopTimeWarpOnlyOnNewScience || _filter.NewScienceCount > 0))
                        {
                            GameHelper.StopTimeWarp( );
                        }
                        if (_parent.Config.PlayNoise)
                        {
                            PlayNoise( );
                        }
                        if (_parent.Config.StopTimeWarp || _parent.Config.PlayNoise)
                        {
                            ScreenMessages.PostScreenMessage("New Situation: " + _filter.CurrentSituation.Description);
                        }
                    }
                }
            }
        }
Exemple #2
0
        // Bung new situation into filter and recalculate everything
        public void UpdateSituation(object sender, NewSituationData e)
        {
//			_logger.Trace( "UpdateSituation" );
            if (e == null)
            {
                _filter.CurrentSituation = null;
                return;
            }
            else
            {
                _filter.CurrentSituation = new Situation(e._body, e._situation, e._biome, e._subBiome);
            }
            RefreshFilter(sender, e);



            _logger.Trace("ScienceThisBiome: " + _filter.TotalCount + " / " + _filter.CompleteCount);
            if (_filter.TotalCount > 0)
            {
                var anyRunnableExperiments = false;
                for (var i = 0; i < _filter.DisplayScienceInstances.Count; i++)
                {
                    var experiment = _filter.DisplayScienceInstances[i];
                    var Id         = experiment.ScienceExperiment.id;

                    if (Id == "crewReport" || Id == "surfaceSample" || Id == "evaReport")                      // Always pop UI for Kerbal experiments
                    {
                        anyRunnableExperiments = true;
                        break;
                    }
                    else
                    {
                        if (CanRunExperiment(experiment))
                        {
                            anyRunnableExperiments = true;
                            break;
                        }
                    }
                }

                if (anyRunnableExperiments)
                {
                    if (IsVisible( ))
                    {
                        if (_parent.Config.StopTimeWarp)
                        {
                            GameHelper.StopTimeWarp( );
                        }
                        if (_parent.Config.PlayNoise)
                        {
                            PlayNoise( );
                        }
                        if (_parent.Config.StopTimeWarp || _parent.Config.PlayNoise)
                        {
                            ScreenMessages.PostScreenMessage("New Situation: " + _filter.CurrentSituation.Description);
                        }
                    }
                }
            }
        }
Exemple #3
0
        // Bung new situation into filter and recalculate everything
        public void UpdateSituation(object sender, NewSituationData e)
        {
//			_logger.Trace( "UpdateSituation" );
            if (e == null)
            {
                _filter.CurrentSituation = null;
                return;
            }
            else
            {
                _filter.CurrentSituation = new Situation(e._body, e._situation, e._biome, e._subBiome);
            }
            RefreshFilter(sender, e);



            _logger.Trace("ScienceThisBiome: " + _filter.TotalCount + " / " + _filter.CompleteCount);
            if (_filter.TotalCount > 0)
            {
                if (_filter.TotalCount - _filter.CompleteCount > 0)
                {
                    if (IsVisible( ))
                    {
                        if (_parent.Config.StopTimeWarp)
                        {
                            GameHelper.StopTimeWarp( );
                        }
                        if (_parent.Config.PlayNoise)
                        {
                            PlayNoise( );
                        }
                        if (_parent.Config.StopTimeWarp || _parent.Config.PlayNoise)
                        {
                            ScreenMessages.PostScreenMessage("New Situation: " + _filter.CurrentSituation.Description);
                        }
                    }
                }
            }
        }
Exemple #4
0
        // Bung new situation into filter and recalculate everything
        public void UpdateSituation(object sender, NewSituationData e)
        {
            // Following commented out because if not visible, this was returning and never setting the CurrentSituation
#if false
            if (!IsVisible())
            {
                return;
            }
#endif
            // _logger.Trace( "StatusWindow.UpdateSituation" );
            if (e == null)
            {
                _filter.CurrentSituation = null;
                return;
            }
            else
            {
                _filter.CurrentSituation = new Situation(e._body, e._situation, e._biome, e._subBiome);
            }

            //_logger.Trace( "ScienceThisBiome: " + _filter.TotalCount + " / " + _filter.CompleteCount );

            if (_filter.TotalCount > 0)
            {
                var anyRunnableExperiments = false;
                for (var i = 0; i < _filter.DisplayScienceInstances.Count; i++)
                {
                    var experiment = _filter.DisplayScienceInstances[i];
                    var Id         = experiment.ScienceExperiment.id;

                    if (experiment.NextScienceIncome < _parent.Config.ScienceThreshold)
                    {
                        continue;
                    }

                    if (Id == "crewReport" || Id == "surfaceSample" || Id == "evaReport") // Always pop UI for Kerbal experiments
                    {
                        anyRunnableExperiments = true;
                        break;
                    }
                    else
                    {
                        if (CanRunExperiment(experiment))
                        {
                            anyRunnableExperiments = true;
                            break;
                        }
                    }
                }

                if (anyRunnableExperiments)
                {
                    if (IsVisible())
                    {
                        if (_parent.Config.StopTimeWarp)
                        {
                            GameHelper.StopTimeWarp();
                        }
                        if (_parent.Config.PlayNoise)
                        {
                            PlayNoise();
                        }
                        if (_parent.Config.StopTimeWarp || _parent.Config.PlayNoise)
                        {
                            ScreenMessages.PostScreenMessage("New Situation: " + _filter.CurrentSituation.Description);
                        }
                    }
                }
            }
        }