Пример #1
0
        void BuildLaunchsites()
        {
            launchsiteItems.Clear();
            int index = 0;

            for (int i = 0, count = center.launchsites.Count; i < count; i++)
            {
                var site = center.launchsites[i];
                if (site == selectedSite)
                {
                    index = launchsiteItems.Count;
                }
                launchsiteItems.Add(new LaunchsiteItem(site));
            }
            UIKit.UpdateListContent(launchsiteItems);
            launchsiteItems.Select(index);
        }
        void BuildLaunchsites()
        {
            launchsiteItems.Clear();
            int index = 0;

            for (int i = 0, count = LaunchSiteManager.allLaunchSites.Length; i < count; i++)
            {
                var site = LaunchSiteManager.allLaunchSites[i];
                if (launchsiteFilter.showFavOnly && (site.favouriteSite != "Yes"))
                {
                    continue;
                }

                if (launchsiteFilter.category != site.sitecategory && !launchsiteFilter.showAllcategorys)
                {
                    continue;
                }

                if (LaunchSiteManager.CheckLaunchSiteIsValid(site) == false)
                {
                    continue;
                }
                if ((!launchsiteFilter.showOpen && site.isOpen) || (!launchsiteFilter.showClosed && !site.isOpen))
                {
                    continue;
                }
                // Don't show hidden closed Bases
                if (site.LaunchSiteIsHidden && (!site.isOpen))
                {
                    //Log.Normal("Ignoring hidden base: " + site.LaunchSiteName);
                    continue;
                }
                if (site == selectedSite)
                {
                    index = launchsiteItems.Count;
                }
                launchsiteItems.Add(new LaunchsiteItem(site));
            }
            UIKit.UpdateListContent(launchsiteItems);
            launchsiteItems.Select(index);
        }