private void SortHeroList()
 {
     if (this.m_heroList != null)
     {
         this.m_heroList.Sort(CMallSortHelper.CreateHeroSorter());
         if (CMallSortHelper.CreateHeroSorter().IsDesc())
         {
             this.m_heroList.Reverse();
         }
     }
 }
Beispiel #2
0
 private void SetCurSortTitleName()
 {
     if (this._curMenuPage == MenuPage.Hero)
     {
         this._sortTitle.GetComponent <Text>().text = CMallSortHelper.CreateHeroSorter().GetSortTypeName(this._curHeroSortType);
     }
     else
     {
         this._sortTitle.GetComponent <Text>().text = CMallSortHelper.CreateSkinSorter().GetSortTypeName(this._curSkinSortType);
     }
 }
Beispiel #3
0
 private void CleanSortHeroList()
 {
     CMallSortHelper.CreateHeroSorter().SetSortType(this._curHeroSortType);
     if (this._heroList.Count > this._heroTotalNum)
     {
         this._heroList.RemoveRange(this._heroTotalNum + 1, this._heroList.Count - this._heroTotalNum);
     }
     this._heroList.Sort(CMallSortHelper.CreateHeroSorter());
     if (CMallSortHelper.CreateHeroSorter().IsDesc())
     {
         this._heroList.Reverse();
     }
 }
Beispiel #4
0
 private void SetSortContent()
 {
     GiftCenter.MenuPage curMenuPage = this._curMenuPage;
     if (curMenuPage != GiftCenter.MenuPage.Hero)
     {
         if (curMenuPage == GiftCenter.MenuPage.Skin)
         {
             int elementAmount = 5;
             this._sortList.SetElementAmount(elementAmount);
             for (int i = 0; i < 5; i++)
             {
                 CUIListElementScript elemenet  = this._sortList.GetElemenet(i);
                 Transform            transform = elemenet.transform.Find("Text");
                 Text component = transform.GetComponent <Text>();
                 if (component != null)
                 {
                     component.set_text(CMallSortHelper.CreateSkinSorter().GetSortTypeName((CMallSortHelper.SkinSortType)i));
                 }
             }
         }
     }
     else
     {
         int elementAmount2 = 4;
         this._sortList.SetElementAmount(elementAmount2);
         int num = 0;
         for (int j = 0; j < 5; j++)
         {
             if (j != 3)
             {
                 CUIListElementScript elemenet2  = this._sortList.GetElemenet(num);
                 Transform            transform2 = elemenet2.transform.Find("Text");
                 Text component2 = transform2.GetComponent <Text>();
                 if (component2 != null)
                 {
                     component2.set_text(CMallSortHelper.CreateHeroSorter().GetSortTypeName((CMallSortHelper.HeroSortType)j));
                 }
                 num++;
             }
         }
     }
     this._sortList.m_alwaysDispatchSelectedChangeEvent = true;
     this.SetSelectedElementInSortList();
     this.SetCurSortTitleName();
 }
Beispiel #5
0
        private void SetSortContent()
        {
            int amount = 0;

            switch (this._curMenuPage)
            {
            case MenuPage.Hero:
            {
                amount = 4;
                this._sortList.SetElementAmount(amount);
                int index = 0;
                for (int i = 0; i < 5; i++)
                {
                    if (i != 3)
                    {
                        Text component = this._sortList.GetElemenet(index).transform.Find("Text").GetComponent <Text>();
                        if (component != null)
                        {
                            component.text = CMallSortHelper.CreateHeroSorter().GetSortTypeName((CMallSortHelper.HeroSortType)i);
                        }
                        index++;
                    }
                }
                break;
            }

            case MenuPage.Skin:
                amount = 4;
                this._sortList.SetElementAmount(amount);
                for (int j = 0; j < 4; j++)
                {
                    Text text2 = this._sortList.GetElemenet(j).transform.Find("Text").GetComponent <Text>();
                    if (text2 != null)
                    {
                        text2.text = CMallSortHelper.CreateSkinSorter().GetSortTypeName((CMallSortHelper.SkinSortType)j);
                    }
                }
                break;
            }
            this._sortList.m_alwaysDispatchSelectedChangeEvent = true;
            this.SetSelectedElementInSortList();
            this.SetCurSortTitleName();
        }