public void RefreshHeroInfo()
        {
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(s_qualifyingFormPath);

            if (form != null)
            {
                ListView <IHeroData> hostHeroList = CHeroDataFactory.GetHostHeroList(true);
                GameObject           gameObject   = form.gameObject.transform.Find("Panel/Panel_HeroInfo").gameObject;
                Text          component           = gameObject.transform.Find("lblProficiency").GetComponent <Text>();
                CUIListScript script2             = gameObject.transform.Find("ListHeroIno").GetComponent <CUIListScript>();
                script2.SetElementAmount(hostHeroList.Count);
                for (int i = 0; i < hostHeroList.Count; i++)
                {
                    GameObject obj3  = script2.GetElemenet(i).gameObject;
                    Image      image = obj3.transform.Find("heroInfo/imgRank").GetComponent <Image>();
                    Text       text2 = obj3.transform.Find("heroInfo/lblRank").GetComponent <Text>();
                    image.SetSprite(CUIUtility.s_Sprite_System_Qualifying_Dir + "ranking_icon" + hostHeroList[i].proficiencyLV, form, true, false, false);
                    text2.text = hostHeroList[i].proficiency.ToString();
                }
                uint num2 = 0;
                for (int j = 0; j < hostHeroList.Count; j++)
                {
                    num2 += hostHeroList[j].proficiency;
                }
                string[] values = new string[] { num2.ToString() };
                component.text = CUIUtility.StringReplace(Singleton <CTextManager> .GetInstance().GetText("Qualifying_Title0"), values);
            }
        }
Example #2
0
        private static void OnSelectHeroTimeout(int seq)
        {
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CHeroSelectNormalSystem.s_heroSelectFormPath);

            if (form != null)
            {
                RoomInfo roomInfo = Singleton <CRoomSystem> .GetInstance().roomInfo;

                if (roomInfo != null && roomInfo.GetMasterMemberInfo() != null)
                {
                    ListView <IHeroData> pvPHeroList = CHeroDataFactory.GetPvPHeroList(CMallSortHelper.HeroViewSortType.Name);
                    DebugHelper.Assert(pvPHeroList.get_Count() > CFakePvPHelper.ChosenHeroes.get_Count(), "May have not enough Candidate Heroes!!!");
                    int       num      = Random.Range(0, pvPHeroList.get_Count());
                    IHeroData heroData = pvPHeroList.get_Item(num);
                    while (CFakePvPHelper.ChosenHeroes.ContainsValue(heroData.cfgID))
                    {
                        num      = Random.Range(0, pvPHeroList.get_Count());
                        heroData = pvPHeroList.get_Item(num);
                    }
                    MemberInfo masterMemberInfo = roomInfo.GetMasterMemberInfo();
                    masterMemberInfo.ChoiceHero[0].stBaseInfo.stCommonInfo.dwHeroID = heroData.cfgID;
                    CFakePvPHelper.ReqStartSingleWarmBattle();
                }
            }
        }
Example #3
0
        private int CompareCoupons(ResHeroCfgInfo l, ResHeroCfgInfo r)
        {
            ResHeroPromotion resPromotion      = CHeroDataFactory.CreateHeroData(l.dwCfgID).promotion();
            ResHeroPromotion resPromotion2     = CHeroDataFactory.CreateHeroData(r.dwCfgID).promotion();
            stPayInfoSet     payInfoSetOfGood  = CMallSystem.GetPayInfoSetOfGood(l, resPromotion);
            stPayInfoSet     payInfoSetOfGood2 = CMallSystem.GetPayInfoSetOfGood(r, resPromotion2);
            uint             num  = 4294967295u;
            uint             num2 = 4294967295u;

            for (int i = 0; i < payInfoSetOfGood.m_payInfoCount; i++)
            {
                if ((payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.Diamond || payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.DianQuan || payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.DiamondAndDianQuan) && payInfoSetOfGood.m_payInfos[i].m_payValue < num)
                {
                    num = payInfoSetOfGood.m_payInfos[i].m_payValue;
                }
            }
            for (int j = 0; j < payInfoSetOfGood2.m_payInfoCount; j++)
            {
                if ((payInfoSetOfGood2.m_payInfos[j].m_payType == enPayType.Diamond || payInfoSetOfGood2.m_payInfos[j].m_payType == enPayType.DianQuan || payInfoSetOfGood2.m_payInfos[j].m_payType == enPayType.DiamondAndDianQuan) && payInfoSetOfGood2.m_payInfos[j].m_payValue < num2)
                {
                    num2 = payInfoSetOfGood2.m_payInfos[j].m_payValue;
                }
            }
            if (num == 4294967295u && this.IsDesc())
            {
                num = 0u;
            }
            if (num2 == 4294967295u && this.IsDesc())
            {
                num2 = 0u;
            }
            return(num.CompareTo(num2));
        }
        public void RefreshHeroInfo()
        {
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CQualifyingSystem.s_qualifyingFormPath);

            if (form == null)
            {
                return;
            }
            ListView <IHeroData> hostHeroList = CHeroDataFactory.GetHostHeroList(true, CMallSortHelper.HeroViewSortType.Name);
            GameObject           gameObject   = form.gameObject.transform.Find("Panel/Panel_HeroInfo").gameObject;
            Text          component           = gameObject.transform.Find("lblProficiency").GetComponent <Text>();
            CUIListScript component2          = gameObject.transform.Find("ListHeroIno").GetComponent <CUIListScript>();

            component2.SetElementAmount(hostHeroList.get_Count());
            for (int i = 0; i < hostHeroList.get_Count(); i++)
            {
                GameObject gameObject2 = component2.GetElemenet(i).gameObject;
                Image      component3  = gameObject2.transform.Find("heroInfo/imgRank").GetComponent <Image>();
                Text       component4  = gameObject2.transform.Find("heroInfo/lblRank").GetComponent <Text>();
                component3.SetSprite(CUIUtility.s_Sprite_System_Qualifying_Dir + "ranking_icon" + hostHeroList.get_Item(i).proficiencyLV, form, true, false, false, false);
                component4.text = hostHeroList.get_Item(i).proficiency.ToString();
            }
            uint num = 0u;

            for (int j = 0; j < hostHeroList.get_Count(); j++)
            {
                num += hostHeroList.get_Item(j).proficiency;
            }
            component.text = CUIUtility.StringReplace(Singleton <CTextManager> .GetInstance().GetText("Qualifying_Title0"), new string[]
            {
                num.ToString()
            });
        }
