Esempio n. 1
0
        private int CommonHeroSortUsedHurt(COMDT_MOST_USED_HERO_INFO left, COMDT_MOST_USED_HERO_INFO right)
        {
            float num  = (left.stStatisticDetail.dwNum > 0u) ? (CPlayerProfile.Divide(left.stStatisticDetail.astTypeDetail[0].dwHurtPM, left.stStatisticDetail.astTypeDetail[0].dwWinNum + left.stStatisticDetail.astTypeDetail[0].dwLoseNum) * 100f) : 0f;
            float num2 = (right.stStatisticDetail.dwNum > 0u) ? (CPlayerProfile.Divide(right.stStatisticDetail.astTypeDetail[0].dwHurtPM, right.stStatisticDetail.astTypeDetail[0].dwWinNum + right.stStatisticDetail.astTypeDetail[0].dwLoseNum) * 100f) : 0f;

            return(((this.m_lastIsUp == 1) ? -1 : 1) * ((int)num2 - (int)num));
        }
        private int CommonHeroSortUsedBeHurt(COMDT_MOST_USED_HERO_INFO left, COMDT_MOST_USED_HERO_INFO right)
        {
            float num  = (left.stStatisticDetail.dwNum <= 0u) ? 0f : (CPlayerProfile.Divide(left.stStatisticDetail.astTypeDetail[0].ullTotalBeHurt, left.stStatisticDetail.astTypeDetail[0].dwWinNum + left.stStatisticDetail.astTypeDetail[0].dwLoseNum) * 100f);
            float num2 = (right.stStatisticDetail.dwNum <= 0u) ? 0f : (CPlayerProfile.Divide(right.stStatisticDetail.astTypeDetail[0].ullTotalBeHurt, right.stStatisticDetail.astTypeDetail[0].dwWinNum + right.stStatisticDetail.astTypeDetail[0].dwLoseNum) * 100f);

            return(((this.m_lastIsUp != 1) ? 1 : -1) * ((int)num2 - (int)num));
        }
        public void OnCommonHeroListEnable(CUIEvent uiEvent)
        {
            CUIFormScript form = Singleton <CUIManager> .get_instance().GetForm(CPlayerCommonHeroInfoController.sPlayerInfoCommonHeroFormPath);

            if (form == null)
            {
                return;
            }
            int        srcWidgetIndexInBelongedList = uiEvent.m_srcWidgetIndexInBelongedList;
            GameObject srcWidget = uiEvent.m_srcWidget;

            if (srcWidgetIndexInBelongedList >= 0 && srcWidgetIndexInBelongedList < this.m_commonHeroList.get_Count())
            {
                Text componetInChild  = Utility.GetComponetInChild <Text>(srcWidget, "NameTxt");
                Text componetInChild2 = Utility.GetComponetInChild <Text>(srcWidget, "UsedCntTxt");
                Text componetInChild3 = Utility.GetComponetInChild <Text>(srcWidget, "WinsTxt");
                Text componetInChild4 = Utility.GetComponetInChild <Text>(srcWidget, "KdaTxt");
                Text componetInChild5 = Utility.GetComponetInChild <Text>(srcWidget, "GoldTxt");
                Text componetInChild6 = Utility.GetComponetInChild <Text>(srcWidget, "HurtTxt");
                Text componetInChild7 = Utility.GetComponetInChild <Text>(srcWidget, "BeHurtTxt");
                COMDT_MOST_USED_HERO_INFO cOMDT_MOST_USED_HERO_INFO = this.m_commonHeroList.get_Item(srcWidgetIndexInBelongedList);
                ResHeroCfgInfo            dataByKey = GameDataMgr.heroDatabin.GetDataByKey(cOMDT_MOST_USED_HERO_INFO.dwHeroID);
                string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Icon_Dir, CSkinInfo.GetHeroSkinPic(this.m_commonHeroList.get_Item(srcWidgetIndexInBelongedList).dwHeroID, 0u));
                Utility.GetComponetInChild <Image>(srcWidget, "HeadImg").SetSprite(prefabPath, form, true, false, false, false);
                Utility.GetComponetInChild <Text>(srcWidget, "NameTxt").text    = ((dataByKey != null) ? dataByKey.szName : string.Empty);
                Utility.GetComponetInChild <Text>(srcWidget, "UsedCntTxt").text = (cOMDT_MOST_USED_HERO_INFO.dwGameWinNum + cOMDT_MOST_USED_HERO_INFO.dwGameLoseNum).ToString();
                Utility.GetComponetInChild <Text>(srcWidget, "WinsTxt").text    = CPlayerProfile.Divide(cOMDT_MOST_USED_HERO_INFO.dwGameWinNum, cOMDT_MOST_USED_HERO_INFO.dwGameWinNum + cOMDT_MOST_USED_HERO_INFO.dwGameLoseNum).ToString("P0");
                if (cOMDT_MOST_USED_HERO_INFO.stStatisticDetail.dwNum > 0u)
                {
                    GameObject    widget           = form.GetWidget(0);
                    CUIListScript componetInChild8 = Utility.GetComponetInChild <CUIListScript>(widget, "SubMenuList/List");
                    int           selectedIndex    = componetInChild8.GetSelectedIndex();
                    byte          gameType         = CPlayerCommonHeroInfoController.GetGameType(selectedIndex);
                    uint          num  = 0u;
                    uint          num2 = 0u;
                    uint          num3 = 0u;
                    uint          num4 = 0u;
                    uint          num5 = 0u;
                    uint          num6 = 0u;
                    uint          num7 = 0u;
                    ulong         num8 = 0uL;
                    int           num9 = 0;
                    while ((long)num9 < (long)((ulong)cOMDT_MOST_USED_HERO_INFO.stStatisticDetail.dwNum))
                    {
                        if (gameType == 0 || cOMDT_MOST_USED_HERO_INFO.stStatisticDetail.astTypeDetail[num9].bGameType == gameType)
                        {
                            num  += cOMDT_MOST_USED_HERO_INFO.stStatisticDetail.astTypeDetail[num9].dwWinNum;
                            num2 += cOMDT_MOST_USED_HERO_INFO.stStatisticDetail.astTypeDetail[num9].dwLoseNum;
                            num3 += cOMDT_MOST_USED_HERO_INFO.stStatisticDetail.astTypeDetail[num9].dwKill;
                            num4 += cOMDT_MOST_USED_HERO_INFO.stStatisticDetail.astTypeDetail[num9].dwDead;
                            num5 += cOMDT_MOST_USED_HERO_INFO.stStatisticDetail.astTypeDetail[num9].dwAssist;
                            num6 += cOMDT_MOST_USED_HERO_INFO.stStatisticDetail.astTypeDetail[num9].dwGPM;
                            num7 += cOMDT_MOST_USED_HERO_INFO.stStatisticDetail.astTypeDetail[num9].dwHurtPM;
                            num8 += cOMDT_MOST_USED_HERO_INFO.stStatisticDetail.astTypeDetail[num9].ullTotalBeHurt;
                        }
                        num9++;
                    }
                    uint b = num + num2;
                    componetInChild4.text = string.Format("{0}/{1}/{2}", CPlayerProfile.Divide(num3, b).ToString("F1"), CPlayerProfile.Divide(num4, b).ToString("F1"), CPlayerProfile.Divide(num5, b).ToString("F1"));
                    componetInChild5.text = CPlayerProfile.Divide(num6, b).ToString("F0");
                    componetInChild6.text = CPlayerProfile.Divide(num7, b).ToString("F0");
                    componetInChild7.text = CPlayerProfile.Divide(num8, b).ToString("F0");
                }
                else
                {
                    componetInChild4.text = "0.0/0.0/0.0";
                    componetInChild5.text = "0";
                    componetInChild6.text = "0";
                    componetInChild7.text = "0";
                }
            }
        }
        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")
            });
        }
