private void OnClose()
        {
            _dialog = null;

            if (KerbNetToolbar.Instance != null)
            {
                KerbNetToolbar.Instance.SetToolbarState(false);
            }
        }
        public void Close()
        {
            KerbNetDialog.Close();

            _dialog = null;
        }
        public void Open()
        {
            if (_dialog != null)
            {
                Close();
            }

            if (SimpleScan())
            {
                if (KerbNetToolbar.Instance != null)
                {
                    KerbNetToolbar.Instance.SetToolbarEnabled(true);
                }

                ScanVessel();
            }
            else
            {
                if (KerbNetToolbar.Instance != null)
                {
                    KerbNetToolbar.Instance.SetToolbarEnabled(false);
                }

                return;
            }

            if (!_settings.rememberMode || string.IsNullOrEmpty(_currentMode) || !_kerbnets.ContainsKey(_currentMode))
            {
                _currentMode = GetFirstMode();
            }

            UpdateValues(_currentMode);

            _dialog = KerbNetDialog.Display(this);

            _dialog.transform.localScale *= _settings.scale;

            AddModeListener();

            SetCloseListener();

            if (_settings.rememberOverlay)
            {
                SetOverlayListener();
            }

            if (_settings.autoRefresh)
            {
                SetAutoRefreshListener();
            }

            if (_settings.rememberFoV)
            {
                SetFoVListener();
            }

            if (_settings.orientationButton)
            {
                SetOrientationButton();
            }

            if (!_settings.showTooltips)
            {
                KillTooltips();
            }

            UpdateDisplay();
        }