Example #5
0
        private int CompareCoupons(ResHeroCfgInfo l, ResHeroCfgInfo r)
        {
            ResHeroPromotion resPromotion     = CHeroDataFactory.CreateHeroData(l.dwCfgID).promotion();
            ResHeroPromotion promotion2       = CHeroDataFactory.CreateHeroData(r.dwCfgID).promotion();
            stPayInfoSet     payInfoSetOfGood = CMallSystem.GetPayInfoSetOfGood(l, resPromotion);
            stPayInfoSet     set2             = CMallSystem.GetPayInfoSetOfGood(r, promotion2);
            uint             maxValue         = uint.MaxValue;
            uint             payValue         = uint.MaxValue;

            for (int i = 0; i < payInfoSetOfGood.m_payInfoCount; i++)
            {
                if ((((payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.Diamond) || (payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.DianQuan)) || (payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.DiamondAndDianQuan)) && (payInfoSetOfGood.m_payInfos[i].m_payValue < maxValue))
                {
                    maxValue = payInfoSetOfGood.m_payInfos[i].m_payValue;
                }
            }
            for (int j = 0; j < set2.m_payInfoCount; j++)
            {
                if ((((set2.m_payInfos[j].m_payType == enPayType.Diamond) || (set2.m_payInfos[j].m_payType == enPayType.DianQuan)) || (set2.m_payInfos[j].m_payType == enPayType.DiamondAndDianQuan)) && (set2.m_payInfos[j].m_payValue < payValue))
                {
                    payValue = set2.m_payInfos[j].m_payValue;
                }
            }
            if ((maxValue == uint.MaxValue) && this.IsDesc())
            {
                maxValue = 0;
            }
            if ((payValue == uint.MaxValue) && this.IsDesc())
            {
                payValue = 0;
            }
            return(maxValue.CompareTo(payValue));
        }
Example #6
0
        private void SetHeroItem(CMallItemWidget mallWidget, ResHeroCfgInfo heroInfo, CUIFormScript form)
        {
            Image component = mallWidget.m_icon.GetComponent <Image>();

            component.color = CUIUtility.s_Color_White;
            string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_BustHero_Dir, heroInfo.szImagePath);

            component.SetSprite(prefabPath, form, false, true, true);
            mallWidget.m_skinLabel.CustomSetActive(false);
            mallWidget.m_topNameLeftText.GetComponent <Text>().text = heroInfo.szName;
            mallWidget.m_topNameRightText.CustomSetActive(false);
            IHeroData data = CHeroDataFactory.CreateHeroData(heroInfo.dwCfgID);

            if (data != null)
            {
                ResHeroPromotion resPromotion = data.promotion();
                this._payInfoTemp = CMallSystem.GetPayInfoSetOfGood(heroInfo, resPromotion);
                uint num = this.SetItemPriceInfo(mallWidget, ref this._payInfoTemp);
                this.SetItemTag(mallWidget, resPromotion, null, form);
                stUIEventParams eventParams = new stUIEventParams {
                    heroId             = heroInfo.dwCfgID,
                    commonUInt64Param1 = this._curFriendUid,
                    commonBool         = this._curFriendIsSns,
                    commonUInt32Param1 = this._curWorldId
                };
                mallWidget.m_buyBtn.GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.HeroView_OpenBuyHeroForFriend, eventParams);
                mallWidget.m_item.GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.None, eventParams);
            }
        }
Example #7
0
        private static void SetTeamHeroList(GameObject list, List <uint> heroIds, out int teamPower)
        {
            CUIListScript        component = list.GetComponent <CUIListScript>();
            CUIListElementScript elemenet  = null;

            teamPower = 0;
            component.SetElementAmount(heroIds.Count);
            for (int i = 0; i < heroIds.Count; i++)
            {
                elemenet = component.GetElemenet(i);
                GameObject gameObject = elemenet.gameObject.transform.Find("heroItemCell").gameObject;
                if (heroIds[i] > 0)
                {
                    IHeroData data = CHeroDataFactory.CreateHeroData(heroIds[i]);
                    teamPower += data.combatEft;
                    CUICommonSystem.SetHeroItemData(elemenet.m_belongedFormScript, gameObject, data, enHeroHeadType.enIcon, false, enHeroInfoShowType.enPVE);
                    elemenet.gameObject.CustomSetActive(true);
                    gameObject.gameObject.CustomSetActive(true);
                }
                else
                {
                    elemenet.gameObject.CustomSetActive(false);
                    gameObject.gameObject.CustomSetActive(false);
                }
            }
        }
Example #8
0
 public IHeroData GetHeroDataByIndex(int index)
 {
     if (index >= 0 && this.m_heroList != null && this.m_heroList.get_Item(index) != null && index < this.m_heroList.get_Count())
     {
         return(CHeroDataFactory.CreateHeroData(this.m_heroList.get_Item(index).dwCfgID));
     }
     return(null);
 }
 public IHeroData GetHeroDataByIndex(int index)
 {
     if (index >= 0 && this.m_heroList != null && this.m_heroList[index] != null && index < this.m_heroList.Count)
     {
         return(CHeroDataFactory.CreateHeroData(this.m_heroList[index].dwCfgID));
     }
     return(null);
 }
