private void OnVisibilityChanged(bool tf)
 {
     if (tf)
     {
         OnProfileChanged();
         return;
     }
     if (manager == null)
     {
         return;
     }
     manager.RebuildObserverList();
 }
        /// <summary>
        /// Regular, non-profile specific additional configuration options
        /// </summary>
        private void DrawAdditionalOptions()
        {
            //GUI.skin = whiteLabel;

            //additionalScrollPos = GUILayout.BeginScrollView(additionalScrollPos, Settings.Skin.scrollView, GUILayout.ExpandHeight(true));
            additionalScrollPos = GUILayout.BeginScrollView(additionalScrollPos, GUILayout.ExpandHeight(true));
            {
                GUILayout.Space(4f);

                GUILayout.BeginVertical(GUILayout.ExpandHeight(true));
                {
                    #region Alert settings
                    {
                        GUILayout.Box("User Interface Settings", GUILayout.ExpandWidth(true));

                        //-----------------------------------------------------
                        // global flask animation
                        //-----------------------------------------------------
                        GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
                        {
                            GUILayout.Label("Globally Enable Animation", GUILayout.ExpandWidth(true));
                            Settings.Instance.FlaskAnimationEnabled = AudibleToggle(Settings.Instance.FlaskAnimationEnabled, string.Empty, null, new GUILayoutOption[] { GUILayout.ExpandWidth(false) });
                            if (!Settings.Instance.FlaskAnimationEnabled && scienceAlert.Button.IsAnimating)
                            {
                                scienceAlert.Button.SetLit();
                            }
                        }
                        GUILayout.EndHorizontal();


                        //-----------------------------------------------------
                        // Display next report value in button
                        //-----------------------------------------------------
                        {
                            Settings.Instance.ShowReportValue = AudibleToggle(Settings.Instance.ShowReportValue, "Display Report Value");
                        }


                        //-----------------------------------------------------
                        // Display current biome in experiment list
                        //-----------------------------------------------------
                        {
                            Settings.Instance.DisplayCurrentBiome = AudibleToggle(Settings.Instance.DisplayCurrentBiome, "Display Biome in Experiment List");
                        }


                        //-----------------------------------------------------
                        // Interface window opacity
                        //-----------------------------------------------------
                        GUILayout.Label("Window Opacity");
                        GUILayout.BeginHorizontal();
                        GUILayout.Label("Less", miniLabelLeft);
                        GUILayout.FlexibleSpace();
                        GUILayout.Label("More", miniLabelRight);
                        GUILayout.EndHorizontal();
                        Settings.Instance.WindowOpacity = (int)GUILayout.HorizontalSlider(Settings.Instance.WindowOpacity, 0f, 255f, GUILayout.ExpandWidth(true), GUILayout.MaxHeight(16f));
                        GUILayout.Space(8f);
                    } // end alert settings
                    #endregion


                    #region scan interface options
                    // scan interface options
                    {
                        GUILayout.Box("Third-party Integration Options", GUILayout.ExpandWidth(true));

                        GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
                        {
                            var oldInterface = Settings.Instance.ScanInterfaceType;
                            var prevColor    = GUI.color;

                            if (!SCANsatInterface.IsAvailable())
                            {
                                GUI.color = Color.red;
                            }

                            bool enableSCANinterface = AudibleToggle(Settings.Instance.ScanInterfaceType == Settings.ScanInterface.ScanSat, "Enable SCANsat integration", null, new GUILayoutOption[] { GUILayout.ExpandWidth(true) });

                            GUI.color = prevColor;

                            if (enableSCANinterface && oldInterface != Settings.ScanInterface.ScanSat) // Settings won't return SCANsatInterface as the set interface if it wasn't found
                            {
                                if (!SCANsatInterface.IsAvailable())
                                {
                                    PopupDialog.SpawnPopupDialog("SCANsat Not Found", "SCANsat was not found. You must install SCANsat to use this feature.", "Okay", false, Settings.Skin);
                                    enableSCANinterface = false;
                                }
                            }

                            Settings.Instance.ScanInterfaceType = enableSCANinterface ? Settings.ScanInterface.ScanSat : Settings.ScanInterface.None;

                            scienceAlert.ScanInterfaceType = Settings.Instance.ScanInterfaceType;
                        }
                        GUILayout.EndHorizontal();
                    } // end scan interface options


                    // toolbar interface options
                    {
                        GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
                        {
                            var oldInterface = Settings.Instance.ToolbarInterfaceType;
                            var prevColor    = GUI.color;

                            if (!ToolbarManager.ToolbarAvailable)
                            {
                                GUI.color = Color.red;
                            }

                            bool enableBlizzyToolbar = AudibleToggle(Settings.Instance.ToolbarInterfaceType == Settings.ToolbarInterface.BlizzyToolbar, "Use Blizzy toolbar");
                            GUI.color = prevColor;

                            if (enableBlizzyToolbar && oldInterface != Settings.ToolbarInterface.BlizzyToolbar)
                            {
                                if (!ToolbarManager.ToolbarAvailable)
                                {
                                    PopupDialog.SpawnPopupDialog("Blizzy Toolbar Not Found", "Blizzy's toolbar was not found. You must install Blizzy's toolbar to use this feature.", "Okay", false, Settings.Skin);
                                    enableBlizzyToolbar = false;
                                }
                            }

                            Settings.Instance.ToolbarInterfaceType = enableBlizzyToolbar ? Settings.ToolbarInterface.BlizzyToolbar : Settings.ToolbarInterface.ApplicationLauncher;

                            if (scienceAlert.ToolbarType != Settings.Instance.ToolbarInterfaceType)
                            {
                                scienceAlert.ToolbarType = Settings.Instance.ToolbarInterfaceType;
                            }
                        }
                        GUILayout.EndHorizontal();
                    } // end toolbar interface options
                    #endregion


                    #region crewed vessel settings
                    {
                        GUILayout.Box("Crewed Vessel Settings", GUILayout.ExpandWidth(true));

                        //Settings.Instance.ReopenOnEva = AudibleToggle(Settings.Instance.ReopenOnEva, "Re-open list on EVA");
                        //{ // eva report on top
                        //    var prev = Settings.Instance.EvaReportOnTop;

                        //    Settings.Instance.EvaReportOnTop = AudibleToggle(Settings.Instance.EvaReportOnTop, "List EVA report first");

                        //    if (Settings.Instance.EvaReportOnTop != prev)
                        //        manager.ScheduleRebuildObserverList();
                        //}

                        // Surface sample on vessel
                        {
                            var prev = Settings.Instance.CheckSurfaceSampleNotEva;

                            Settings.Instance.CheckSurfaceSampleNotEva = AudibleToggle(prev, "Track surface sample in vessel");

                            if (prev != Settings.Instance.CheckSurfaceSampleNotEva)
                            {
                                manager.RebuildObserverList();
                            }
                            //manager.ScheduleRebuildObserverList();
                        }
                    } // end crewed vessel settings
                    #endregion
                }
                GUILayout.EndVertical();

                GUI.skin = Settings.Skin;
            }
            GUILayout.EndScrollView();
        }