Esempio n. 5
0
 public float RankWins()
 {
     return(CPlayerProfile.Divide((uint)this.RankWinGameCnt(), (uint)this.RankTotalGameCnt()));
 }
Esempio n. 6
0
 public float EntertainmentWins()
 {
     return(CPlayerProfile.Divide((uint)this.EntertainmentWinGameCnt(), (uint)this.EntertainmentTotalGameCnt()));
 }
Esempio n. 7
0
 public float PvpGuildWins()
 {
     return(CPlayerProfile.Divide((uint)this._guildWinCount, (uint)this._guildTotalCount));
 }
Esempio n. 8
0
 public float PvmWins()
 {
     return(CPlayerProfile.Divide((uint)this.PvmWinGameCnt(), (uint)this.PvmTotalGameCnt()));
 }
Esempio n. 9
0
        public static void UpdateOneGodElement(GameObject objElement, int viewIndex, CSDT_RANKING_LIST_SUCC curRankingList)
        {
            if (curRankingList == null)
            {
                return;
            }
            if (objElement == null)
            {
                return;
            }
            RankingItemHelper component = objElement.GetComponent <RankingItemHelper>();

            if (component == null)
            {
                return;
            }
            CSDT_RANKING_LIST_ITEM_INFO cSDT_RANKING_LIST_ITEM_INFO = curRankingList.astItemDetail[viewIndex];

            if (cSDT_RANKING_LIST_ITEM_INFO == null)
            {
                return;
            }
            string             text          = string.Empty;
            uint               num           = 1u;
            string             serverUrl     = null;
            uint               logicWorldId  = 0u;
            uint               level         = 0u;
            uint               headIdx       = 0u;
            uint               num2          = 0u;
            COM_PRIVILEGE_TYPE privilegeType = 0;
            COMDT_RANKING_LIST_ITEM_EXTRA_PLAYER stAcntInfo = cSDT_RANKING_LIST_ITEM_INFO.stExtraInfo.stDetailInfo.get_stMasterHero().stAcntInfo;

            if (stAcntInfo != null)
            {
                text      = StringHelper.UTF8BytesToString(ref stAcntInfo.szPlayerName);
                num       = stAcntInfo.dwPvpLevel;
                serverUrl = Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(ref stAcntInfo.szHeadUrl);

                ulong ullUid = stAcntInfo.ullUid;
                logicWorldId  = (uint)stAcntInfo.iLogicWorldId;
                level         = stAcntInfo.stGameVip.dwCurLevel;
                headIdx       = stAcntInfo.stGameVip.dwHeadIconId;
                privilegeType = stAcntInfo.bPrivilege;
                num2          = stAcntInfo.dwVipLevel;
            }
            MonoSingleton <NobeSys> .GetInstance().SetGameCenterVisible(component.WxIcon, privilegeType, 1, true, false);

            MonoSingleton <NobeSys> .GetInstance().SetGameCenterVisible(component.QqIcon, privilegeType, 2, true, false);

            MonoSingleton <NobeSys> .GetInstance().SetGameCenterVisible(component.GuestIcon, privilegeType, 5, true, false);

            RankingView.SetGameObjChildText(objElement, "NameGroup/PlayerName", text);
            RankingView.SetGameObjChildText(objElement, "PlayerLv", string.Format("Lv.{0}", Math.Max(1u, num)));
            RankingView.SetUrlHeadIcon(component.HeadIcon, serverUrl);
            RankingView.SetPlatChannel(objElement, logicWorldId);
            component.LadderGo.CustomSetActive(false);
            objElement.transform.FindChild("Value").gameObject.CustomSetActive(true);
            objElement.transform.FindChild("ValueType").gameObject.CustomSetActive(true);
            component.FindBtn.CustomSetActive(true);
            component.FindBtn.GetComponent <CUIEventScript>().m_onClickEventParams.tag = viewIndex;
            Utility.FindChild(component.FindBtn, "Select").CustomSetActive(false);
            float num3 = CPlayerProfile.Divide(cSDT_RANKING_LIST_ITEM_INFO.stExtraInfo.stDetailInfo.get_stMasterHero().dwWinCnt * 100u, cSDT_RANKING_LIST_ITEM_INFO.stExtraInfo.stDetailInfo.get_stMasterHero().dwGameCnt);

            if (RankingView.RANK_GOD_WIN_CNT == 0u)
            {
                RankingView.RANK_GOD_WIN_CNT = GameDataMgr.globalInfoDatabin.GetDataByKey(226u).dwConfValue;
            }
            if (cSDT_RANKING_LIST_ITEM_INFO.stExtraInfo.stDetailInfo.get_stMasterHero().dwWinCnt >= RankingView.RANK_GOD_WIN_CNT)
            {
                RankingView.SetGameObjChildText(objElement, "ValueType", Singleton <CTextManager> .GetInstance().GetText("ranking_ItemHeroMasterName", new string[]
                {
                    num3.ToString("F2"),
                    cSDT_RANKING_LIST_ITEM_INFO.stExtraInfo.stDetailInfo.get_stMasterHero().dwWinCnt.ToString()
                }));
            }
            else
            {
                RankingView.SetGameObjChildText(objElement, "ValueType", Singleton <CTextManager> .GetInstance().GetText("ranking_ItemHeroMasterNameLess100", new string[]
                {
                    cSDT_RANKING_LIST_ITEM_INFO.stExtraInfo.stDetailInfo.get_stMasterHero().dwWinCnt.ToString()
                }));
            }
            RankingView.SetGameObjChildText(objElement, "Value", string.Empty);
            uint rankNumber = (uint)(viewIndex + 1);

            RankingView.RankingNumSet(rankNumber, component);
            component.AddFriend.CustomSetActive(false);
            component.SendCoin.CustomSetActive(false);
            component.Online.CustomSetActive(false);
            if (num2 == 913913u)
            {
                MonoSingleton <NobeSys> .GetInstance().SetMyQQVipHead(component.QqVip.GetComponent <Image>());
            }
            else
            {
                MonoSingleton <NobeSys> .GetInstance().SetOtherQQVipHead(component.QqVip.GetComponent <Image>(), (int)num2);
            }
            MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(component.VipIcon.GetComponent <Image>(), (int)level, false);

            MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(component.HeadIconFrame.GetComponent <Image>(), (int)headIdx);
        }
        private static void ConvertComplexData(CPlayerProfile profile, MainTab mainTab, SubTab subTab, out int gameCnt, out float gameWins)
        {
            int num = 0;

            gameCnt  = 0;
            gameWins = 0f;
            if (mainTab == MainTab.MatchAll)
            {
                if (subTab == SubTab.MatchAll)
                {
                    gameCnt  = profile.Pvp1V1TotalGameCnt() + profile.Pvp3V3TotalGameCnt() + profile.Pvp5V5TotalGameCnt() + profile.EntertainmentTotalGameCnt() + profile.PvpGuildTotalGameCnt() + profile.RankTotalGameCnt();
                    num      = profile.Pvp1V1WinGameCnt() + profile.Pvp3V3WinGameCnt() + profile.Pvp5V5WinGameCnt() + profile.EntertainmentWinGameCnt() + profile.PvpGuildWinGameCnt() + profile.RankWinGameCnt();
                    gameWins = CPlayerProfile.Divide((uint)num, (uint)gameCnt);
                }
                else if (subTab == SubTab.Match1V1)
                {
                    gameCnt  = profile.Pvp1V1TotalGameCnt();
                    gameWins = profile.Pvp1V1Wins();
                }
                else if (subTab == SubTab.Match3V3)
                {
                    gameCnt  = profile.Pvp3V3TotalGameCnt();
                    gameWins = profile.Pvp3V3Wins();
                }
                else if (subTab == SubTab.Match5V5)
                {
                    gameCnt  = profile.Pvp5V5TotalGameCnt();
                    gameWins = profile.Pvp5V5Wins();
                }
                else if (subTab == SubTab.MatchEntertainment)
                {
                    gameCnt  = profile.EntertainmentTotalGameCnt();
                    gameWins = profile.EntertainmentWins();
                }
                else if (subTab == SubTab.MatchGuild)
                {
                    gameCnt  = profile.PvpGuildTotalGameCnt();
                    gameWins = profile.PvpGuildWins();
                }
                else if (subTab == SubTab.MatchRank)
                {
                    gameCnt  = profile.RankTotalGameCnt();
                    gameWins = profile.RankWins();
                }
            }
            else if (mainTab == MainTab.Match100)
            {
                byte b  = 0;
                byte b2 = 0;
                CPlayerPvpInfoController.GetGameTypeAcntNum(subTab, out b, out b2);
                int num2 = 0;
                while ((long)num2 < (long)((ulong)profile.pvpExtraDetail.dwRecentNum))
                {
                    if (b == 0 || (profile.pvpExtraDetail.astRecentDetail[num2].bGameType == b && profile.pvpExtraDetail.astRecentDetail[num2].bMapAcntNum == b2))
                    {
                        num += (int)profile.pvpExtraDetail.astRecentDetail[num2].dwWinNum;
                        gameCnt++;
                    }
                    num2++;
                }
                gameWins = CPlayerProfile.Divide((uint)num, (uint)gameCnt);
            }
        }
 private static void ConvertAverageData(CPlayerProfile profile, MainTab mainTab, SubTab subTab, out float kda, out float joinFight, out int totalCoinGet, out int totalHurtToEnemy, out int totalBeHurt, out int totalHurtToOrgan, out float totalDead)
 {
     kda              = 0f;
     joinFight        = 0f;
     totalCoinGet     = 0;
     totalHurtToEnemy = 0;
     totalBeHurt      = 0;
     totalHurtToOrgan = 0;
     totalDead        = 0f;
     if (mainTab == MainTab.MatchAll)
     {
         if (subTab == SubTab.Match5V5 || subTab == SubTab.MatchRank || subTab == SubTab.MatchGuild)
         {
             COMDT_HERO_STATISTIC_INFO cOMDT_HERO_STATISTIC_INFO = null;
             if (subTab == SubTab.Match5V5)
             {
                 cOMDT_HERO_STATISTIC_INFO = profile.pvpExtraDetail.st5v5;
             }
             else if (subTab == SubTab.MatchRank)
             {
                 cOMDT_HERO_STATISTIC_INFO = profile.pvpExtraDetail.stLadder;
             }
             else if (subTab == SubTab.MatchGuild)
             {
                 cOMDT_HERO_STATISTIC_INFO = profile.pvpExtraDetail.stGuildMatch;
             }
             uint b = cOMDT_HERO_STATISTIC_INFO.dwWinNum + cOMDT_HERO_STATISTIC_INFO.dwLoseNum;
             kda              = CPlayerProfile.Divide(cOMDT_HERO_STATISTIC_INFO.ullKDAPct, b) / 100f;
             joinFight        = CPlayerProfile.Divide(cOMDT_HERO_STATISTIC_INFO.dwBattleRatioPct, b) / 100f;
             totalCoinGet     = (int)CPlayerProfile.Divide(cOMDT_HERO_STATISTIC_INFO.dwGPM, b);
             totalHurtToEnemy = (int)CPlayerProfile.Divide(cOMDT_HERO_STATISTIC_INFO.dwHurtPM, b);
             totalBeHurt      = (int)CPlayerProfile.Divide(cOMDT_HERO_STATISTIC_INFO.ullTotalBeHurt, b);
             totalHurtToOrgan = (int)CPlayerProfile.Divide(cOMDT_HERO_STATISTIC_INFO.ullTotalHurtOrgan, b);
             totalDead        = CPlayerProfile.Divide(cOMDT_HERO_STATISTIC_INFO.dwDead, b);
         }
         else if (subTab == SubTab.MatchAll)
         {
             uint  num                = profile.pvpExtraDetail.st5v5.dwWinNum + profile.pvpExtraDetail.st5v5.dwLoseNum;
             ulong ullKDAPct          = profile.pvpExtraDetail.st5v5.ullKDAPct;
             uint  dwBattleRatioPct   = profile.pvpExtraDetail.st5v5.dwBattleRatioPct;
             uint  dwGPM              = profile.pvpExtraDetail.st5v5.dwGPM;
             uint  dwHurtPM           = profile.pvpExtraDetail.st5v5.dwHurtPM;
             ulong ullTotalBeHurt     = profile.pvpExtraDetail.st5v5.ullTotalBeHurt;
             ulong ullTotalHurtOrgan  = profile.pvpExtraDetail.st5v5.ullTotalHurtOrgan;
             uint  dwDead             = profile.pvpExtraDetail.st5v5.dwDead;
             uint  num2               = profile.pvpExtraDetail.stLadder.dwWinNum + profile.pvpExtraDetail.stLadder.dwLoseNum;
             ulong ullKDAPct2         = profile.pvpExtraDetail.stLadder.ullKDAPct;
             uint  dwBattleRatioPct2  = profile.pvpExtraDetail.stLadder.dwBattleRatioPct;
             uint  dwGPM2             = profile.pvpExtraDetail.stLadder.dwGPM;
             uint  dwHurtPM2          = profile.pvpExtraDetail.stLadder.dwHurtPM;
             ulong ullTotalBeHurt2    = profile.pvpExtraDetail.stLadder.ullTotalBeHurt;
             ulong ullTotalHurtOrgan2 = profile.pvpExtraDetail.stLadder.ullTotalHurtOrgan;
             uint  dwDead2            = profile.pvpExtraDetail.stLadder.dwDead;
             uint  num3               = profile.pvpExtraDetail.stGuildMatch.dwWinNum + profile.pvpExtraDetail.stGuildMatch.dwLoseNum;
             ulong ullKDAPct3         = profile.pvpExtraDetail.stGuildMatch.ullKDAPct;
             uint  dwBattleRatioPct3  = profile.pvpExtraDetail.stGuildMatch.dwBattleRatioPct;
             uint  dwGPM3             = profile.pvpExtraDetail.stGuildMatch.dwGPM;
             uint  dwHurtPM3          = profile.pvpExtraDetail.stGuildMatch.dwHurtPM;
             ulong ullTotalBeHurt3    = profile.pvpExtraDetail.stGuildMatch.ullTotalBeHurt;
             ulong ullTotalHurtOrgan3 = profile.pvpExtraDetail.stGuildMatch.ullTotalHurtOrgan;
             uint  dwDead3            = profile.pvpExtraDetail.stGuildMatch.dwDead;
             uint  num4               = num + num2 + num3;
             if (num4 == 0u)
             {
                 num4 = 1u;
             }
             kda              = CPlayerProfile.Divide(ullKDAPct + ullKDAPct2 + ullKDAPct3, num4) / 100f;
             joinFight        = CPlayerProfile.Divide(dwBattleRatioPct + dwBattleRatioPct2 + dwBattleRatioPct3, num4) / 100f;
             totalCoinGet     = (int)((dwGPM + dwGPM2 + dwGPM3) / num4);
             totalHurtToEnemy = (int)((dwHurtPM + dwHurtPM2 + dwHurtPM3) / num4);
             totalBeHurt      = (int)((ullTotalBeHurt + ullTotalBeHurt2 + ullTotalBeHurt3) / (ulong)num4);
             totalHurtToOrgan = (int)((ullTotalHurtOrgan + ullTotalHurtOrgan2 + ullTotalHurtOrgan3) / (ulong)num4);
             totalDead        = CPlayerProfile.Divide(dwDead + dwDead2 + dwDead3, num4);
         }
     }
     else if (mainTab == MainTab.Match100)
     {
         uint num5 = 0u;
         uint num6 = 0u;
         byte b2   = 0;
         byte b3   = 0;
         CPlayerPvpInfoController.GetGameTypeAcntNum(subTab, out b2, out b3);
         ulong num7  = 0uL;
         ulong num8  = 0uL;
         ulong num9  = 0uL;
         ulong num10 = 0uL;
         ulong num11 = 0uL;
         ulong num12 = 0uL;
         ulong num13 = 0uL;
         int   num14 = 0;
         while ((long)num14 < (long)((ulong)profile.pvpExtraDetail.dwRecentNum))
         {
             if ((b2 == 0 || (profile.pvpExtraDetail.astRecentDetail[num14].bGameType == b2 && b3 == profile.pvpExtraDetail.astRecentDetail[num14].bMapAcntNum)) && (profile.pvpExtraDetail.astRecentDetail[num14].bGameType != 5 || profile.pvpExtraDetail.astRecentDetail[num14].bMapAcntNum >= 10) && profile.pvpExtraDetail.astRecentDetail[num14].bGameType != 9)
             {
                 num7  += profile.pvpExtraDetail.astRecentDetail[num14].ullKDAPct;
                 num8  += (ulong)profile.pvpExtraDetail.astRecentDetail[num14].dwBattleRatioPct;
                 num6  += profile.pvpExtraDetail.astRecentDetail[num14].dwCampKill;
                 num9  += (ulong)profile.pvpExtraDetail.astRecentDetail[num14].dwGPM;
                 num10 += (ulong)profile.pvpExtraDetail.astRecentDetail[num14].dwHurtPM;
                 num11 += profile.pvpExtraDetail.astRecentDetail[num14].ullTotalBeHurt;
                 num12 += profile.pvpExtraDetail.astRecentDetail[num14].ullTotalHurtOrgan;
                 num13 += (ulong)profile.pvpExtraDetail.astRecentDetail[num14].dwDead;
                 num5  += 1u;
             }
             num14++;
         }
         kda              = CPlayerProfile.Divide(num7, num5) / 100f;
         joinFight        = CPlayerProfile.Divide(num8, num5) / 100f;
         totalCoinGet     = (int)CPlayerProfile.Divide(num9, num5);
         totalHurtToEnemy = (int)CPlayerProfile.Divide(num10, num5);
         totalBeHurt      = (int)CPlayerProfile.Divide(num11, num5);
         totalHurtToOrgan = (int)CPlayerProfile.Divide(num12, num5);
         totalDead        = CPlayerProfile.Divide(num13, num5);
     }
 }
        public void UpdateUI()
        {
            CUIFormScript form = Singleton <CUIManager> .instance.GetForm(CPlayerInfoSystem.sPlayerInfoFormPath);

            if (form == null)
            {
                return;
            }
            GameObject    widget           = form.GetWidget(2);
            CUIListScript componetInChild  = Utility.GetComponetInChild <CUIListScript>(widget, "panelTop/MenuList");
            CUIListScript componetInChild2 = Utility.GetComponetInChild <CUIListScript>(widget, "panelTop/DropList/List");
            GameObject    gameObject       = Utility.FindChild(widget, "panelTop");
            GameObject    gameObject2      = Utility.FindChild(widget, "panelLeft");
            GameObject    gameObject3      = Utility.FindChild(widget, "panelLeftGraph");
            GameObject    p              = Utility.FindChild(widget, "panelRight");
            int           selectedIndex  = componetInChild.GetSelectedIndex();
            int           selectedIndex2 = componetInChild2.GetSelectedIndex();

            if (selectedIndex < 0 || selectedIndex2 < 0 || selectedIndex >= Enum.GetValues(typeof(MainTab)).get_Length() || selectedIndex2 >= Enum.GetValues(typeof(SubTab)).get_Length())
            {
                return;
            }
            CPlayerPvpInfoController.CacheSubTab = selectedIndex2;
            this.InitBaseValue();
            MainTab mainTab = (MainTab)selectedIndex;
            SubTab  subTab  = (SubTab)selectedIndex2;

            Utility.GetComponetInChild <Text>(widget, "panelTop/DropList/Button_Down/Text").set_text(CPlayerPvpInfoController.sSubTitles[(int)subTab]);
            float          num     = 0f;
            float          num2    = 0f;
            int            num3    = 0;
            int            num4    = 0;
            int            num5    = 0;
            int            num6    = 0;
            float          num7    = 0f;
            uint           num8    = 0u;
            uint           num9    = 0u;
            uint           num10   = 0u;
            uint           num11   = 0u;
            uint           num12   = 0u;
            uint           num13   = 0u;
            int            num14   = 0;
            float          num15   = 0f;
            CPlayerProfile profile = Singleton <CPlayerInfoSystem> .instance.GetProfile();

            CPlayerPvpInfoController.ConvertAverageData(profile, mainTab, subTab, out num, out num2, out num3, out num4, out num5, out num6, out num7);
            CPlayerPvpInfoController.ConvertBaseData(profile, mainTab, subTab, out num8, out num9, out num10, out num11, out num12, out num13);
            CPlayerPvpInfoController.ConvertComplexData(profile, mainTab, subTab, out num14, out num15);
            CPlayerPvpInfoController.ConvertAbilityData(profile, mainTab, subTab, this.m_ability);
            for (int i = 0; i < this.m_ability.Length; i++)
            {
                this.m_ability[i] = Mathf.Clamp(this.m_ability[i], 0f, 1f);
            }
            if (subTab == SubTab.MatchAll || subTab == SubTab.Match5V5 || subTab == SubTab.MatchRank || subTab == SubTab.MatchGuild)
            {
                Utility.GetComponetInChild <Text>(gameObject2, "Content/txt1").set_text(num.ToString("F1"));
                Utility.GetComponetInChild <Text>(gameObject2, "Content/txt2").set_text(num2.ToString("P0"));
                Utility.GetComponetInChild <Text>(gameObject2, "Content/txt3").set_text(num3.ToString());
                Utility.GetComponetInChild <Text>(gameObject2, "Content/txt4").set_text(num4.ToString());
                Utility.GetComponetInChild <Text>(gameObject2, "Content/txt5").set_text(num5.ToString());
                Utility.GetComponetInChild <Text>(gameObject2, "Content/txt6").set_text(num6.ToString());
                Utility.GetComponetInChild <Text>(p, "DateBar3/txt9").set_text((this.m_ability[6] * 100f).ToString("F1"));
            }
            else
            {
                Utility.GetComponetInChild <Text>(gameObject2, "Content/txt1").set_text("-");
                Utility.GetComponetInChild <Text>(gameObject2, "Content/txt2").set_text("-");
                Utility.GetComponetInChild <Text>(gameObject2, "Content/txt3").set_text("-");
                Utility.GetComponetInChild <Text>(gameObject2, "Content/txt4").set_text("-");
                Utility.GetComponetInChild <Text>(gameObject2, "Content/txt5").set_text("-");
                Utility.GetComponetInChild <Text>(gameObject2, "Content/txt6").set_text("-");
                Utility.GetComponetInChild <Text>(p, "DateBar3/txt9").set_text("-");
            }
            if (subTab != SubTab.Match1V1)
            {
                Utility.GetComponetInChild <Text>(p, "txt1").set_text(num8.ToString());
                Utility.GetComponetInChild <Text>(p, "txt2").set_text(num9.ToString());
                Utility.GetComponetInChild <Text>(p, "txt3").set_text(num10.ToString());
                Utility.GetComponetInChild <Text>(p, "txt4").set_text(num11.ToString());
                Utility.GetComponetInChild <Text>(p, "txt5").set_text(num12.ToString());
                Utility.GetComponetInChild <Text>(p, "txt6").set_text(num13.ToString());
            }
            else
            {
                Utility.GetComponetInChild <Text>(p, "txt1").set_text("-");
                Utility.GetComponetInChild <Text>(p, "txt2").set_text("-");
                Utility.GetComponetInChild <Text>(p, "txt3").set_text("-");
                Utility.GetComponetInChild <Text>(p, "txt4").set_text("-");
                Utility.GetComponetInChild <Text>(p, "txt5").set_text("-");
                Utility.GetComponetInChild <Text>(p, "txt6").set_text("-");
            }
            Utility.GetComponetInChild <Text>(p, "DateBar1/txt7").set_text(num14.ToString());
            Utility.GetComponetInChild <Text>(p, "DateBar2/txt8").set_text((num15 == 1f) ? num15.ToString("P0") : num15.ToString("P1"));
            Utility.GetComponetInChild <Image>(p, "DateBar2/Bar").set_fillAmount(num15);
            Utility.GetComponetInChild <Image>(p, "DateBar3/Bar").set_fillAmount(CPlayerProfile.Divide(this.m_ability[6], 1f));
            this.InitTemVector();
            Vector3 a = Vector3.zero;

            Vector3[] array = new Vector3[6];
            for (int j = 1; j <= 6; j++)
            {
                GameObject gameObject4 = Utility.FindChild(widget, string.Format("panelLeftGraph/Content/p{0}", j));
                a            = CPlayerPvpInfoController.sTemVector[j] - CPlayerPvpInfoController.sTemVector[0];
                array[j - 1] = CPlayerPvpInfoController.sTemVector[0] + a * this.m_ability[j - 1];
                gameObject4.transform.localPosition = array[j - 1];
            }
            CUIPolygon componetInChild3 = Utility.GetComponetInChild <CUIPolygon>(gameObject3, "Content/Polygon");

            componetInChild3.vertexs = array;
            componetInChild3.SetAllDirty();
            GameObject gameObject5 = Utility.FindChild(widget, "btnGraph");
            GameObject gameObject6 = Utility.FindChild(widget, "btnDetail");
            GameObject obj         = Utility.FindChild(widget, "btnShare");

            gameObject2.CustomSetActive(gameObject5.activeSelf);
            gameObject3.CustomSetActive(gameObject6.activeSelf);
            obj.CustomSetActive(CPlayerInfoSystem.isSelf(Singleton <CPlayerInfoSystem> .instance.GetProfile().m_uuid));
            componetInChild2.gameObject.CustomSetActive(false);
            if (CSysDynamicBlock.bLobbyEntryBlocked)
            {
                CUICommonSystem.SetObjActive(form.transform.FindChild("pnlBg/pnlBody/pnlPvpInfo/btnShare"), false);
            }
        }