Example #10
0
        public static ListView <IHeroData> GetHostHeroList(bool isIncludeValidExperienceHero, CMallSortHelper.HeroViewSortType sortType = CMallSortHelper.HeroViewSortType.Name)
        {
            ListView <IHeroData> listView       = new ListView <IHeroData>();
            CRoleInfo            masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo == null)
            {
                return(listView);
            }
            DictionaryView <uint, CHeroInfo> .Enumerator enumerator = masterRoleInfo.GetHeroInfoDic().GetEnumerator();
            while (enumerator.MoveNext())
            {
                if (isIncludeValidExperienceHero)
                {
                    CRoleInfo arg_41_0 = masterRoleInfo;
                    KeyValuePair <uint, CHeroInfo> current = enumerator.get_Current();
                    if (arg_41_0.IsOwnHero(current.get_Key()))
                    {
                        goto IL_66;
                    }
                    CRoleInfo arg_5C_0 = masterRoleInfo;
                    KeyValuePair <uint, CHeroInfo> current2 = enumerator.get_Current();
                    if (arg_5C_0.IsValidExperienceHero(current2.get_Key()))
                    {
                        goto IL_66;
                    }
                    continue;
IL_66:
                    ListView <IHeroData> arg_7C_0           = listView;
                    KeyValuePair <uint, CHeroInfo> current3 = enumerator.get_Current();
                    arg_7C_0.Add(CHeroDataFactory.CreateHeroData(current3.get_Key()));
                }
                else
                {
                    CRoleInfo arg_97_0 = masterRoleInfo;
                    KeyValuePair <uint, CHeroInfo> current4 = enumerator.get_Current();
                    if (arg_97_0.IsOwnHero(current4.get_Key()))
                    {
                        ListView <IHeroData>           arg_B7_0 = listView;
                        KeyValuePair <uint, CHeroInfo> current5 = enumerator.get_Current();
                        arg_B7_0.Add(CHeroDataFactory.CreateHeroData(current5.get_Key()));
                    }
                }
            }
            if (CSysDynamicBlock.bLobbyEntryBlocked)
            {
                for (int i = listView.get_Count() - 1; i >= 0; i--)
                {
                    IHeroData heroData = listView.get_Item(i);
                    if (heroData.heroCfgInfo.bIOSHide > 0)
                    {
                        listView.Remove(heroData);
                    }
                }
            }
            CHeroOverviewSystem.SortHeroList(ref listView, sortType, false);
            return(listView);
        }
        public static ListView <IHeroData> GetTrainingHeroList(CMallSortHelper.HeroViewSortType sortType = CMallSortHelper.HeroViewSortType.Name)
        {
            ListView <IHeroData> listView       = new ListView <IHeroData>();
            List <uint>          list           = new List <uint>();
            CRoleInfo            masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo == null)
            {
                return(listView);
            }
            DictionaryView <uint, CHeroInfo> .Enumerator enumerator = masterRoleInfo.GetHeroInfoDic().GetEnumerator();
            while (enumerator.MoveNext())
            {
                KeyValuePair <uint, CHeroInfo> current = enumerator.Current;
                if ((current.get_Value().MaskBits & 2u) > 0u)
                {
                    ListView <IHeroData>           listView2 = listView;
                    KeyValuePair <uint, CHeroInfo> current2  = enumerator.Current;
                    listView2.Add(CHeroDataFactory.CreateHeroData(current2.get_Key()));
                    List <uint> list2 = list;
                    KeyValuePair <uint, CHeroInfo> current3 = enumerator.Current;
                    list2.Add(current3.get_Key());
                }
            }
            for (int i = 0; i < masterRoleInfo.freeHeroList.get_Count(); i++)
            {
                if (!masterRoleInfo.GetHeroInfoDic().ContainsKey(masterRoleInfo.freeHeroList.get_Item(i).dwFreeHeroID))
                {
                    listView.Add(CHeroDataFactory.CreateHeroData(masterRoleInfo.freeHeroList.get_Item(i).dwFreeHeroID));
                    list.Add(masterRoleInfo.freeHeroList.get_Item(i).dwFreeHeroID);
                }
            }
            ListView <ResHeroCfgInfo> allHeroList = CHeroDataFactory.GetAllHeroList();

            for (int j = 0; j < allHeroList.Count; j++)
            {
                if (allHeroList[j].bIsTrainUse == 1 && !list.Contains(allHeroList[j].dwCfgID))
                {
                    listView.Add(CHeroDataFactory.CreateHeroData(allHeroList[j].dwCfgID));
                }
            }
            if (CSysDynamicBlock.bLobbyEntryBlocked)
            {
                for (int k = listView.Count - 1; k >= 0; k--)
                {
                    IHeroData heroData = listView[k];
                    if (heroData.heroCfgInfo.bIOSHide > 0)
                    {
                        listView.Remove(heroData);
                    }
                }
            }
            CHeroOverviewSystem.SortHeroList(ref listView, sortType, false);
            return(listView);
        }
 private void OnExperienceHeroAdd(uint heroId, int experienceDays)
 {
     if (!Singleton <CHeroSelectBaseSystem> .instance.m_isInHeroSelectState)
     {
         CUICommonSystem.ShowNewHeroOrSkin(heroId, 0, enUIEventID.None, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_HERO, false, null, enFormPriority.Priority1, 0, experienceDays);
     }
     else if (!Singleton <CHeroSelectBaseSystem> .instance.IsMultilMode() && (Singleton <CHeroSelectBaseSystem> .instance.uiType == enUIType.enNormal))
     {
         IHeroData selectHeroData = CHeroDataFactory.CreateHeroData(heroId);
         Singleton <CHeroSelectNormalSystem> .instance.HeroSelect_SelectHero(selectHeroData);
     }
 }
Example #13
0
        private void ResetHeroList()
        {
            this.m_heroList.Clear();
            ListView <ResHeroCfgInfo> allHeroListAtShop = CHeroDataFactory.GetAllHeroListAtShop();

            for (int i = 0; i < allHeroListAtShop.Count; i++)
            {
                if (((this.m_heroJobType == enHeroJobType.All) || (allHeroListAtShop[i].bMainJob == ((byte)this.m_heroJobType))) || (allHeroListAtShop[i].bMinorJob == ((byte)this.m_heroJobType)))
                {
                    this.m_heroList.Add(allHeroListAtShop[i]);
                }
            }
        }
Example #14
0
        protected void FilterHeroData()
        {
            ListView <ResHeroCfgInfo> allHeroList = CHeroDataFactory.GetAllHeroList();

            for (int i = 0; i < allHeroList.Count; i++)
            {
                if ((this.m_selectHeroType == enHeroJobType.All) || (allHeroList[i].bJob == ((byte)this.m_selectHeroType)))
                {
                    IHeroData item = CHeroDataFactory.CreateHeroData(allHeroList[i].dwCfgID);
                    this.m_heroList.Add(item);
                }
            }
            SortHeroList(ref this.m_heroList);
        }
Example #15
0
        private static void SetTeamHeroList(GameObject list, COMDT_BATTLELIST_LIST battleList, uint battleListID, out int teamPower)
        {
            CUIListScript component = list.GetComponent <CUIListScript>();

            teamPower = 0;
            component.SetElementAmount(0);
            if (battleList == null || battleList.dwListNum == 0u)
            {
                return;
            }
            int num = 0;

            while ((long)num < (long)((ulong)battleList.dwListNum))
            {
                if (battleList.astBattleList[num].dwBattleListID == battleListID)
                {
                    if (battleList.astBattleList[num].stBattleList.wHeroCnt == 0)
                    {
                        return;
                    }
                    component.SetElementAmount((int)battleList.astBattleList[num].stBattleList.wHeroCnt);
                    int num2 = 0;
                    for (int i = 0; i < (int)battleList.astBattleList[num].stBattleList.wHeroCnt; i++)
                    {
                        CUIListElementScript elemenet   = component.GetElemenet(i);
                        GameObject           gameObject = elemenet.gameObject.transform.Find("heroItemCell").gameObject;
                        if (battleList.astBattleList[num].stBattleList.BattleHeroList[i] > 0u)
                        {
                            IHeroData heroData = CHeroDataFactory.CreateHeroData(battleList.astBattleList[num].stBattleList.BattleHeroList[i]);
                            teamPower += heroData.combatEft;
                            CUICommonSystem.SetHeroItemData(elemenet.m_belongedFormScript, gameObject, heroData, enHeroHeadType.enIcon, false, true);
                            elemenet.gameObject.CustomSetActive(true);
                            gameObject.gameObject.CustomSetActive(true);
                            num2++;
                        }
                        else
                        {
                            elemenet.gameObject.CustomSetActive(false);
                            gameObject.gameObject.CustomSetActive(false);
                        }
                    }
                    break;
                }
                else
                {
                    num++;
                }
            }
        }
