public void InitCommonHeroUI() { CUIFormScript form = Singleton <CUIManager> .get_instance().GetForm(CPlayerInfoSystem.sPlayerInfoFormPath); if (form == null) { return; } CPlayerProfile profile = Singleton <CPlayerInfoSystem> .get_instance().GetProfile(); GameObject widget = form.GetWidget(7); if (widget == null) { return; } CUIListScript componetInChild = Utility.GetComponetInChild <CUIListScript>(widget, "BaseList"); if (componetInChild == null) { return; } int num = profile.MostUsedHeroList().get_Count(); uint dwConfValue = GameDataMgr.globalInfoDatabin.GetDataByKey(178u).dwConfValue; if ((long)num > (long)((ulong)dwConfValue)) { num = (int)dwConfValue; } componetInChild.SetElementAmount(num); }
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 void SetHideCardButton() { CUIFormScript form = Singleton <CUIManager> .instance.GetForm(CPlayerInfoSystem.sPlayerInfoFormPath); if (form == null) { return; } GameObject widget = form.GetWidget(32); if (widget == null) { return; } Transform transform = widget.transform.Find("pnlContainer/Social_BtnGroupTop"); GameObject gameObject = transform.FindChild("HideBtn").gameObject; CPlayerProfile profile = Singleton <CPlayerInfoSystem> .instance.GetProfile(); Text component = gameObject.transform.Find("Text").GetComponent <Text>(); if (profile.IsPrivacyOpen(COM_USER_PRIVACY_MASK.COM_USER_PRIVACY_MASK_FRIEND_CARD)) { component.set_text(Singleton <CTextManager> .GetInstance().GetText("Social_ShowCard")); } else { component.set_text(Singleton <CTextManager> .GetInstance().GetText("Social_HideCard")); } }
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)); }
private void UpdateTags() { CUIFormScript form = Singleton <CUIManager> .instance.GetForm(CPlayerInfoSystem.sPlayerInfoFormPath); if (form == null) { return; } GameObject widget = form.GetWidget(32); if (widget == null) { return; } Transform transform = widget.transform.Find("pnlContainer/Social_Tag"); if (transform != null) { if (!this.m_isInEditmode) { CPlayerProfile profile = Singleton <CPlayerInfoSystem> .instance.GetProfile(); this.m_tags.Clear(); for (int i = 0; i < (int)profile._socialCardInfo.bTagNum; i++) { this.m_tags.Add(profile._socialCardInfo.TagList[i]); } } transform.FindChild("btnEdit").gameObject.CustomSetActive(this.m_isInEditmode); for (int j = 0; j < this.m_tags.get_Count(); j++) { GameObject gameObject = transform.FindChild("TagGroup/Tag" + (j + 1)).gameObject; gameObject.CustomSetActive(true); Text component = gameObject.transform.Find("Text").GetComponent <Text>(); int id = Convert.ToInt32(this.m_tags.get_Item(j)); ResSocialTags dataByIndex = GameDataMgr.socialTagsDataBin.GetDataByIndex(id); component.set_text(dataByIndex.szText); byte bType = dataByIndex.bType; if (bType != 1) { if (bType == 2) { component.set_color(this.m_colorTagKawaii); } } else { component.set_color(this.m_colorTagCool); } } for (int k = this.m_tags.get_Count(); k < 4; k++) { GameObject gameObject2 = transform.FindChild("TagGroup/Tag" + (k + 1)).gameObject; gameObject2.CustomSetActive(false); } } }
private void OnWatchHisMentor(CUIEvent uievt) { CPlayerProfile profile = Singleton <CPlayerInfoSystem> .instance.GetProfile(); if (profile == null) { return; } Singleton <CPlayerInfoSystem> .GetInstance().ShowPlayerDetailInfo(profile._mentorInfo.ullMasterUid, (int)profile._mentorInfo.dwMasterLogicWorldID, CPlayerInfoSystem.DetailPlayerInfoSource.DefaultOthers, true, CPlayerInfoSystem.Tab.Base_Info); }
public void OnMentorApplyVerifyBoxRetrun(string str) { CPlayerProfile profile = Singleton <CPlayerInfoSystem> .instance.GetProfile(); if (profile == null) { return; } FriendSysNetCore.Send_Request_BeMentor(profile.m_uuid, (uint)profile.m_iLogicWorldId, this.m_addViewtype, str); }
public void OnFriendApplyVerifyBoxRetrun(string str) { CPlayerProfile profile = Singleton <CPlayerInfoSystem> .instance.GetProfile(); if (profile == null) { return; } FriendSysNetCore.Send_Request_BeFriend(profile.m_uuid, (uint)profile.m_iLogicWorldId, str, COM_ADD_FRIEND_TYPE.COM_ADD_FRIEND_NULL, -1); }
public void OnCancelEdit(CUIEvent evt) { CPlayerProfile profile = Singleton <CPlayerInfoSystem> .instance.GetProfile(); if (this.ChcekFriendCardDiffWidgets(profile._socialCardInfo)) { Singleton <CUIManager> .GetInstance().OpenMessageBoxWithCancel(Singleton <CTextManager> .GetInstance().GetText("Social_ChangeCardConfirm"), enUIEventID.Social_CancelEditSave, enUIEventID.Social_CancelEditNotsave, Singleton <CTextManager> .GetInstance().GetText("Save"), Singleton <CTextManager> .GetInstance().GetText("DontSave"), false); } else { this.OnCancelEditNotSave(evt); } }
private void OnHideShowCard(CUIEvent evt) { CPlayerProfile profile = Singleton <CPlayerInfoSystem> .instance.GetProfile(); if (profile.IsPrivacyOpen(COM_USER_PRIVACY_MASK.COM_USER_PRIVACY_MASK_FRIEND_CARD)) { this.OnHideShowCardConfirm(null); } else { Singleton <CUIManager> .GetInstance().OpenMessageBoxWithCancel(Singleton <CTextManager> .GetInstance().GetText("Social_HideCardConfirm"), enUIEventID.Social_HideCardConfirm, enUIEventID.Social_HideCardCancel, false); } }
public static void OnSaveCardSuc(CSPkg msg) { Singleton <CUIManager> .GetInstance().CloseSendMsgAlert(); CPlayerProfile profile = Singleton <CPlayerInfoSystem> .instance.GetProfile(); CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); Singleton <CPlayerSocialInfoController> .instance.SetFriendCardByWidgets(ref profile._socialCardInfo, false); Singleton <CPlayerSocialInfoController> .instance.SetFriendCardByWidgets(ref masterRoleInfo.m_socialFriendCard, false); Singleton <CPlayerSocialInfoController> .instance.m_isInEditmode = false; Singleton <CPlayerSocialInfoController> .instance.UpdateUI(); }
public void OnMentorApplyVerifyBoxRetrun(string str) { CPlayerProfile profile = Singleton <CPlayerInfoSystem> .get_instance().GetProfile(); if (profile == null) { return; } CSPkg cSPkg = NetworkModule.CreateDefaultCSPKG(5402u); cSPkg.stPkgData.get_stApplyMasterReq().bType = (byte)this.m_addViewtype; cSPkg.stPkgData.get_stApplyMasterReq().stUin.dwLogicWorldId = (uint)profile.m_iLogicWorldId; cSPkg.stPkgData.get_stApplyMasterReq().stUin.ullUid = profile.m_uuid; StringHelper.StringToUTF8Bytes(str, ref cSPkg.stPkgData.get_stApplyMasterReq().szVerificationInfo); Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref cSPkg, true); }
private void On_InviteGuild(CUIEvent evt) { CPlayerProfile profile = Singleton <CPlayerInfoSystem> .instance.GetProfile(); if (profile == null) { return; } bool flag = CPlayerInfoSystem.isSelf(profile.m_uuid); if (flag) { return; } Singleton <EventRouter> .GetInstance().BroadCastEvent <ulong, int>("Guild_Invite", profile.m_uuid, profile.m_iLogicWorldId); }
private void FamousMentorInVisitor(ResFamousMentor resFmsMentor) { CPlayerProfile profile = Singleton <CPlayerInfoSystem> .instance.GetProfile(); if (profile == null) { return; } if (this.m_famousMentorData == null) { this.m_famousMentorData = resFmsMentor; return; } if (this.m_famousMentorData.dwPoint < profile._mentorInfo.dwMasterPoint && resFmsMentor.dwPoint <= profile._mentorInfo.dwMasterPoint) { this.m_famousMentorData = resFmsMentor; } }
private void OnHideShowCardConfirm(CUIEvent evt) { CPlayerProfile profile = Singleton <CPlayerInfoSystem> .instance.GetProfile(); if (profile == null) { return; } if (!CPlayerInfoSystem.isSelf(profile.m_uuid)) { return; } bool bOpen = !profile.IsPrivacyOpen(COM_USER_PRIVACY_MASK.COM_USER_PRIVACY_MASK_FRIEND_CARD); profile.SetPrivacyBit(bOpen, COM_USER_PRIVACY_MASK.COM_USER_PRIVACY_MASK_FRIEND_CARD); Singleton <CSettingsSys> .GetInstance().reqOperateUserPrivacyBit(bOpen, COM_USER_PRIVACY_MASK.COM_USER_PRIVACY_MASK_FRIEND_CARD); this.SetHideCardButton(); }
public void OpenForm() { CUIFormScript cUIFormScript = Singleton <CUIManager> .get_instance().OpenForm(CPlayerCommonHeroInfoController.sPlayerInfoCommonHeroFormPath, false, true); if (cUIFormScript == null) { return; } CPlayerProfile profile = Singleton <CPlayerInfoSystem> .get_instance().GetProfile(); GameObject widget = cUIFormScript.GetWidget(0); if (widget == null) { return; } this.m_lastSortIndex = -1; this.m_lastIsUp = 0; CUIListScript componetInChild = Utility.GetComponetInChild <CUIListScript>(widget, "SubMenuList/List"); CUIListScript componetInChild2 = Utility.GetComponetInChild <CUIListScript>(widget, "DetailList/MenuList"); CUICommonSystem.InitMenuPanel(componetInChild.gameObject, CPlayerCommonHeroInfoController.sSubTitles, 0, true); CUICommonSystem.InitMenuPanel(componetInChild2.gameObject, CPlayerCommonHeroInfoController.sSortTitles, 0, true); }
public void MentorBtnUIUpdate() { this.mentorStateStr = null; this.mentorBtnStr = null; CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); CPlayerProfile profile = Singleton <CPlayerInfoSystem> .instance.GetProfile(); if (!profile.isMasterData) { int bLogicGrade = (int)CLadderSystem.GetGradeDataByShowGrade((int)masterRoleInfo.m_rankHistoryHighestGrade).bLogicGrade; int bLogicGrade2 = (int)CLadderSystem.GetGradeDataByShowGrade((int)profile.GetHistoryHighestRankGrade()).bLogicGrade; enMentorState mentorState = CFriendContoller.GetMentorState((int)profile.GetHistoryHighestRankGrade(), null); enMentorState mentorState2 = CFriendContoller.GetMentorState(bLogicGrade, null); if ((mentorState == enMentorState.IHasApprentice || mentorState == enMentorState.IWantApprentice) && bLogicGrade2 > bLogicGrade) { this.mentorStateStr = Singleton <CTextManager> .GetInstance().GetText("Mentor_GetMentor"); this.mentorBtnStr = Singleton <CTextManager> .GetInstance().GetText("Mentor_ProposeMentor"); this.m_addViewtype = 2; if (masterRoleInfo.m_mentorInfo != null && masterRoleInfo.m_mentorInfo.ullMasterUid != 0uL) { this.mentorStateStr = null; } } else if ((mentorState2 == enMentorState.IHasApprentice || mentorState2 == enMentorState.IWantApprentice) && bLogicGrade2 < bLogicGrade) { this.mentorBtnStr = Singleton <CTextManager> .GetInstance().GetText("Mentor_ProposeApprentice"); this.mentorStateStr = Singleton <CTextManager> .GetInstance().GetText("Mentor_GetApprentice"); this.m_addViewtype = 3; } } }
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 static void ConvertBaseData(CPlayerProfile profile, MainTab mainTab, SubTab subTab, out uint winMvp, out uint loseMvp, out uint godLike, out uint tripleKill, out uint quataryKill, out uint pentaKill) { winMvp = 0u; loseMvp = 0u; godLike = 0u; tripleKill = 0u; quataryKill = 0u; pentaKill = 0u; if (mainTab == MainTab.MatchAll) { if (subTab == SubTab.MatchAll) { winMvp = profile.MVPCnt(); loseMvp = profile.LoseSoulCnt(); godLike = profile.HolyShit(); tripleKill = profile.TripleKill(); quataryKill = profile.QuataryKill(); pentaKill = profile.PentaKill(); } else { 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; } else if (subTab == SubTab.Match3V3) { cOMDT_HERO_STATISTIC_INFO = profile.pvpExtraDetail.st3v3; } else if (subTab == SubTab.Match1V1) { cOMDT_HERO_STATISTIC_INFO = profile.pvpExtraDetail.st1v1; } else if (subTab == SubTab.MatchEntertainment) { cOMDT_HERO_STATISTIC_INFO = profile.pvpExtraDetail.stEntertainment; } winMvp = cOMDT_HERO_STATISTIC_INFO.dwMvp; loseMvp = cOMDT_HERO_STATISTIC_INFO.dwLoseSoul; godLike = cOMDT_HERO_STATISTIC_INFO.dwGodLike; tripleKill = cOMDT_HERO_STATISTIC_INFO.dwTripleKill; quataryKill = cOMDT_HERO_STATISTIC_INFO.dwUltraKill; pentaKill = cOMDT_HERO_STATISTIC_INFO.dwRampage; } } else if (mainTab == MainTab.Match100) { byte b = 0; byte b2 = 0; CPlayerPvpInfoController.GetGameTypeAcntNum(subTab, out b, out b2); int num = 0; while ((long)num < (long)((ulong)profile.pvpExtraDetail.dwRecentNum)) { if (b == 0 || (profile.pvpExtraDetail.astRecentDetail[num].bGameType == b && profile.pvpExtraDetail.astRecentDetail[num].bMapAcntNum == b2)) { winMvp += profile.pvpExtraDetail.astRecentDetail[num].dwMvp; loseMvp += profile.pvpExtraDetail.astRecentDetail[num].dwLoseSoul; godLike += profile.pvpExtraDetail.astRecentDetail[num].dwGodLike; tripleKill += profile.pvpExtraDetail.astRecentDetail[num].dwTripleKill; quataryKill += profile.pvpExtraDetail.astRecentDetail[num].dwUltraKill; pentaKill += profile.pvpExtraDetail.astRecentDetail[num].dwRampage; } num++; } } }
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); } }
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") }); }
public float EntertainmentWins() { return(CPlayerProfile.Divide((uint)this.EntertainmentWinGameCnt(), (uint)this.EntertainmentTotalGameCnt())); }
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); } }
public float PvmWins() { return(CPlayerProfile.Divide((uint)this.PvmWinGameCnt(), (uint)this.PvmTotalGameCnt())); }
public float RankWins() { return(CPlayerProfile.Divide((uint)this.RankWinGameCnt(), (uint)this.RankTotalGameCnt())); }
public float PvpGuildWins() { return(CPlayerProfile.Divide((uint)this._guildWinCount, (uint)this._guildTotalCount)); }
public void UpdateUI() { CUIFormScript form = Singleton <CUIManager> .instance.GetForm(CPlayerInfoSystem.sPlayerInfoFormPath); if (form == null) { return; } CPlayerProfile profile = Singleton <CPlayerInfoSystem> .instance.GetProfile(); if (profile == null) { return; } this.m_famousMentorData = null; GameObject widget = form.GetWidget(21); GameObject widget2 = form.GetWidget(18); GameObject widget3 = form.GetWidget(19); GameObject widget4 = form.GetWidget(20); GameObject widget5 = form.GetWidget(22); GameObject widget6 = form.GetWidget(23); GameObject widget7 = form.GetWidget(24); GameObject widget8 = form.GetWidget(25); GameObject widget9 = form.GetWidget(26); GameObject widget10 = form.GetWidget(27); GameObject widget11 = form.GetWidget(28); GameObject widget12 = form.GetWidget(29); GameObject widget13 = form.GetWidget(30); widget12.CustomSetActive(true); widget13.CustomSetActive(false); string text = Singleton <CTextManager> .GetInstance().GetText("Common_NoData"); widget7.CustomSetActive(profile._mentorInfo.ullMasterUid == 0uL); widget5.CustomSetActive(profile._mentorInfo.ullMasterUid != 0uL); if (profile._mentorInfo.dwStudentNum != 0u) { widget3.GetComponent <Text>().set_text(profile._mentorInfo.dwStudentNum.ToString()); } else { widget3.GetComponent <Text>().set_text(text); } if (profile._mentorInfo.dwFinishStudentNum != 0u) { widget4.GetComponent <Text>().set_text(profile._mentorInfo.dwFinishStudentNum.ToString()); } else { widget4.GetComponent <Text>().set_text(text); } string text2 = Utility.UTF8Convert(profile._mentorInfo.szRoleName); if (string.IsNullOrEmpty(text2)) { text2 = text; } enMentorState mentorState = CFriendContoller.GetMentorState((int)profile.GetHistoryHighestRankGrade(), null); if (mentorState == enMentorState.IWantMentor || mentorState == enMentorState.IHasMentor || profile._mentorInfo.dwMasterPoint == 0u) { this.SetTempNoData(form, text2); } else { widget10.CustomSetActive(true); widget8.CustomSetActive(true); widget9.CustomSetActive(true); GameDataMgr.famousMentorDatabin.Accept(new Action <ResFamousMentor>(this.FamousMentorInVisitor)); if (this.m_famousMentorData == null) { this.SetTempNoData(form, text2); return; } widget11.CustomSetActive(true); widget8.GetComponent <Text>().set_text(this.m_famousMentorData.szTitle); string prefabPath = string.Format("{0}{1}.prefab", CUIUtility.s_Sprite_System_ShareUI_Dir, this.m_famousMentorData.iLevel.ToString()); CUIUtility.SetImageSprite(widget11.GetComponent <Image>(), prefabPath, null, true, false, false, false); widget2.GetComponent <Text>().set_text(Singleton <CTextManager> .GetInstance().GetText("Mentor_PlayerInfo", new string[] { this.m_famousMentorData.iLevel.ToString(), this.m_famousMentorData.szTitle, profile._mentorInfo.dwMasterPoint.ToString(), text2 })); ResFamousMentor dataByKey = GameDataMgr.famousMentorDatabin.GetDataByKey(this.m_famousMentorData.dwID + 1u); if (dataByKey == null) { widget9.GetComponent <Text>().set_text(profile._mentorInfo.dwMasterPoint + string.Empty); } else { widget9.GetComponent <Text>().set_text(profile._mentorInfo.dwMasterPoint + "/" + dataByKey.dwPoint); } uint num = 0u; if (this.m_famousMentorData.dwID != 1u) { ResFamousMentor dataByKey2 = GameDataMgr.famousMentorDatabin.GetDataByKey(this.m_famousMentorData.dwID - 1u); if (dataByKey2 != null) { num = dataByKey2.dwPoint; } } if (this.m_famousMentorData.dwPoint == num) { widget10.GetComponent <Image>().set_fillAmount(0f); } else { widget10.GetComponent <Image>().set_fillAmount((profile._mentorInfo.dwMasterPoint - num) / (this.m_famousMentorData.dwPoint - num)); } } this.MentorBtnUIUpdate(); widget6.CustomSetActive(this.mentorBtnStr != null); if (this.mentorBtnStr != null) { widget6.transform.Find("Text").GetComponent <Text>().set_text(this.mentorBtnStr); } }
private static void ConvertAbilityData(CPlayerProfile profile, MainTab mainTab, SubTab subTab, float[] ability) { for (int i = 0; i < ability.Length; i++) { ability[i] = 0f; } CSDT_STATISTIC_DATA_EXTRA_RADAR_INFO cSDT_STATISTIC_DATA_EXTRA_RADAR_INFO = null; if (profile.pvpAbilityDetail == null) { return; } if (mainTab == MainTab.MatchAll) { if (subTab == SubTab.MatchAll) { cSDT_STATISTIC_DATA_EXTRA_RADAR_INFO = profile.pvpAbilityDetail.stTotal; } else if (subTab == SubTab.Match5V5) { cSDT_STATISTIC_DATA_EXTRA_RADAR_INFO = profile.pvpAbilityDetail.stTotal5v5; } else if (subTab == SubTab.MatchRank) { cSDT_STATISTIC_DATA_EXTRA_RADAR_INFO = profile.pvpAbilityDetail.stTotalLadder; } else if (subTab == SubTab.MatchGuild) { cSDT_STATISTIC_DATA_EXTRA_RADAR_INFO = profile.pvpAbilityDetail.stTotalGuild; } } else if (mainTab == MainTab.Match100) { if (subTab == SubTab.MatchAll) { cSDT_STATISTIC_DATA_EXTRA_RADAR_INFO = profile.pvpAbilityDetail.stRecentTotal; } else if (subTab == SubTab.Match5V5) { cSDT_STATISTIC_DATA_EXTRA_RADAR_INFO = profile.pvpAbilityDetail.stRecent5v5; } else if (subTab == SubTab.MatchRank) { cSDT_STATISTIC_DATA_EXTRA_RADAR_INFO = profile.pvpAbilityDetail.stRecentLadder; } else if (subTab == SubTab.MatchGuild) { cSDT_STATISTIC_DATA_EXTRA_RADAR_INFO = profile.pvpAbilityDetail.stRecentGuild; } } if (cSDT_STATISTIC_DATA_EXTRA_RADAR_INFO == null) { return; } ability[0] = cSDT_STATISTIC_DATA_EXTRA_RADAR_INFO.dwKDA / 100f; ability[1] = cSDT_STATISTIC_DATA_EXTRA_RADAR_INFO.dwPush / 100f; ability[2] = cSDT_STATISTIC_DATA_EXTRA_RADAR_INFO.dwHurtHero / 100f; ability[3] = cSDT_STATISTIC_DATA_EXTRA_RADAR_INFO.dwGrow / 100f; ability[4] = cSDT_STATISTIC_DATA_EXTRA_RADAR_INFO.dwBattle / 100f; ability[5] = cSDT_STATISTIC_DATA_EXTRA_RADAR_INFO.dwSurvive / 100f; ability[6] = cSDT_STATISTIC_DATA_EXTRA_RADAR_INFO.dwTotal / 100f; }
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); }
public void UpdateUI() { CUIFormScript form = Singleton <CUIManager> .get_instance().GetForm(CPlayerInfoSystem.sPlayerInfoFormPath); if (form == null) { return; } CPlayerProfile profile = Singleton <CPlayerInfoSystem> .get_instance().GetProfile(); if (profile == null) { return; } this.m_famousMentorData = null; GameObject widget = form.GetWidget(21); GameObject widget2 = form.GetWidget(18); GameObject widget3 = form.GetWidget(19); GameObject widget4 = form.GetWidget(20); GameObject widget5 = form.GetWidget(22); GameObject widget6 = form.GetWidget(23); GameObject widget7 = form.GetWidget(24); GameObject widget8 = form.GetWidget(25); GameObject widget9 = form.GetWidget(26); GameObject widget10 = form.GetWidget(27); GameObject widget11 = form.GetWidget(28); GameObject widget12 = form.GetWidget(29); GameObject widget13 = form.GetWidget(30); widget12.CustomSetActive(true); widget13.CustomSetActive(false); string text = Singleton <CTextManager> .GetInstance().GetText("Common_NoData"); widget6.CustomSetActive(!profile.isMasterData); widget7.CustomSetActive(profile._mentorInfo.ullMasterUid == 0uL); widget5.CustomSetActive(profile._mentorInfo.ullMasterUid != 0uL); enMentorState mentorState = CFriendContoller.GetMentorState(profile.PvpLevel(), null); if (!profile.isMasterData) { switch (mentorState) { case enMentorState.IWantMentor: case enMentorState.IHasMentor: widget6.transform.Find("Text").GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Mentor_ProposeApprentice"); break; case enMentorState.IWantApprentice: case enMentorState.IHasApprentice: widget6.transform.Find("Text").GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Mentor_ProposeMentor"); break; default: widget6.CustomSetActive(false); break; } } if (profile._mentorInfo.dwStudentNum != 0u) { widget3.GetComponent <Text>().text = profile._mentorInfo.dwStudentNum.ToString(); } else { widget3.GetComponent <Text>().text = text; } if (profile._mentorInfo.dwFinishStudentNum != 0u) { widget4.GetComponent <Text>().text = profile._mentorInfo.dwFinishStudentNum.ToString(); } else { widget4.GetComponent <Text>().text = text; } string text2 = Utility.UTF8Convert(profile._mentorInfo.szRoleName); if (string.IsNullOrEmpty(text2)) { text2 = text; } if (mentorState == enMentorState.IWantMentor || mentorState == enMentorState.IHasMentor || profile._mentorInfo.dwMasterPoint == 0u) { this.SetTempNoData(form, text2); } else { widget10.CustomSetActive(true); widget8.CustomSetActive(true); widget9.CustomSetActive(true); GameDataMgr.famousMentorDatabin.Accept(new Action <ResFamousMentor>(this.FamousMentorInVisitor)); if (this.m_famousMentorData == null) { this.SetTempNoData(form, text2); return; } widget11.CustomSetActive(true); widget8.GetComponent <Text>().text = this.m_famousMentorData.szTitle; string prefabPath = string.Format("{0}{1}.prefab", CUIUtility.s_Sprite_System_ShareUI_Dir, this.m_famousMentorData.iLevel.ToString()); CUIUtility.SetImageSprite(widget11.GetComponent <Image>(), prefabPath, null, true, false, false, false); widget2.GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Mentor_PlayerInfo", new string[] { this.m_famousMentorData.iLevel.ToString(), this.m_famousMentorData.szTitle, profile._mentorInfo.dwMasterPoint.ToString(), text2 }); ResFamousMentor dataByKey = GameDataMgr.famousMentorDatabin.GetDataByKey(this.m_famousMentorData.dwID + 1u); if (dataByKey == null) { widget9.GetComponent <Text>().text = profile._mentorInfo.dwMasterPoint + string.Empty; } else { widget9.GetComponent <Text>().text = profile._mentorInfo.dwMasterPoint + "/" + dataByKey.dwPoint; } uint num = 0u; if (this.m_famousMentorData.dwID != 1u) { ResFamousMentor dataByKey2 = GameDataMgr.famousMentorDatabin.GetDataByKey(this.m_famousMentorData.dwID - 1u); if (dataByKey2 != null) { num = dataByKey2.dwPoint; } } if (this.m_famousMentorData.dwPoint == num) { widget10.GetComponent <Image>().fillAmount = 0f; } else { widget10.GetComponent <Image>().fillAmount = (profile._mentorInfo.dwMasterPoint - num) / (this.m_famousMentorData.dwPoint - num); } } this.mentorStateStr = null; CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); enMentorState mentorState2 = CFriendContoller.GetMentorState(profile.PvpLevel(), null); enMentorState mentorState3 = CFriendContoller.GetMentorState(masterRoleInfo.PvpLevel, null); if ((mentorState2 == enMentorState.IHasApprentice || mentorState2 == enMentorState.IWantApprentice) && (mentorState3 == enMentorState.IHasMentor || mentorState3 == enMentorState.IWantMentor)) { this.mentorStateStr = Singleton <CTextManager> .GetInstance().GetText("Mentor_GetMentor"); this.m_addViewtype = 2; if (masterRoleInfo.m_mentorInfo != null && masterRoleInfo.m_mentorInfo.ullMasterUid != 0uL) { this.mentorStateStr = null; } } else if ((mentorState3 == enMentorState.IHasApprentice || mentorState3 == enMentorState.IWantApprentice) && (mentorState2 == enMentorState.IHasMentor || mentorState2 == enMentorState.IWantMentor)) { this.mentorStateStr = Singleton <CTextManager> .GetInstance().GetText("Mentor_GetApprentice"); this.m_addViewtype = 3; } widget6.CustomSetActive(this.mentorStateStr != null); }