示例#1
0
        void SetLaunchsite()
        {
            LaunchSiteManager.setLauncsite(selectedSite);
            string message = Localizer.Format(KKLocalization.HasBeenSetAsLaunchsite, SiteName);

            MiscUtils.HUDMessage(message, 10, 0);
        }
        public void Open()
        {
            gameObject.SetActive(true);
            try
            {
                var lastLaunchsite = LaunchSiteManager.GetLaunchSiteByName(KerbalKonstructs.instance.lastLaunchSiteUsed);
                if (LaunchSiteManager.CheckLaunchSiteIsValid(lastLaunchsite))
                {
                    selectedSite = lastLaunchsite;
                    defaultSite  = selectedSite;
                }
                if (selectedSite.isOpen == false)
                {
                    Log.Error("LastSiteUsed is invalid, trying default");
                    selectedSite = LaunchSiteManager.GetDefaultSite();
                    defaultSite  = selectedSite;
                }
            }
            catch
            {
                selectedSite = LaunchSiteManager.GetDefaultSite();
            }

            BaseManager.selectedSite = selectedSite;
            BaseManager.instance.Open();
            LaunchSiteManager.setLauncsite(selectedSite);
            UpdateUI();
            BuildLaunchsites();
        }