Example #16
0
        private int CompareDefault(ResHeroCfgInfo l, ResHeroCfgInfo r)
        {
            bool flag  = this.m_roleInfo.IsHaveHero(l.dwCfgID, false);
            bool flag2 = this.m_roleInfo.IsHaveHero(r.dwCfgID, false);

            if (flag && !flag2)
            {
                return(1);
            }
            if (!flag && flag2)
            {
                return(-1);
            }
            ResHeroPromotion promotion  = CHeroDataFactory.CreateHeroData(l.dwCfgID).promotion();
            ResHeroPromotion promotion2 = CHeroDataFactory.CreateHeroData(r.dwCfgID).promotion();
            ResHeroShop      shop       = null;
            ResHeroShop      shop2      = null;

            GameDataMgr.heroShopInfoDict.TryGetValue(l.dwCfgID, out shop);
            GameDataMgr.heroShopInfoDict.TryGetValue(r.dwCfgID, out shop2);
            uint dwSortIndex = (shop == null) ? uint.MaxValue : shop.dwSortId;
            uint num2        = (shop2 == null) ? uint.MaxValue : shop2.dwSortId;

            if (promotion != null)
            {
                dwSortIndex = promotion.dwSortIndex;
            }
            if (promotion2 != null)
            {
                num2 = promotion2.dwSortIndex;
            }
            if (dwSortIndex < num2)
            {
                return(1);
            }
            if (dwSortIndex > num2)
            {
                return(-1);
            }
            if (l.dwCfgID < r.dwCfgID)
            {
                return(-1);
            }
            if (l.dwCfgID > r.dwCfgID)
            {
                return(1);
            }
            return(0);
        }
        private void ResetHeroList(enHeroJobType jobType, bool bOwn)
        {
            this.m_heroList.Clear();
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            DebugHelper.Assert(masterRoleInfo != null, "CSymbolRcommendController ResetHeroList role is null");
            if (masterRoleInfo != null)
            {
                ListView <ResHeroCfgInfo> allHeroList = CHeroDataFactory.GetAllHeroList();
                for (int i = 0; i < allHeroList.Count; i++)
                {
                    if ((((jobType == enHeroJobType.All) || (allHeroList[i].bMainJob == ((byte)jobType))) || (allHeroList[i].bMinorJob == ((byte)jobType))) && (!bOwn || masterRoleInfo.IsHaveHero(allHeroList[i].dwCfgID, false)))
                    {
                        this.m_heroList.Add(allHeroList[i]);
                    }
                }
            }
        }
 public static ListView <IHeroData> GetBanHeroList()
 {
     if (CHeroDataFactory.m_banHeroList == null)
     {
         CHeroDataFactory.m_banHeroList = new ListView <IHeroData>();
     }
     if (CHeroDataFactory.m_banHeroList.Count > 0)
     {
         CHeroDataFactory.m_banHeroList.Clear();
     }
     GameDataMgr.heroDatabin.Accept(delegate(ResHeroCfgInfo x)
     {
         if (GameDataMgr.IsHeroAvailable(x.dwCfgID) && (!CSysDynamicBlock.bLobbyEntryBlocked || x.bIOSHide == 0))
         {
             CHeroDataFactory.m_banHeroList.Add(CHeroDataFactory.CreateHeroData(x.dwCfgID));
         }
     });
     return(CHeroDataFactory.m_banHeroList);
 }
Example #19
0
        private static void SetTeamHeroList(GameObject list, COMDT_BATTLELIST_LIST battleList, uint battleListID, out int teamPower)
        {
            CUIListScript        component = list.GetComponent <CUIListScript>();
            CUIListElementScript elemenet  = null;

            teamPower = 0;
            component.SetElementAmount(0);
            if ((battleList != null) && (battleList.dwListNum != 0))
            {
                for (int i = 0; i < battleList.dwListNum; i++)
                {
                    if (battleList.astBattleList[i].dwBattleListID == battleListID)
                    {
                        if (battleList.astBattleList[i].stBattleList.wHeroCnt == 0)
                        {
                            return;
                        }
                        component.SetElementAmount(battleList.astBattleList[i].stBattleList.wHeroCnt);
                        int num2 = 0;
                        for (int j = 0; j < battleList.astBattleList[i].stBattleList.wHeroCnt; j++)
                        {
                            elemenet = component.GetElemenet(j);
                            GameObject gameObject = elemenet.gameObject.transform.Find("heroItemCell").gameObject;
                            if (battleList.astBattleList[i].stBattleList.BattleHeroList[j] > 0)
                            {
                                IHeroData data = CHeroDataFactory.CreateHeroData(battleList.astBattleList[i].stBattleList.BattleHeroList[j]);
                                teamPower += data.combatEft;
                                CUICommonSystem.SetHeroItemData(elemenet.m_belongedFormScript, gameObject, data, enHeroHeadType.enIcon, false, enHeroInfoShowType.enPVE);
                                elemenet.gameObject.CustomSetActive(true);
                                gameObject.gameObject.CustomSetActive(true);
                                num2++;
                            }
                            else
                            {
                                elemenet.gameObject.CustomSetActive(false);
                                gameObject.gameObject.CustomSetActive(false);
                            }
                        }
                        break;
                    }
                }
            }
        }
Example #20
0
        public static ListView <IHeroData> GetPvPHeroList(CMallSortHelper.HeroViewSortType sortType = CMallSortHelper.HeroViewSortType.Name)
        {
            ListView <IHeroData> listView       = new ListView <IHeroData>();
            CRoleInfo            masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo == null)
            {
                return(listView);
            }
            DictionaryView <uint, CHeroInfo> .Enumerator enumerator = masterRoleInfo.GetHeroInfoDic().GetEnumerator();
            while (enumerator.MoveNext())
            {
                KeyValuePair <uint, CHeroInfo> current = enumerator.get_Current();
                if ((current.get_Value().MaskBits & 2u) > 0u)
                {
                    ListView <IHeroData>           arg_5D_0 = listView;
                    KeyValuePair <uint, CHeroInfo> current2 = enumerator.get_Current();
                    arg_5D_0.Add(CHeroDataFactory.CreateHeroData(current2.get_Key()));
                }
            }
            for (int i = 0; i < masterRoleInfo.freeHeroList.get_Count(); i++)
            {
                if (!masterRoleInfo.GetHeroInfoDic().ContainsKey(masterRoleInfo.freeHeroList.get_Item(i).dwFreeHeroID))
                {
                    listView.Add(CHeroDataFactory.CreateHeroData(masterRoleInfo.freeHeroList.get_Item(i).dwFreeHeroID));
                }
            }
            if (CSysDynamicBlock.bLobbyEntryBlocked)
            {
                for (int j = listView.get_Count() - 1; j >= 0; j--)
                {
                    IHeroData heroData = listView.get_Item(j);
                    if (heroData.heroCfgInfo.bIOSHide > 0)
                    {
                        listView.Remove(heroData);
                    }
                }
            }
            CHeroOverviewSystem.SortHeroList(ref listView, sortType, false);
            return(listView);
        }
