Esempio n. 1
0
        public void OnOpenHeroViewForm(CUIEvent uiEvent)
        {
            CUICommonSystem.ResetLobbyFormFadeRecover();
            CUIFormScript cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm(CHeroOverviewSystem.s_heroViewFormPath, false, true);

            if (cUIFormScript == null)
            {
                return;
            }
            Singleton <CLobbySystem> .GetInstance().SetTopBarPriority(enFormPriority.Priority0);

            this.m_selectHeroType = enHeroJobType.All;
            CMallSortHelper.CreateHeroViewSorter().SetSortType(this.m_heroSortType);
            this.ResetHeroListData(true);
            string text = Singleton <CTextManager> .GetInstance().GetText("Hero_Job_All");

            string text2 = Singleton <CTextManager> .GetInstance().GetText("Hero_Job_Tank");

            string text3 = Singleton <CTextManager> .GetInstance().GetText("Hero_Job_Soldier");

            string text4 = Singleton <CTextManager> .GetInstance().GetText("Hero_Job_Assassin");

            string text5 = Singleton <CTextManager> .GetInstance().GetText("Hero_Job_Master");

            string text6 = Singleton <CTextManager> .GetInstance().GetText("Hero_Job_Archer");

            string text7 = Singleton <CTextManager> .GetInstance().GetText("Hero_Job_Aid");

            string[] titleList = new string[]
            {
                text,
                text2,
                text3,
                text4,
                text5,
                text6,
                text7
            };
            GameObject gameObject = cUIFormScript.transform.Find("Panel_Menu/List").gameObject;

            CUICommonSystem.InitMenuPanel(gameObject, titleList, (int)this.m_selectHeroType, true);
            this.RefreshHeroOwnFlag();
            this.ResetHeroSortTypeList();
            GameObject widget = cUIFormScript.GetWidget(4);

            Singleton <CUINewFlagSystem> .instance.AddNewFlag(widget, enNewFlagKey.New_HeroOverViewOpenStoryUrl_V14, enNewFlagPos.enTopRight, 0.8f, 0f, 0f, enNewFlagType.enNewFlag);

            CMiShuSystem.SendUIClickToServer(enUIClickReprotID.rp_HeroListBtn);
            if (CSysDynamicBlock.bLobbyEntryBlocked)
            {
                Transform transform = cUIFormScript.transform.FindChild("Panel_Hero/Panel_Hero_TitleBg/BtnStoryWeb");
                if (transform != null)
                {
                    transform.gameObject.CustomSetActive(false);
                }
            }
        }
Esempio n. 2
0
        public static void SortHeroList(ref ListView <IHeroData> heroList, CMallSortHelper.HeroViewSortType sortType = CMallSortHelper.HeroViewSortType.Default, bool bDesc = false)
        {
            if (Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo() == null)
            {
                return;
            }
            HeroViewSortImp heroViewSortImp = CMallSortHelper.CreateHeroViewSorter();

            if (heroViewSortImp != null)
            {
                heroViewSortImp.SetSortType(sortType);
                heroList.Sort(heroViewSortImp);
            }
            if (bDesc)
            {
                heroList.Reverse();
            }
        }
Esempio n. 3
0
        public void OnOpenHeroViewForm(CUIEvent uiEvent)
        {
            CUIFormScript cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm(CHeroOverviewSystem.s_heroViewFormPath, false, true);

            if (cUIFormScript == null)
            {
                return;
            }
            Singleton <CLobbySystem> .GetInstance().SetTopBarPriority(enFormPriority.Priority0);

            this.m_selectHeroType = enHeroJobType.All;
            CMallSortHelper.CreateHeroViewSorter().SetSortType(this.m_heroSortType);
            this.ResetHeroListData(true);
            string text = Singleton <CTextManager> .GetInstance().GetText("Hero_Job_All");

            string text2 = Singleton <CTextManager> .GetInstance().GetText("Hero_Job_Tank");

            string text3 = Singleton <CTextManager> .GetInstance().GetText("Hero_Job_Soldier");

            string text4 = Singleton <CTextManager> .GetInstance().GetText("Hero_Job_Assassin");

            string text5 = Singleton <CTextManager> .GetInstance().GetText("Hero_Job_Master");

            string text6 = Singleton <CTextManager> .GetInstance().GetText("Hero_Job_Archer");

            string text7 = Singleton <CTextManager> .GetInstance().GetText("Hero_Job_Aid");

            string[] titleList = new string[]
            {
                text,
                text2,
                text3,
                text4,
                text5,
                text6,
                text7
            };
            GameObject gameObject = cUIFormScript.transform.Find("Panel_Menu/List").gameObject;

            CUICommonSystem.InitMenuPanel(gameObject, titleList, (int)this.m_selectHeroType, true);
            this.RefreshHeroOwnFlag();
            this.ResetHeroSortTypeList();
            CMiShuSystem.SendUIClickToServer(enUIClickReprotID.rp_HeroListBtn);
        }
