internal void OnGUI()
        {
            if (!showGui)
            {
                return;
            }

            // auto-close achievements list window
            if ((EarnedAchievements.instance == null) || !windowButton.Visibility.Visible)
            {
                achievementsWindow = null;
            }

#if LOCATION_PICKER
            if (SHOW_LOCATION_PICKER_BUTTON && (HighLogic.LoadedScene == GameScenes.FLIGHT) && MapView.MapIsEnabled)
            {
                drawLocationPickerButton();
            }
#endif

            if (toast != null)
            {
                if (!toast.isTimedOut())
                {
                    toast.draw();
                }
                else
                {
                    // auto-close toast after timeout
                    toast = null;
                }
            }

            if (achievementsWindow != null)
            {
                achievementsWindow.draw();
            }

#if LOCATION_PICKER
            if (locationPicker != null)
            {
                locationPicker.draw();
            }
#endif
        }
        private void toggleAchievementsWindow()
        {
            if (achievementsWindow == null)
            {
                achievementsWindow = new AchievementsWindow(EarnedAchievements.instance.achievements, EarnedAchievements.instance.earnedAchievements,
                                                            UpdateChecker.Done && (UpdateChecker.UpdateAvailable == true));
                achievementsWindow.closeCallback = () => {
                    achievementsWindow = null;
                };

                // reset toolbar button
                windowButton.TexturePath = "blizzy/Achievements/button-normal";
            }
            else
            {
                achievementsWindow = null;
            }
        }
Esempio n. 3
0
        public void toggleAchievementsWindow()
        {
            if (achievementsWindow == null)
            {
                achievementsWindow = new AchievementsWindow(EarnedAchievements.instance.achievements, EarnedAchievements.instance.earnedAchievements, false);
                achievementsWindow.closeCallback = () =>
                {
                    achievementsWindow = null;
                };

                // reset toolbar button
                //windowButton.TexturePath = "Achievements/button-normal";
            }
            else
            {
                achievementsWindow = null;
            }
        }