Example #21
0
        private static void OnSelectHeroTimeout(int seq)
        {
            if (Singleton <CUIManager> .GetInstance().GetForm(CHeroSelectNormalSystem.s_heroSelectFormPath) != null)
            {
                RoomInfo roomInfo = Singleton <CRoomSystem> .GetInstance().roomInfo;

                if ((roomInfo != null) && (roomInfo.GetMasterMemberInfo() != null))
                {
                    ListView <IHeroData> pvPHeroList = CHeroDataFactory.GetPvPHeroList();
                    DebugHelper.Assert(pvPHeroList.Count > ChosenHeroes.Count, "May have not enough Candidate Heroes!!!");
                    int       num  = UnityEngine.Random.Range(0, pvPHeroList.Count);
                    IHeroData data = pvPHeroList[num];
                    while (ChosenHeroes.ContainsValue(data.cfgID))
                    {
                        num  = UnityEngine.Random.Range(0, pvPHeroList.Count);
                        data = pvPHeroList[num];
                    }
                    roomInfo.GetMasterMemberInfo().ChoiceHero[0].stBaseInfo.stCommonInfo.dwHeroID = data.cfgID;
                    ReqStartSingleWarmBattle();
                }
            }
        }
Example #22
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();
                }
            }
        }
Example #23
0
        private int CompareCoin(ResHeroCfgInfo l, ResHeroCfgInfo r)
        {
            ResHeroPromotion resPromotion  = CHeroDataFactory.CreateHeroData(l.dwCfgID).promotion();
            ResHeroPromotion resPromotion2 = CHeroDataFactory.CreateHeroData(r.dwCfgID).promotion();
            ResHeroShop      resHeroShop   = null;
            ResHeroShop      resHeroShop2  = null;

            GameDataMgr.heroShopInfoDict.TryGetValue(l.dwCfgID, out resHeroShop);
            GameDataMgr.heroShopInfoDict.TryGetValue(r.dwCfgID, out resHeroShop2);
            stPayInfoSet payInfoSetOfGood  = CMallSystem.GetPayInfoSetOfGood(l, resPromotion);
            stPayInfoSet payInfoSetOfGood2 = CMallSystem.GetPayInfoSetOfGood(r, resPromotion2);
            uint         num  = 4294967295u;
            uint         num2 = 4294967295u;

            for (int i = 0; i < payInfoSetOfGood.m_payInfoCount; i++)
            {
                if (payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.GoldCoin && payInfoSetOfGood.m_payInfos[i].m_payValue <= num)
                {
                    num = payInfoSetOfGood.m_payInfos[i].m_payValue;
                }
            }
            for (int j = 0; j < payInfoSetOfGood2.m_payInfoCount; j++)
            {
                if (payInfoSetOfGood2.m_payInfos[j].m_payType == enPayType.GoldCoin && payInfoSetOfGood2.m_payInfos[j].m_payValue <= num2)
                {
                    num2 = payInfoSetOfGood2.m_payInfos[j].m_payValue;
                }
            }
            if (num == 4294967295u && this.IsDesc())
            {
                num = 0u;
            }
            if (num2 == 4294967295u && this.IsDesc())
            {
                num2 = 0u;
            }
            return(num.CompareTo(num2));
        }
Example #24
0
        private int CompareCoin(ResHeroCfgInfo l, ResHeroCfgInfo r)
        {
            ResHeroPromotion resPromotion = CHeroDataFactory.CreateHeroData(l.dwCfgID).promotion();
            ResHeroPromotion promotion2   = CHeroDataFactory.CreateHeroData(r.dwCfgID).promotion();
            ResHeroShop      shop         = null;
            ResHeroShop      shop2        = null;

            GameDataMgr.heroShopInfoDict.TryGetValue(l.dwCfgID, out shop);
            GameDataMgr.heroShopInfoDict.TryGetValue(r.dwCfgID, out shop2);
            stPayInfoSet payInfoSetOfGood = CMallSystem.GetPayInfoSetOfGood(l, resPromotion);
            stPayInfoSet set2             = CMallSystem.GetPayInfoSetOfGood(r, promotion2);
            uint         maxValue         = uint.MaxValue;
            uint         payValue         = uint.MaxValue;

            for (int i = 0; i < payInfoSetOfGood.m_payInfoCount; i++)
            {
                if ((payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.GoldCoin) && (payInfoSetOfGood.m_payInfos[i].m_payValue <= maxValue))
                {
                    maxValue = payInfoSetOfGood.m_payInfos[i].m_payValue;
                }
            }
            for (int j = 0; j < set2.m_payInfoCount; j++)
            {
                if ((set2.m_payInfos[j].m_payType == enPayType.GoldCoin) && (set2.m_payInfos[j].m_payValue <= payValue))
                {
                    payValue = set2.m_payInfos[j].m_payValue;
                }
            }
            if ((maxValue == uint.MaxValue) && this.IsDesc())
            {
                maxValue = 0;
            }
            if ((payValue == uint.MaxValue) && this.IsDesc())
            {
                payValue = 0;
            }
            return(maxValue.CompareTo(payValue));
        }
        private void ResetHeroList()
        {
            this.m_heroList.Clear();
            ListView <ResHeroCfgInfo> allHeroListAtShop = CHeroDataFactory.GetAllHeroListAtShop();

            for (int i = 0; i < allHeroListAtShop.Count; i++)
            {
                CMallItem cMallItem = new CMallItem(allHeroListAtShop[i].dwCfgID, CMallItem.IconType.Normal);
                if (this.m_heroJobType == enHeroJobType.All || allHeroListAtShop[i].bMainJob == (byte)this.m_heroJobType || allHeroListAtShop[i].bMinorJob == (byte)this.m_heroJobType)
                {
                    if (this.m_notOwnFlag)
                    {
                        if (!cMallItem.Owned(false))
                        {
                            this.m_heroList.Add(allHeroListAtShop[i]);
                        }
                    }
                    else
                    {
                        this.m_heroList.Add(allHeroListAtShop[i]);
                    }
                }
            }
        }