Esempio n. 13
0
        public void UpdatePlayerData()
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo();

            if (masterRoleInfo != null)
            {
                CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(FORM_PATH);

                if (this.m_PlayerName != null)
                {
                    this.m_PlayerName.text = masterRoleInfo.Name;
                }
                if (this.m_PlayerExp != null)
                {
                    this.m_PlayerExp.text = masterRoleInfo.Level.ToString();
                }
                if ((masterRoleInfo != null) && (this.m_PvpExpImg != null))
                {
                    this.m_PvpExpImg.CustomFillAmount(CPlayerProfile.Divide(masterRoleInfo.PvpExp, masterRoleInfo.PvpNeedExp));
                    this.m_PvpExpTxt.text = masterRoleInfo.PvpExp + "/" + masterRoleInfo.PvpNeedExp;
                }
                if (this.m_PvpLevel != null)
                {
                    string text = Singleton <CTextManager> .GetInstance().GetText("ranking_PlayerLevel");

                    if ((!string.IsNullOrEmpty(text) && (this.m_PvpLevel.text != null)) && (masterRoleInfo != null))
                    {
                        this.m_PvpLevel.text = string.Format(text, masterRoleInfo.PvpLevel);
                    }
                }
                if (!CSysDynamicBlock.bSocialBlocked)
                {
                    if ((this.m_PlayerVipLevel != null) && (masterRoleInfo != null))
                    {
                        this.m_PlayerVipLevel.text = string.Format("VIP{0}", masterRoleInfo.m_payLevel);
                    }
                    if (((form != null) && form.gameObject.activeSelf) && (masterRoleInfo != null))
                    {
                        GameObject widget = form.GetWidget(2);
                        if ((widget != null) && !string.IsNullOrEmpty(masterRoleInfo.HeadUrl))
                        {
                            CUIHttpImageScript component = widget.GetComponent <CUIHttpImageScript>();
                            component.SetImageUrl(masterRoleInfo.HeadUrl);
                            MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(component.GetComponent <Image>(), (int)masterRoleInfo.GetNobeInfo().stGameVipClient.dwCurLevel, false);

                            Image image = form.GetWidget(3).GetComponent <Image>();
                            MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(image, (int)masterRoleInfo.GetNobeInfo().stGameVipClient.dwHeadIconId);

                            bool       flag   = Singleton <HeadIconSys> .instance.UnReadFlagNum > 0;
                            GameObject target = Utility.FindChild(widget, "RedDot");
                            if (target != null)
                            {
                                if (flag)
                                {
                                    CUICommonSystem.AddRedDot(target, enRedDotPos.enTopRight, 0);
                                }
                                else
                                {
                                    CUICommonSystem.DelRedDot(target);
                                }
                            }
                        }
                    }
                }
                else if ((form != null) && form.gameObject.activeSelf)
                {
                    GameObject obj4 = form.GetWidget(2);
                    if (obj4 != null)
                    {
                        CUIHttpImageScript script3 = obj4.GetComponent <CUIHttpImageScript>();
                        if (script3 != null)
                        {
                            MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(script3.GetComponent <Image>(), 0, false);
                        }
                    }
                }
            }
        }