Beispiel #1
0
        public static bool ShowAtPosition(Rect rect, PackageFilterTab tab, PageFilters filters)
        {
            if (s_Window != null)
            {
                return(false);
            }

            var nowMilliSeconds = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;
            var justClosed      = nowMilliSeconds < s_LastClosedTime + 150;

            if (!justClosed)
            {
                Event.current?.Use();

                if (tab != PackageFilterTab.AssetStore)
                {
                    return(false);
                }

                s_Window = CreateInstance <AssetStoreFiltersWindow>();
                s_Window.Init(rect, filters);
            }

            return(!justClosed);
        }
Beispiel #2
0
        public override void UpdateFilters(PageFilters filters)
        {
            if (this.filters.Equals(filters))
                return;

            m_Filters = filters.Clone();
            Rebuild();
        }
Beispiel #3
0
 protected virtual void Init(Rect rect, PageFilters filters)
 {
     m_Filters = filters?.Clone() ?? new PageFilters();
     m_Container.Clear();
     DoDisplay();
     ApplyFilters();
     ShowAsDropDown(rect, GetSize(), new[] { PopupLocation.Below });
 }
Beispiel #4
0
        protected override void Init(Rect rect, PageFilters filters)
        {
            m_AssetStoreClient.ListCategories(categories =>
            {
                m_Categories = categories ?? new List <string>();

                m_AssetStoreClient.ListLabels(labels =>
                {
                    m_Labels = labels ?? new List <string>();

                    base.Init(rect, filters);
                });
            });
        }
Beispiel #5
0
 protected BasePage(PackageFilterTab tab, PageCapability capability)
 {
     m_Tab        = tab;
     m_Capability = capability;
     if (m_Filters == null)
     {
         var defaultOrdering = m_Capability?.orderingValues?.FirstOrDefault();
         m_Filters = new PageFilters
         {
             orderBy        = defaultOrdering?.orderBy,
             isReverseOrder = false
         };
     }
 }
        public override void UpdateFilters(PageFilters filters)
        {
            if (this.filters.Equals(filters))
            {
                return;
            }

            m_Filters = filters.Clone();
            var queryArgs = BuildQueryFromFilter(0, m_PackageManagerPrefs.numItemsPerPage ?? PageManager.k_DefaultPageSize);

            m_AssetStoreClient.ListPurchases(queryArgs, false);

            m_VisualStateList.ClearList();
            m_VisualStateList.ClearExtraItems();

            RefreshVisualStates();
            TriggerOnListRebuild();
        }
Beispiel #7
0
        public override void UpdateFilters(PageFilters filters)
        {
            if (this.filters.Equals(filters))
            {
                return;
            }

            m_Filters = filters.Clone();
            var queryArgs = BuildQueryFromFilter(0, PackageManagerWindow.instance?.packageList?.CalculateNumberOfPackagesToDisplay() ?? PageManager.k_DefaultPageSize);

            AssetStoreClient.instance.ListPurchases(queryArgs, false);

            m_VisualStateList.ClearList();
            m_VisualStateList.ClearExtraItems();

            RefreshVisualStates();
            TriggerOnListRebuild();
        }
        private void UpdateFiltersMenuText(PageFilters filters)
        {
            var filtersSet = new List <string>();

            if (filters?.isFilterSet ?? false)
            {
                if (filters.statuses?.Any() ?? false)
                {
                    filtersSet.Add(ApplicationUtil.instance.GetTranslationForText("Status"));
                }
                if (filters.categories?.Any() ?? false)
                {
                    filtersSet.Add(ApplicationUtil.instance.GetTranslationForText("Category"));
                }
                if (filters.labels?.Any() ?? false)
                {
                    filtersSet.Add(ApplicationUtil.instance.GetTranslationForText("Label"));
                }
            }
            filtersMenu.text = filtersSet.Any() ? $"{ApplicationUtil.instance.GetTranslationForText("Filters")} ({string.Join(",", filtersSet.ToArray())})" :  ApplicationUtil.instance.GetTranslationForText("Filters");
        }
Beispiel #9
0
        private void UpdateFiltersMenuText(PageFilters filters)
        {
            var filtersSet = new List <string>();

            if (filters?.isFilterSet ?? false)
            {
                if (filters.statuses?.Any() ?? false)
                {
                    filtersSet.Add(L10n.Tr("Status"));
                }
                if (filters.categories?.Any() ?? false)
                {
                    filtersSet.Add(L10n.Tr("Category"));
                }
                if (filters.labels?.Any() ?? false)
                {
                    filtersSet.Add(L10n.Tr("Label"));
                }
            }
            filtersMenu.text = filtersSet.Any() ? $"{L10n.Tr("Filters")} ({string.Join(",", filtersSet.ToArray())})" :  L10n.Tr("Filters");
        }
Beispiel #10
0
 public abstract void UpdateFilters(PageFilters filters);