Example #26
0
        private int CompareDefault(ResHeroCfgInfo l, ResHeroCfgInfo r)
        {
            bool flag  = this.m_roleInfo.IsHaveHero(l.dwCfgID, false);
            bool flag2 = this.m_roleInfo.IsHaveHero(r.dwCfgID, false);

            if (flag && !flag2)
            {
                return(1);
            }
            if (!flag && flag2)
            {
                return(-1);
            }
            ResHeroPromotion resHeroPromotion  = CHeroDataFactory.CreateHeroData(l.dwCfgID).promotion();
            ResHeroPromotion resHeroPromotion2 = CHeroDataFactory.CreateHeroData(r.dwCfgID).promotion();
            ResHeroShop      resHeroShop       = null;
            ResHeroShop      resHeroShop2      = null;

            GameDataMgr.heroShopInfoDict.TryGetValue(l.dwCfgID, out resHeroShop);
            GameDataMgr.heroShopInfoDict.TryGetValue(r.dwCfgID, out resHeroShop2);
            uint num  = (resHeroShop != null) ? resHeroShop.dwSortId : 4294967295u;
            uint num2 = (resHeroShop2 != null) ? resHeroShop2.dwSortId : 4294967295u;

            if (resHeroPromotion != null)
            {
                num = resHeroPromotion.dwSortIndex;
            }
            if (resHeroPromotion2 != null)
            {
                num2 = resHeroPromotion2.dwSortIndex;
            }
            if (resHeroShop != null)
            {
                ResDT_RegisterSale_Info stRegisterSale = resHeroShop.stRegisterSale;
                bool flag3 = CMallSystem.IsinRegisterSales(stRegisterSale);
                if (flag3)
                {
                    num = stRegisterSale.dwSortID;
                }
            }
            if (resHeroShop2 != null)
            {
                ResDT_RegisterSale_Info stRegisterSale2 = resHeroShop2.stRegisterSale;
                bool flag4 = CMallSystem.IsinRegisterSales(stRegisterSale2);
                if (flag4)
                {
                    num2 = stRegisterSale2.dwSortID;
                }
            }
            if (num < num2)
            {
                return(1);
            }
            if (num > num2)
            {
                return(-1);
            }
            if (l.dwCfgID < r.dwCfgID)
            {
                return(-1);
            }
            if (l.dwCfgID > r.dwCfgID)
            {
                return(1);
            }
            return(0);
        }
Example #27
0
        private void SetHeroItem(CMallItemWidget mallWidget, ResHeroCfgInfo heroInfo, CUIFormScript form)
        {
            Image component = mallWidget.m_icon.GetComponent <Image>();

            component.set_color(CUIUtility.s_Color_White);
            string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_BustHero_Dir, heroInfo.szImagePath);

            component.SetSprite(prefabPath, form, false, true, true, true);
            mallWidget.m_skinLabel.CustomSetActive(false);
            mallWidget.m_topNameLeftText.GetComponent <Text>().set_text(heroInfo.szName);
            mallWidget.m_topNameRightText.CustomSetActive(false);
            IHeroData heroData = CHeroDataFactory.CreateHeroData(heroInfo.dwCfgID);

            if (heroData != null)
            {
                ResHeroPromotion resHeroPromotion = heroData.promotion();
                this._payInfoTemp = CMallSystem.GetPayInfoSetOfGood(heroInfo, resHeroPromotion);
                uint num = this.SetItemPriceInfo(mallWidget, ref this._payInfoTemp);
                this.SetItemTag(mallWidget, resHeroPromotion, null, form);
                stUIEventParams eventParams = default(stUIEventParams);
                eventParams.heroId             = heroInfo.dwCfgID;
                eventParams.commonUInt64Param1 = this._curFriendUid;
                eventParams.commonBool         = this._curFriendIsSns;
                eventParams.commonUInt32Param1 = this._curWorldId;
                mallWidget.m_buyBtn.GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.HeroView_OpenBuyHeroForFriend, eventParams);
                mallWidget.m_item.GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.None, eventParams);
                CMallItem      cMallItem       = new CMallItem(heroData.cfgID, CMallItem.IconType.Normal);
                Text           componetInChild = Utility.GetComponetInChild <Text>(mallWidget.m_askForBtn, "Text");
                Button         component2      = mallWidget.m_askForBtn.GetComponent <Button>();
                CUIEventScript component3      = mallWidget.m_askForBtn.GetComponent <CUIEventScript>();
                if (!cMallItem.CanBeAskFor())
                {
                    if (cMallItem.Owned(false) && componetInChild != null)
                    {
                        componetInChild.set_text(Singleton <CTextManager> .GetInstance().GetText("Mall_Hero_State_Own"));
                    }
                    if (component2 != null)
                    {
                        component2.enabled = false;
                    }
                    if (component3 != null)
                    {
                        component3.enabled = false;
                    }
                }
                else
                {
                    if (componetInChild != null)
                    {
                        componetInChild.set_text(Singleton <CTextManager> .GetInstance().GetText("Ask_For_Friend_Op"));
                    }
                    if (component2 != null)
                    {
                        component2.enabled = true;
                    }
                    if (component3 != null)
                    {
                        component3.enabled = true;
                    }
                    mallWidget.m_askForBtn.GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.HeroView_OpenAskForFriend, eventParams);
                }
            }
        }
        private void OnCommonHeroItemEnable(CUIEvent uiEvent)
        {
            CPlayerProfile profile = Singleton <CPlayerInfoSystem> .get_instance().GetProfile();

            int        srcWidgetIndexInBelongedList = uiEvent.m_srcWidgetIndexInBelongedList;
            GameObject srcWidget  = uiEvent.m_srcWidget;
            GameObject gameObject = Utility.FindChild(srcWidget, "heroItem");
            ListView <COMDT_MOST_USED_HERO_INFO> listView = profile.MostUsedHeroList();

            if (listView == null || srcWidgetIndexInBelongedList >= listView.get_Count())
            {
                return;
            }
            COMDT_MOST_USED_HERO_INFO cOMDT_MOST_USED_HERO_INFO = listView.get_Item(srcWidgetIndexInBelongedList);
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo == null)
            {
                return;
            }
            IHeroData  heroData        = CHeroDataFactory.CreateHeroData(cOMDT_MOST_USED_HERO_INFO.dwHeroID);
            GameObject proficiencyIcon = Utility.FindChild(gameObject, "heroProficiencyImg");
            GameObject proficiencyBg   = Utility.FindChild(gameObject, "heroProficiencyBgImg");

            CUICommonSystem.SetHeroProficiencyIconImage(uiEvent.m_srcFormScript, proficiencyIcon, (int)cOMDT_MOST_USED_HERO_INFO.dwProficiencyLv);
            CUICommonSystem.SetHeroProficiencyBgImage(uiEvent.m_srcFormScript, proficiencyBg, (int)cOMDT_MOST_USED_HERO_INFO.dwProficiencyLv, false);
            if (!CPlayerInfoSystem.isSelf(profile.m_uuid))
            {
                CUICommonSystem.SetHeroItemImage(uiEvent.m_srcFormScript, gameObject, CSkinInfo.GetHeroSkinPic(cOMDT_MOST_USED_HERO_INFO.dwHeroID, cOMDT_MOST_USED_HERO_INFO.dwSkinID), enHeroHeadType.enBust, false, true);
            }
            else
            {
                CUICommonSystem.SetHeroItemImage(uiEvent.m_srcFormScript, gameObject, masterRoleInfo.GetHeroSkinPic(cOMDT_MOST_USED_HERO_INFO.dwHeroID), enHeroHeadType.enBust, false, true);
            }
            GameObject root = Utility.FindChild(gameObject, "profession");

            CUICommonSystem.SetHeroJob(uiEvent.m_srcFormScript, root, (enHeroJobType)heroData.heroType);
            Text componetInChild = Utility.GetComponetInChild <Text>(gameObject, "heroNameText");

            componetInChild.text = heroData.heroName;
            Text componetInChild2 = Utility.GetComponetInChild <Text>(gameObject, "TotalCount");

            componetInChild2.text = Singleton <CTextManager> .get_instance().GetText("Player_Info_PVP_Total_Count", new string[]
            {
                (cOMDT_MOST_USED_HERO_INFO.dwGameWinNum + cOMDT_MOST_USED_HERO_INFO.dwGameLoseNum).ToString()
            });

            Text componetInChild3 = Utility.GetComponetInChild <Text>(gameObject, "WinRate");

            componetInChild3.text = Singleton <CTextManager> .get_instance().GetText("Player_Info_PVP_Win_Rate", new string[]
            {
                CPlayerProfile.Round(CPlayerProfile.Divide(cOMDT_MOST_USED_HERO_INFO.dwGameWinNum, cOMDT_MOST_USED_HERO_INFO.dwGameWinNum + cOMDT_MOST_USED_HERO_INFO.dwGameLoseNum) * 100f)
            });

            ulong num  = 0uL;
            ulong num2 = 0uL;
            ulong num3 = 0uL;
            uint  num4 = 0u;
            COMDT_HERO_STATISTIC_DETAIL stStatisticDetail = cOMDT_MOST_USED_HERO_INFO.stStatisticDetail;
            uint dwNum = stStatisticDetail.dwNum;
            int  num5  = 0;

            while ((long)num5 < (long)((ulong)dwNum))
            {
                COMDT_HERO_STATISTIC_INFO cOMDT_HERO_STATISTIC_INFO = stStatisticDetail.astTypeDetail[num5];
                num  += cOMDT_HERO_STATISTIC_INFO.ullKDAPct;
                num2 += cOMDT_HERO_STATISTIC_INFO.ullTotalHurtHero;
                num3 += cOMDT_HERO_STATISTIC_INFO.ullTotalBeHurt;
                num4  = num4 + cOMDT_HERO_STATISTIC_INFO.dwWinNum + cOMDT_HERO_STATISTIC_INFO.dwLoseNum;
                num5++;
            }
            num4 = ((num4 != 0u) ? num4 : 1u);
            Utility.GetComponetInChild <Text>(gameObject, "AverKDA").text = Singleton <CTextManager> .get_instance().GetText("Player_Info_PVP_AverKDA", new string[]
            {
                (num / (ulong)num4 / 100uL).ToString("0.0")
            });

            Utility.GetComponetInChild <Text>(gameObject, "AverHurt").text = Singleton <CTextManager> .get_instance().GetText("Player_Info_PVP_AverHurt", new string[]
            {
                (num2 / (ulong)num4).ToString("d")
            });

            Utility.GetComponetInChild <Text>(gameObject, "AverTakenHurt").text = Singleton <CTextManager> .get_instance().GetText("Player_Info_PVP_AverTakenHurt", new string[]
            {
                (num3 / (ulong)num4).ToString("d")
            });
        }
