Esempio n. 1
0
        // Shows or hides the Checklist Window if the KSP toolbar is visible and the toolbar button is toggled on.
        private void UpdateChecklistVisibility(bool NewVisibility)
        {
            if (!_active)
            {
                return;
            }

//			_logger.Trace("UpdateChecklistVisibility");
            _checklistWindow.IsVisible = NewVisibility;
            if (_checklistWindow.IsVisible)
            {
                ScienceEventHandler.ScheduleExperimentUpdate( );
            }
        }
        private void ChecklistButton_RightClick(object sender, EventArgs e)
        {
            //WarezCrawler 20190410 - Try to get experiments to update around mun
            //_mustDoFullRefresh = true;
            //ScheduleExperimentUpdate();
            //ScienceContext.LoadStatus.OnboardScienceUnloadedVessels = false;
            //ScienceContext.LoadStatus.Experiments = false;
            //ScienceContext.LoadStatus.ScienceSubjects = false;
            ScienceContext.LoadStatus.ExperimentCache = false;
            //ScienceContext.LoadStatus.KSCBiomes = false;

            if (Config.RighClickMutesMusic)
            {
                // Toggle the muted state
                Muted = !Muted;
                ScreenMessages.PostScreenMessage("[x] Science! - Music Mute");
            }
            else
            {
                if (_active && UiActive( ))
                {
                    if (GameHelper.AllowStatusWindow( ))
                    {
                        bool NewVisibility = !_statusWindow.IsVisible( );
                        _statusWindow.SetVisible(NewVisibility);
                        UpdateStatusVisibility(NewVisibility);

                        if (_statusWindow.IsVisible( ))
                        {
                            if (_statusButton != null)
                            {
                                _statusButton.SetOn( );
                            }
                            ScienceEventHandler.ScheduleExperimentUpdate( );
                        }
                        else
                        {
                            if (_statusButton != null)
                            {
                                _statusButton.SetOff( );
                            }
                        }
                    }
                }
            }
        }
        private void ChecklistButton_RightClick(object sender, EventArgs e)
        {
            if (Config.RighClickMutesMusic)
            {
                // Toggle the muted state
                Muted = !Muted;
                ScreenMessages.PostScreenMessage("[x] Science! - Music Mute");
            }
            else
            {
                if (_active && UiActive())
                {
                    if (GameHelper.AllowStatusWindow())
                    {
                        bool NewVisibility = !_statusWindow.IsVisible();
                        _statusWindow.SetVisible(NewVisibility);
                        UpdateStatusVisibility(NewVisibility);

                        _logger.Trace("ChecklistButton_RightClick, _statusWindow.IsVisible(): " + _statusWindow.IsVisible());
                        if (_statusWindow.IsVisible())
                        {
                            if (statusToolbarControl != null)
                            {
                                statusToolbarControl.SetTrue(true);
                            }
                            ScienceEventHandler.ScheduleExperimentUpdate(seconds: 0.1f);
                        }
                        else
                        {
                            if (statusToolbarControl != null)
                            {
                                statusToolbarControl.SetFalse(true);
                            }
                        }
                    }
                }
            }
        }
        /// <summary>
        /// Shows or hides the ScienceWindow if the KSP toolbar is visible and the toolbar button is toggled on.
        /// </summary>
        private void UpdateVisibility(bool NewVisibility)
        {
            if (!_active)
            {
                return;
            }

//			_logger.Trace("UpdateVisibility");
            _window.IsVisible = NewVisibility;
            if (_window.IsVisible)
            {
                _EventHandler.ScheduleExperimentUpdate( );
            }
        }
Esempio n. 5
0
        private void ChecklistButton_RightClick(object sender, EventArgs e)
        {
            if (Config.RighClickMutesMusic)
            {
                // Toggle the muted state
                Muted = !Muted;
                ScreenMessages.PostScreenMessage("[x] Science! - Music Mute");
            }
            else
            {
                if (_active && UiActive( ))
                {
                    if (GameHelper.AllowStatusWindow( ))
                    {
                        bool NewVisibility = !_statusWindow.IsVisible( );
                        _statusWindow.SetVisible(NewVisibility);
                        UpdateStatusVisibility(NewVisibility);

                        if (_statusWindow.IsVisible( ))
                        {
                            if (_statusButton != null)
                            {
                                _statusButton.SetOn( );
                            }
                            ScienceEventHandler.ScheduleExperimentUpdate( );
                        }
                        else
                        {
                            if (_statusButton != null)
                            {
                                _statusButton.SetOff( );
                            }
                        }
                    }
                }
            }
        }