Esempio n. 4
0
        private void FilterHeroData(bool bOnlySort)
        {
            ListView <ResHeroCfgInfo> allHeroList = CHeroDataFactory.GetAllHeroList();

            if (!bOnlySort)
            {
                this.m_heroList.Clear();
                for (int i = 0; i < allHeroList.get_Count(); i++)
                {
                    if (this.m_selectHeroType == enHeroJobType.All || allHeroList.get_Item(i).bMainJob == (byte)this.m_selectHeroType || allHeroList.get_Item(i).bMinorJob == (byte)this.m_selectHeroType)
                    {
                        IHeroData heroData  = CHeroDataFactory.CreateHeroData(allHeroList.get_Item(i).dwCfgID);
                        CMallItem cMallItem = new CMallItem(heroData.cfgID, CMallItem.IconType.Normal);
                        if (this.m_ownFlag)
                        {
                            if (cMallItem.Owned(false))
                            {
                                this.m_heroList.Add(heroData);
                            }
                        }
                        else
                        {
                            this.m_heroList.Add(heroData);
                        }
                    }
                }
            }
            HeroViewSortImp heroViewSortImp = CMallSortHelper.CreateHeroViewSorter();

            if (heroViewSortImp != null)
            {
                heroViewSortImp.SetSortType(this.m_heroSortType);
                this.m_heroList.Sort(heroViewSortImp);
                if (this.m_bSortDesc)
                {
                    this.m_heroList.Reverse();
                }
            }
        }
Esempio n. 5
0
        private void ResetHeroSortTypeList()
        {
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CHeroOverviewSystem.s_heroViewFormPath);

            if (form == null)
            {
                return;
            }
            GameObject widget = form.GetWidget(2);

            if (widget != null)
            {
                CUIListScript component = widget.GetComponent <CUIListScript>();
                if (component != null)
                {
                    int num = 4;
                    component.SetElementAmount(num);
                    for (int i = 0; i < num; i++)
                    {
                        CUIListElementScript elemenet  = component.GetElemenet(i);
                        Transform            transform = elemenet.transform.Find("Text");
                        if (transform != null)
                        {
                            transform.GetComponent <Text>().text = CMallSortHelper.CreateHeroViewSorter().GetSortTypeName((CMallSortHelper.HeroViewSortType)i);
                        }
                    }
                    component.SelectElement((int)this.m_heroSortType, true);
                }
                widget.CustomSetActive(false);
            }
            GameObject widget2 = form.GetWidget(1);

            if (widget2 != null)
            {
                widget2.GetComponent <Text>().text = CMallSortHelper.CreateHeroViewSorter().GetSortTypeName(this.m_heroSortType);
            }
        }
Esempio n. 6
0
        private void OnHeroSortTypeSelect(CUIEvent uiEvent)
        {
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CHeroOverviewSystem.s_heroViewFormPath);

            if (form == null)
            {
                return;
            }
            GameObject widget = form.GetWidget(2);

            if (widget != null)
            {
                widget.CustomSetActive(false);
            }
            CMallSortHelper.HeroViewSortType srcWidgetIndexInBelongedList = (CMallSortHelper.HeroViewSortType)uiEvent.m_srcWidgetIndexInBelongedList;
            HeroViewSortImp heroViewSortImp = CMallSortHelper.CreateHeroViewSorter();

            heroViewSortImp.SetSortType(srcWidgetIndexInBelongedList);
            if (this.m_heroSortType != srcWidgetIndexInBelongedList)
            {
                this.m_bSortDesc    = false;
                this.m_heroSortType = srcWidgetIndexInBelongedList;
                this.ResetHeroListData(true);
            }
            else if (srcWidgetIndexInBelongedList != CMallSortHelper.HeroViewSortType.Default)
            {
                this.m_bSortDesc = !this.m_bSortDesc;
                this.ResetHeroListData(false);
            }
            GameObject widget2 = form.GetWidget(1);

            if (widget2 != null)
            {
                widget2.GetComponent <Text>().text = CMallSortHelper.CreateHeroViewSorter().GetSortTypeName(this.m_heroSortType);
            }
        }