Example #29
0
        public void OnSkillTipsShow()
        {
            if (this.m_FormScript != null)
            {
                GameObject gameObject = this.m_FormScript.transform.Find("SkillTipsBg").gameObject;
                if (!gameObject.activeSelf)
                {
                    gameObject.CustomSetActive(true);
                }
                SkillSlotType[] typeArray1 = new SkillSlotType[4];
                typeArray1[1] = SkillSlotType.SLOT_SKILL_1;
                typeArray1[2] = SkillSlotType.SLOT_SKILL_2;
                typeArray1[3] = SkillSlotType.SLOT_SKILL_3;
                SkillSlotType[] typeArray = typeArray1;
                GameObject[]    objArray  = new GameObject[typeArray.Length];
                objArray[0] = gameObject.transform.Find("Panel0").gameObject;
                objArray[1] = gameObject.transform.Find("Panel1").gameObject;
                objArray[2] = gameObject.transform.Find("Panel2").gameObject;
                objArray[3] = gameObject.transform.Find("Panel3").gameObject;
                Skill skillObj = null;
                if (Singleton <GamePlayerCenter> .instance.GetHostPlayer() != null)
                {
                    PoolObjHandle <ActorRoot> captain = Singleton <GamePlayerCenter> .instance.GetHostPlayer().Captain;

                    if (captain != 0)
                    {
                        IHeroData   data           = CHeroDataFactory.CreateHeroData((uint)captain.handle.TheActorMeta.ConfigId);
                        SkillSlot[] skillSlotArray = captain.handle.SkillControl.SkillSlotArray;
                        for (int i = 0; i < typeArray.Length; i++)
                        {
                            SkillSlot slot = skillSlotArray[(int)typeArray[i]];
                            objArray[i].CustomSetActive(true);
                            if (slot != null)
                            {
                                skillObj = slot.SkillObj;
                            }
                            else if ((i < (typeArray.Length - 1)) && (i > 0))
                            {
                                skillObj = new Skill((captain.handle.TheActorMeta.ConfigId * 100) + (i * 10));
                            }
                            else
                            {
                                skillObj = null;
                            }
                            if (skillObj != null)
                            {
                                Image component = objArray[i].transform.Find("SkillMask/SkillImg").GetComponent <Image>();
                                if ((component != null) && !string.IsNullOrEmpty(skillObj.IconName))
                                {
                                    component.SetSprite(CUIUtility.s_Sprite_Dynamic_Skill_Dir + skillObj.IconName, Singleton <CUIManager> .GetInstance().GetForm(s_battleHeroInfoForm), true, false, false);
                                }
                                Text text = objArray[i].transform.Find("Text_Tittle").GetComponent <Text>();
                                if ((text != null) && (skillObj.cfgData.szSkillName.Length > 0))
                                {
                                    text.text = StringHelper.UTF8BytesToString(ref skillObj.cfgData.szSkillName);
                                }
                                Text text2      = objArray[i].transform.Find("Text_CD").GetComponent <Text>();
                                int  skillCDMax = 0;
                                if (slot != null)
                                {
                                    skillCDMax = slot.GetSkillCDMax();
                                }
                                text2.text = (i != 0) ? Singleton <CTextManager> .instance.GetText("Skill_Cool_Down_Tips", new string[1]) : Singleton <CTextManager> .instance.GetText("Skill_Common_Effect_Type_5");

                                if ((i < typeArray.Length) && (i > 0))
                                {
                                    Text text3 = objArray[i].transform.Find("Text_EnergyCost").GetComponent <Text>();
                                    if (slot == null)
                                    {
                                        string[] args = new string[] { skillObj.cfgData.iEnergyCost.ToString() };
                                        text3.text = Singleton <CTextManager> .instance.GetText(CUICommonSystem.GetEnergyMaxOrCostText(skillObj.cfgData.dwEnergyCostType, EnergyShowType.CostValue), args);
                                    }
                                    else
                                    {
                                        string[] textArray3 = new string[] { slot.NextSkillEnergyCostTotal().ToString() };
                                        text3.text = Singleton <CTextManager> .instance.GetText(CUICommonSystem.GetEnergyMaxOrCostText(skillObj.cfgData.dwEnergyCostType, EnergyShowType.CostValue), textArray3);
                                    }
                                }
                                uint[]     skillEffectType = skillObj.cfgData.SkillEffectType;
                                GameObject obj3            = null;
                                for (int j = 1; j <= 2; j++)
                                {
                                    obj3 = objArray[i].transform.Find(string.Format("EffectNode{0}", j)).gameObject;
                                    if ((j <= skillEffectType.Length) && (skillEffectType[j - 1] != 0))
                                    {
                                        obj3.CustomSetActive(true);
                                        obj3.GetComponent <Image>().SetSprite(CSkillData.GetEffectSlotBg((SkillEffectType)skillEffectType[j - 1]), this.m_FormScript, true, false, false);
                                        obj3.transform.Find("Text").GetComponent <Text>().text = CSkillData.GetEffectDesc((SkillEffectType)skillEffectType[j - 1]);
                                    }
                                    else
                                    {
                                        obj3.CustomSetActive(false);
                                    }
                                }
                                Text            text4      = objArray[i].transform.Find("Text_Detail").GetComponent <Text>();
                                ValueDataInfo[] actorValue = captain.handle.ValueComponent.mActorValue.GetActorValue();
                                if ((text4 != null) && (skillObj.cfgData.szSkillDesc.Length > 0))
                                {
                                    text4.text = CUICommonSystem.GetSkillDesc(skillObj.cfgData.szSkillDesc, actorValue, slot.GetSkillLevel(), captain.handle.ValueComponent.actorSoulLevel);
                                }
                            }
                            else if (i == (typeArray.Length - 1))
                            {
                                Text text5 = objArray[i].transform.Find("Text_Detail").GetComponent <Text>();
                                if (Singleton <BattleLogic> .GetInstance().GetCurLvelContext().IsMobaMode())
                                {
                                    text5.text = Singleton <CTextManager> .GetInstance().GetText("Skill_Text_Lock_PVP");
                                }
                                else
                                {
                                    text5.text = Singleton <CTextManager> .GetInstance().GetText("Skill_Text_Lock_PVE");
                                }
                            }
                        }
                    }
                }
            }
        }
Example #30
0
        public static void UpdateArenaSelfInfo()
        {
            if (Singleton <CArenaSystem> .instance.m_fightHeroInfoList != null)
            {
                CUIFormScript form = Singleton <CUIManager> .instance.GetForm(RankingSystem.s_rankingForm);

                if (form != null)
                {
                    uint pvpLevel = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo().PvpLevel;

                    List <uint> arenaDefHeroList = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_arenaDefHeroList;

                    GameObject        widget    = form.GetWidget(0x12);
                    RankingItemHelper component = widget.GetComponent <RankingItemHelper>();
                    SetGameObjChildText(widget, "NameGroup/PlayerName", Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo().Name);
                    SetGameObjChildText(widget, "PlayerLv", string.Format("Lv.{0}", pvpLevel.ToString(CultureInfo.InvariantCulture)));
                    SetHostUrlHeadIcon(Utility.FindChild(widget, "HeadIcon"));
                    MonoSingleton <NobeSys> .GetInstance().SetMyQQVipHead(Utility.GetComponetInChild <Image>(widget, "NameGroup/QQVipIcon"));

                    MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(Utility.GetComponetInChild <Image>(widget, "NobeIcon"), (int)Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo().GetNobeInfo().stGameVipClient.dwCurLevel, false);

                    MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(Utility.GetComponetInChild <Image>(widget, "HeadFrame"), (int)Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo().GetNobeInfo().stGameVipClient.dwHeadIconId);

                    MonoSingleton <NobeSys> .GetInstance().SetGameCenterVisible(Utility.FindChild(widget, "NameGroup/WXIcon"), Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo().m_privilegeType, ApolloPlatform.Wechat, true, false);

                    MonoSingleton <NobeSys> .GetInstance().SetGameCenterVisible(Utility.FindChild(widget, "NameGroup/QQGameCenterIcon"), Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo().m_privilegeType, ApolloPlatform.QQ, true, false);

                    MonoSingleton <NobeSys> .GetInstance().SetGameCenterVisible(Utility.FindChild(widget, "NameGroup/GuestGameCenterIcon"), Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo().m_privilegeType, ApolloPlatform.Guest, true, false);

                    RankingNumSet(Singleton <CArenaSystem> .instance.m_fightHeroInfoList.stArenaInfo.dwSelfRank, component);
                    for (int i = 0; i < 3; i++)
                    {
                        int        num5 = i + 1;
                        GameObject obj3 = Utility.FindChild(widget, string.Format("listHero/heroItemCell{0}", num5.ToString()));
                        if (arenaDefHeroList.Count > i)
                        {
                            obj3.CustomSetActive(true);
                            IHeroData data = CHeroDataFactory.CreateHeroData(arenaDefHeroList[i]);
                            CUICommonSystem.SetHeroItemData(form, obj3, data, enHeroHeadType.enIcon, false);
                        }
                        else
                        {
                            obj3.CustomSetActive(false);
                        }
                    }
                    ListView <COMDT_ARENA_FIGHT_RECORD> recordList = Singleton <CArenaSystem> .instance.m_recordList;
                    ulong playerUllUID = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().playerUllUID;

                    int num4 = 0;
                    if ((recordList != null) && (recordList.Count > 0))
                    {
                        if (recordList[0].ullAtkerUid == playerUllUID)
                        {
                            if (recordList[0].bResult == 1)
                            {
                                num4 = (int)(recordList[0].dwAtkerRank - recordList[0].dwTargetRank);
                            }
                        }
                        else if (recordList[0].bResult == 1)
                        {
                            num4 = (int)(recordList[0].dwAtkerRank - recordList[0].dwTargetRank);
                        }
                    }
                    GameObject obj4 = Utility.FindChild(widget, "ChangeIcon");
                    if (num4 == 0)
                    {
                        obj4.CustomSetActive(false);
                        SetGameObjChildText(widget, "ChangeNum", "--");
                    }
                    else if (num4 > 0)
                    {
                        obj4.CustomSetActive(true);
                        obj4.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
                        SetGameObjChildText(widget, "ChangeNum", num4.ToString(CultureInfo.InvariantCulture));
                    }
                    else if (num4 < 0)
                    {
                        obj4.CustomSetActive(true);
                        obj4.transform.localEulerAngles = new Vector3(0f, 0f, 180f);
                        SetGameObjChildText(widget, "ChangeNum", num4.ToString(CultureInfo.InvariantCulture));
                    }
                }
            }
        }