public static void ReceiveHonorChosenRsp(CSPkg msg) { Singleton <CUIManager> .GetInstance().CloseSendMsgAlert(); CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CPlayerInfoSystem.sPlayerInfoFormPath); SCPKG_USEHONOR_RSP stUseHonorRsp = msg.stPkgData.stUseHonorRsp; if (stUseHonorRsp.iErrorCode != 0) { Singleton <CUIManager> .GetInstance().OpenTips(Utility.ProtErrCodeToStr(1417, msg.stPkgData.stUseHonorRsp.iErrorCode), false, 1.5f, null, new object[0]); if (form != null) { COMDT_HONORINFO cOMDT_HONORINFO = new COMDT_HONORINFO(); cOMDT_HONORINFO.iHonorID = msg.stPkgData.stUseHonorRsp.iHonorID; cOMDT_HONORINFO.iHonorLevel = 0; Singleton <CPlayerHonorController> .GetInstance().UpdateSelectedHonor(form, cOMDT_HONORINFO); } return; } CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo != null) { masterRoleInfo.selectedHonorID = msg.stPkgData.stUseHonorRsp.iHonorID; CPlayerProfile profile = Singleton <CPlayerInfoSystem> .GetInstance().GetProfile(); profile.ConvertRoleInfoData(masterRoleInfo); if (form != null) { Singleton <CPlayerHonorController> .GetInstance().Draw(form); } } }
private void SetHonorImage(Transform imgTransform, COMDT_HONORINFO honorInfo) { string honorImagePath = this.GetHonorImagePath(honorInfo.iHonorID, honorInfo.iHonorLevel); Image component = imgTransform.GetComponent <Image>(); component.SetSprite(CUIUtility.GetSpritePrefeb(honorImagePath, false, false), false); }
private void SetHonorAssitImage(Transform imgTransform, COMDT_HONORINFO honorInfo, CUIFormScript form) { if (imgTransform != null) { Image component = imgTransform.GetComponent <Image>(); if (component == null) { return; } switch (honorInfo.iHonorID) { case 1: { string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Pvp_Settle_Large_Dir, "Img_Icon_Red_Mvp"); component.SetSprite(prefabPath, form, true, false, false, false); break; } case 2: { string prefabPath2 = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Pvp_Settle_Large_Dir, "HurtMost"); component.SetSprite(prefabPath2, form, true, false, false, false); break; } case 3: { string prefabPath3 = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Pvp_Settle_Large_Dir, "KillMost"); component.SetSprite(prefabPath3, form, true, false, false, false); break; } case 4: { string prefabPath4 = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Pvp_Settle_Large_Dir, "MostMoney"); component.SetSprite(prefabPath4, form, true, false, false, false); break; } case 5: { string prefabPath5 = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Pvp_Settle_Large_Dir, "AsssistMost"); component.SetSprite(prefabPath5, form, true, false, false, false); break; } case 6: { string prefabPath6 = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Pvp_Settle_Large_Dir, "HurtTakenMost"); component.SetSprite(prefabPath6, form, true, false, false, false); break; } } } }
private void OnHonorItemEnable(CUIEvent uiEvent) { int srcWidgetIndexInBelongedList = uiEvent.m_srcWidgetIndexInBelongedList; if (srcWidgetIndexInBelongedList < 0 || srcWidgetIndexInBelongedList >= this.m_honorInfoList.get_Count()) { return; } COMDT_HONORINFO cOMDT_HONORINFO = this.m_honorInfoList.get_Item(srcWidgetIndexInBelongedList); if (cOMDT_HONORINFO == null) { return; } ResHonor dataByKey = GameDataMgr.resHonor.GetDataByKey((long)cOMDT_HONORINFO.iHonorID); if (dataByKey == null) { return; } if (cOMDT_HONORINFO.iHonorLevel < 0 || cOMDT_HONORINFO.iHonorLevel > dataByKey.astHonorLevel.Length) { return; } CUIListElementScript cUIListElementScript = uiEvent.m_srcWidgetScript as CUIListElementScript; if (cUIListElementScript == null) { return; } GameObject widget = cUIListElementScript.GetWidget(0); GameObject widget2 = cUIListElementScript.GetWidget(1); GameObject widget3 = cUIListElementScript.GetWidget(2); GameObject widget4 = cUIListElementScript.GetWidget(3); GameObject widget5 = cUIListElementScript.GetWidget(4); if (widget != null) { this.SetHonorImage(widget.transform, cOMDT_HONORINFO); } if (widget2 != null) { this.SetHonorAssitImage(widget2.transform, cOMDT_HONORINFO, uiEvent.m_srcFormScript); } if (widget3 != null) { this.SetHonorPoint(widget3.transform, cOMDT_HONORINFO); } this.SetHonorStatus(widget5, cOMDT_HONORINFO); widget4.CustomSetActive(false); }
public void Draw(CUIFormScript form) { if (form != null) { GameObject widget = form.GetWidget(9); if (widget != null) { Utility.FindChild(widget, "pnlHonorInfo").CustomSetActive(true); GameObject obj3 = Utility.FindChild(widget, "pnlHonorInfo/pnlContainer/HonorList"); if (obj3 != null) { CUIListScript component = obj3.GetComponent <CUIListScript>(); if (component != null) { Singleton <CUIEventManager> .GetInstance().RemoveUIEventListener(enUIEventID.Player_Info_Honor_Item_Enable, new CUIEventManager.OnUIEventHandler(this.OnHonorItemEnable)); Singleton <CUIEventManager> .GetInstance().RemoveUIEventListener(enUIEventID.Player_Info_Honor_Select_Change, new CUIEventManager.OnUIEventHandler(this.OnHonorSelectChange)); Singleton <CUIEventManager> .GetInstance().RemoveUIEventListener(enUIEventID.Player_Info_Honor_Chosen, new CUIEventManager.OnUIEventHandler(this.OnHonorChosen)); Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Player_Info_Honor_Item_Enable, new CUIEventManager.OnUIEventHandler(this.OnHonorItemEnable)); Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Player_Info_Honor_Select_Change, new CUIEventManager.OnUIEventHandler(this.OnHonorSelectChange)); Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Player_Info_Honor_Chosen, new CUIEventManager.OnUIEventHandler(this.OnHonorChosen)); this.m_honorInfoList.Clear(); CPlayerProfile profile = Singleton <CPlayerInfoSystem> .GetInstance().GetProfile(); Dictionary <int, COMDT_HONORINFO> honorDic = profile.GetHonorDic(); int selectedHonorId = profile.GetSelectedHonorId(); Dictionary <int, COMDT_HONORINFO> .Enumerator enumerator = honorDic.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <int, COMDT_HONORINFO> current = enumerator.Current; COMDT_HONORINFO item = current.Value; if (item != null) { this.m_honorInfoList.Add(item); } } if (this.m_honorInfoList != null) { if (< > f__am$cache1 == null) {
private void SetHonorDesc(Transform descTransform, COMDT_HONORINFO honorInfo) { if (descTransform != null) { Text component = descTransform.GetComponent <Text>(); if (component != null) { ResHonor dataByKey = GameDataMgr.resHonor.GetDataByKey((long)honorInfo.iHonorID); if (dataByKey == null) { component.set_text(string.Empty); } else { component.set_text(dataByKey.szDesc); } } } }
public void InsertHonorOnDuplicateUpdate(ref Dictionary <int, COMDT_HONORINFO> dic, int type, int defaultPoint = 1) { COMDT_HONORINFO cOMDT_HONORINFO = new COMDT_HONORINFO(); if (!dic.ContainsKey(type)) { cOMDT_HONORINFO.iHonorID = type; cOMDT_HONORINFO.iHonorLevel = 0; cOMDT_HONORINFO.iHonorPoint = defaultPoint; this.JudgeHonorLevelUp(cOMDT_HONORINFO); dic.Add(type, cOMDT_HONORINFO); } else if (dic.TryGetValue(type, ref cOMDT_HONORINFO)) { cOMDT_HONORINFO.iHonorPoint = defaultPoint; this.JudgeHonorLevelUp(cOMDT_HONORINFO); dic.set_Item(type, cOMDT_HONORINFO); } }
public void InsertHonorOnDuplicateUpdate(ref Dictionary <int, COMDT_HONORINFO> dic, int type, int defaultPoint = 1) { COMDT_HONORINFO honorInfo = new COMDT_HONORINFO(); if (!dic.ContainsKey(type)) { honorInfo.iHonorID = type; honorInfo.iHonorLevel = 0; honorInfo.iHonorPoint = defaultPoint; this.JudgeHonorLevelUp(honorInfo); dic.Add(type, honorInfo); } else if (dic.TryGetValue(type, out honorInfo)) { honorInfo.iHonorPoint = defaultPoint; this.JudgeHonorLevelUp(honorInfo); dic[type] = honorInfo; } }
private void SetHonorPoint(Transform cntTransform, COMDT_HONORINFO honorInfo) { if (cntTransform != null) { Text component = cntTransform.GetComponent <Text>(); if (component != null) { ResHonor dataByKey = GameDataMgr.resHonor.GetDataByKey((long)honorInfo.iHonorID); if (dataByKey == null) { component.set_text(string.Empty); } else { component.set_text(this.GetHonorProgress(honorInfo.iHonorPoint, dataByKey)); } } } }
private void SetHonorName(Transform labelTransform, COMDT_HONORINFO honorInfo) { if (labelTransform != null) { CTextManager instance = Singleton <CTextManager> .GetInstance(); Text component = labelTransform.GetComponent <Text>(); if (component != null) { switch (honorInfo.iHonorID) { case 1: component.set_text(instance.GetText("Player_Info_Honor_Name_MVP")); break; case 2: component.set_text(instance.GetText("Player_Info_Honor_Name_MAXDAMAGETOHERO")); break; case 3: component.set_text(instance.GetText("Player_Info_Honor_Name_MAXKILL")); break; case 4: component.set_text(instance.GetText("Player_Info_Honor_Name_MAXMONEY")); break; case 5: component.set_text(instance.GetText("Player_Info_Honor_Name_MAXASSIS")); break; case 6: component.set_text(instance.GetText("Player_Info_Honor_Name_MAXRECVDAMAGE")); break; default: component.set_text(string.Empty); break; } } } }
private void OnHonorChosen(CUIEvent uiEvent) { GameObject widget = uiEvent.m_srcFormScript.GetWidget(9); if (widget == null) { return; } GameObject gameObject = Utility.FindChild(widget, "pnlHonorInfo/pnlContainer/HonorList"); if (gameObject == null) { return; } CUIListScript component = gameObject.GetComponent <CUIListScript>(); if (component == null) { return; } int selectedIndex = component.GetSelectedIndex(); if (uiEvent.m_srcFormScript == null || selectedIndex < 0 || selectedIndex >= this.m_honorInfoList.get_Count()) { return; } COMDT_HONORINFO cOMDT_HONORINFO = this.m_honorInfoList.get_Item(selectedIndex); if (cOMDT_HONORINFO == null) { return; } if (cOMDT_HONORINFO.iHonorLevel <= 0) { return; } CSPkg cSPkg = NetworkModule.CreateDefaultCSPKG(1416u); CSPKG_USEHONOR_REQ stUseHonorReq = cSPkg.stPkgData.stUseHonorReq; stUseHonorReq.iHonorID = cOMDT_HONORINFO.iHonorID; Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref cSPkg, true); }
private void SetHonorStatus(GameObject chosenGo, COMDT_HONORINFO honorInfo) { if (honorInfo == null) { chosenGo.CustomSetActive(false); return; } CPlayerProfile profile = Singleton <CPlayerInfoSystem> .GetInstance().GetProfile(); int selectedHonorId = profile.GetSelectedHonorId(); if (honorInfo.iHonorID == selectedHonorId) { chosenGo.CustomSetActive(true); } else { chosenGo.CustomSetActive(false); } }
private void OnHonorSelectChange(CUIEvent uiEvent) { CUIListScript cUIListScript = uiEvent.m_srcWidgetScript as CUIListScript; if (cUIListScript == null) { return; } int selectedIndex = cUIListScript.GetSelectedIndex(); if (uiEvent.m_srcFormScript == null || selectedIndex < 0 || selectedIndex >= this.m_honorInfoList.get_Count()) { return; } COMDT_HONORINFO cOMDT_HONORINFO = this.m_honorInfoList.get_Item(selectedIndex); if (cOMDT_HONORINFO == null) { return; } this.UpdateSelectedHonor(uiEvent.m_srcFormScript, cOMDT_HONORINFO); }
private void JudgeHonorLevelUp(COMDT_HONORINFO honorInfo) { int iHonorID = honorInfo.iHonorID; int iHonorPoint = honorInfo.iHonorPoint; int num3 = -1; ResHonor dataByKey = GameDataMgr.resHonor.GetDataByKey((long)iHonorID); if (dataByKey != null) { for (int i = 0; i < dataByKey.astHonorLevel.Length; i++) { if (iHonorPoint < dataByKey.astHonorLevel[i].iMaxPoint) { break; } num3++; } if (num3 >= dataByKey.astHonorLevel.Length) { num3--; } } honorInfo.iHonorLevel = num3; }
public void ConvertServerDetailData(CSDT_ACNT_DETAIL_INFO detailInfo) { this.isMasterData = false; this.ResetData(); this._doubleKillCount = 0; this._trippleKillCount = 0; this._quataryKillCount = 0; this._pentaKillCount = 0; this._holyShitCount = 0; this._mvpCnt = 0; this._loseMvpCount = 0; if (detailInfo == null) { return; } this._playerName = StringHelper.UTF8BytesToString(ref detailInfo.szAcntName); this.m_personSign = StringHelper.UTF8BytesToString(ref detailInfo.szSignatureInfo); this.m_uuid = detailInfo.ullUid; this.m_iLogicWorldId = detailInfo.iLogicWorldId; this.m_vipInfo = new SCPKG_GAME_VIP_NTF(); this.m_vipInfo.stGameVipClient = detailInfo.stGameVip; this._playerHeadUrl = Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(ref detailInfo.szOpenUrl); this._playerLevel = detailInfo.dwLevel; ResAcntExpInfo dataByKey = GameDataMgr.acntExpDatabin.GetDataByKey(this._playerLevel); this._playerNeedExp = dataByKey.dwNeedExp; this._playerExp = detailInfo.dwExp; this.creditScore = detailInfo.dwCreditValue; this.sumDelCreditValue = detailInfo.iSumDelCreditValue * -1; this.mostDelCreditType = detailInfo.dwMostDelCreditType; this._power = detailInfo.dwPower; this._pvpLevel = detailInfo.dwPvpLevel; this._playerPvpExp = detailInfo.dwPvpExp; this._gender = detailInfo.bGender; this._privilegeType = detailInfo.bPrivilege; this._rankGrade = detailInfo.bGradeOfRank; this._rankHistoryHighestGrade = detailInfo.bMaxGradeOfRank; this._rankClass = detailInfo.dwCurClassOfRank; this._rankHistoryHighestClass = detailInfo.stRankInfo.dwTopClassOfRank; this.GuildName = StringHelper.UTF8BytesToString(ref detailInfo.stGuildInfo.szGuildName); this.GuildState = detailInfo.stGuildInfo.bGuildState; this.qqVipMask = detailInfo.dwQQVIPMask; int num = 0; while ((long)num < (long)((ulong)detailInfo.stStatistic.stKVDetail.dwNum)) { COMDT_STATISTIC_KEY_VALUE_INFO cOMDT_STATISTIC_KEY_VALUE_INFO = detailInfo.stStatistic.stKVDetail.astKVDetail[num]; RES_STATISTIC_SETTLE_DATA_TYPE dwKey = cOMDT_STATISTIC_KEY_VALUE_INFO.dwKey; switch (dwKey) { case 13: this._mvpCnt = (int)cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue; break; case 14: this._loseMvpCount = (int)cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue; break; case 15: this._holyShitCount = (int)cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue; break; case 16: this._doubleKillCount = (int)cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue; break; case 17: this._trippleKillCount = (int)cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue; break; default: if (dwKey != 27) { if (dwKey == 28) { this._pentaKillCount = (int)cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue; } } else { this._quataryKillCount = (int)cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue; } break; } num++; } this._5V5TotalCount = (int)detailInfo.stStatistic.stFiveVsFiveInfo.dwTotalNum; this._5V5WinCount = (int)detailInfo.stStatistic.stFiveVsFiveInfo.dwWinNum; this._3V3TotalCount = (int)detailInfo.stStatistic.stThreeVsThreeInfo.dwTotalNum; this._3V3WinCount = (int)detailInfo.stStatistic.stThreeVsThreeInfo.dwWinNum; this._2V2TotalCount = (int)detailInfo.stStatistic.stTwoVsTwoInfo.dwTotalNum; this._2V2WinCount = (int)detailInfo.stStatistic.stTwoVsTwoInfo.dwWinNum; this._1V1TotalCount = (int)detailInfo.stStatistic.stOneVsOneInfo.dwTotalNum; this._1V1WinCount = (int)detailInfo.stStatistic.stOneVsOneInfo.dwWinNum; this._guildTotalCount = (int)detailInfo.stStatistic.stGuildMatch.dwTotalNum; this._guildWinCount = (int)detailInfo.stStatistic.stGuildMatch.dwWinNum; this._vsAiTotalCount = (int)detailInfo.stStatistic.stVsMachineInfo.dwTotalNum; this._vsAiWinCount = (int)detailInfo.stStatistic.stVsMachineInfo.dwWinNum; this._rankTotalCount = (int)detailInfo.stStatistic.stLadderInfo.dwTotalNum; this._rankWinCount = (int)detailInfo.stStatistic.stLadderInfo.dwWinNum; this._entertainmentTotalCount = (int)detailInfo.stStatistic.stEntertainmentInfo.dwTotalNum; this._entertainmentWinCount = (int)detailInfo.stStatistic.stEntertainmentInfo.dwWinNum; this._heroCnt = (int)detailInfo.stMostUsedHero.dwTotalHeroNum; this._skinCnt = (int)detailInfo.stMostUsedHero.dwTotalSkinNum; this._isOnLine = (detailInfo.bIsOnline != 0); if (this._mostUsedHeroList == null) { this._mostUsedHeroList = new ListView <COMDT_MOST_USED_HERO_INFO>(); } else { this._mostUsedHeroList.Clear(); } int num2 = (int)Mathf.Min(detailInfo.stMostUsedHero.dwHeroNum, (float)detailInfo.stMostUsedHero.astHeroInfoList.Length); for (int i = 0; i < num2; i++) { this._mostUsedHeroList.Add(detailInfo.stMostUsedHero.astHeroInfoList[i]); } this.SortMostUsedHeroList(); if (detailInfo.stHonorInfo == null || detailInfo.stHonorInfo.bHonorCnt < 6) { Singleton <CRoleInfoManager> .get_instance().InsertHonorOnDuplicateUpdate(ref this._honorDic, 1, 0); Singleton <CRoleInfoManager> .get_instance().InsertHonorOnDuplicateUpdate(ref this._honorDic, 2, 0); Singleton <CRoleInfoManager> .get_instance().InsertHonorOnDuplicateUpdate(ref this._honorDic, 6, 0); Singleton <CRoleInfoManager> .get_instance().InsertHonorOnDuplicateUpdate(ref this._honorDic, 4, 0); Singleton <CRoleInfoManager> .get_instance().InsertHonorOnDuplicateUpdate(ref this._honorDic, 5, 0); Singleton <CRoleInfoManager> .get_instance().InsertHonorOnDuplicateUpdate(ref this._honorDic, 3, 0); } if (detailInfo.stHonorInfo != null) { for (int j = 0; j < (int)detailInfo.stHonorInfo.bHonorCnt; j++) { COMDT_HONORINFO cOMDT_HONORINFO = detailInfo.stHonorInfo.astHonorInfo[j]; switch (cOMDT_HONORINFO.iHonorID) { case 1: case 2: case 3: case 4: case 5: case 6: Singleton <CRoleInfoManager> .get_instance().InsertHonorOnDuplicateUpdate(ref this._honorDic, cOMDT_HONORINFO.iHonorID, cOMDT_HONORINFO.iHonorPoint); break; } } COMDT_HONORINFO cOMDT_HONORINFO2 = new COMDT_HONORINFO(); if (this._honorDic.TryGetValue(detailInfo.stHonorInfo.iCurUseHonorID, ref cOMDT_HONORINFO2)) { if (cOMDT_HONORINFO2.iHonorLevel > 0) { this._selectedHonorId = detailInfo.stHonorInfo.iCurUseHonorID; } else { this._selectedHonorId = 0; } } } this._geiLiDuiYou = (int)detailInfo.stLikeNum.dwTeammateNum; this._keJingDuiShou = (int)detailInfo.stLikeNum.dwOpponentNum; this._haveExtraCoin = false; this._haveExtraExp = false; this.pvpExtraDetail = detailInfo.stStatistic.stMultiExtraDetail; this.pvpAbilityDetail = detailInfo.stStatistic.stRadarDetail; CAchieveInfo2 achieveInfo = CAchieveInfo2.GetAchieveInfo(detailInfo.iLogicWorldId, detailInfo.ullUid, false); achieveInfo.OnServerAchieveInfo(detailInfo.astShowAchievement, detailInfo.dwAchieveMentScore); this._trophyRewardInfoLevel = achieveInfo.LastDoneTrophyRewardInfo.Cfg.dwTrophyLvl; this._trophyRank = achieveInfo.GetWorldRank(); Array.Copy(achieveInfo.SelectedTrophies, this._selectedTrophies, achieveInfo.SelectedTrophies.Length); this._mentorInfo = Utility.DeepCopyByReflection <COMDT_ACNT_MASTER_INFO>(detailInfo.stAcntMasterInfo); }
public void Draw(CUIFormScript form) { if (form == null) { return; } GameObject widget = form.GetWidget(9); if (widget == null) { return; } Utility.FindChild(widget, "pnlHonorInfo").CustomSetActive(true); GameObject gameObject = Utility.FindChild(widget, "pnlHonorInfo/pnlContainer/HonorList"); if (gameObject == null) { return; } CUIListScript component = gameObject.GetComponent <CUIListScript>(); if (component == null) { return; } Singleton <CUIEventManager> .GetInstance().RemoveUIEventListener(enUIEventID.Player_Info_Honor_Item_Enable, new CUIEventManager.OnUIEventHandler(this.OnHonorItemEnable)); Singleton <CUIEventManager> .GetInstance().RemoveUIEventListener(enUIEventID.Player_Info_Honor_Select_Change, new CUIEventManager.OnUIEventHandler(this.OnHonorSelectChange)); Singleton <CUIEventManager> .GetInstance().RemoveUIEventListener(enUIEventID.Player_Info_Honor_Chosen, new CUIEventManager.OnUIEventHandler(this.OnHonorChosen)); Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Player_Info_Honor_Item_Enable, new CUIEventManager.OnUIEventHandler(this.OnHonorItemEnable)); Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Player_Info_Honor_Select_Change, new CUIEventManager.OnUIEventHandler(this.OnHonorSelectChange)); Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Player_Info_Honor_Chosen, new CUIEventManager.OnUIEventHandler(this.OnHonorChosen)); this.m_honorInfoList.Clear(); CPlayerProfile profile = Singleton <CPlayerInfoSystem> .GetInstance().GetProfile(); Dictionary <int, COMDT_HONORINFO> honorDic = profile.GetHonorDic(); int selectedHonorId = profile.GetSelectedHonorId(); Dictionary <int, COMDT_HONORINFO> .Enumerator enumerator = honorDic.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <int, COMDT_HONORINFO> current = enumerator.get_Current(); COMDT_HONORINFO value = current.get_Value(); if (value != null) { this.m_honorInfoList.Add(value); } } if (this.m_honorInfoList != null) { this.m_honorInfoList.Sort(delegate(COMDT_HONORINFO l, COMDT_HONORINFO r) { if (l == null) { return(1); } if (r == null) { return(-1); } return(l.iHonorID.CompareTo(r.iHonorID)); }); } component.SetElementAmount(this.m_honorInfoList.get_Count()); component.SelectElement(-1, false); COMDT_HONORINFO honorInfo = null; honorDic.TryGetValue(selectedHonorId, ref honorInfo); this.UpdateSelectedHonor(form, honorInfo); }
public void ConvertServerDetailData(CSDT_ACNT_DETAIL_INFO detailInfo) { this.ResetData(); this._doubleKillCount = 0; this._trippleKillCount = 0; this._quataryKillCount = 0; this._pentaKillCount = 0; this._holyShitCount = 0; this._mvpCnt = 0; this._loseMvpCount = 0; if (detailInfo != null) { this._playerName = StringHelper.UTF8BytesToString(ref detailInfo.szAcntName); this.m_personSign = StringHelper.UTF8BytesToString(ref detailInfo.szSignatureInfo); this.m_uuid = detailInfo.ullUid; this.m_iLogicWorldId = detailInfo.iLogicWorldId; this.m_vipInfo = new SCPKG_GAME_VIP_NTF(); this.m_vipInfo.stGameVipClient = detailInfo.stGameVip; this._playerHeadUrl = Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(ref detailInfo.szOpenUrl); this._playerLevel = detailInfo.dwLevel; ResAcntExpInfo dataByKey = GameDataMgr.acntExpDatabin.GetDataByKey(this._playerLevel); this._playerNeedExp = dataByKey.dwNeedExp; this._playerExp = detailInfo.dwExp; this.creditScore = detailInfo.dwCreditValue; this._power = detailInfo.dwPower; this._pvpLevel = detailInfo.dwPvpLevel; this._playerPvpExp = detailInfo.dwPvpExp; this._gender = (COM_SNSGENDER)detailInfo.bGender; this._privilegeType = (COM_PRIVILEGE_TYPE)detailInfo.bPrivilege; this._rankGrade = detailInfo.bGradeOfRank; this._rankHistoryHighestGrade = detailInfo.bMaxGradeOfRank; this._rankClass = detailInfo.dwCurClassOfRank; this._rankHistoryHighestClass = detailInfo.stRankInfo.dwTopClassOfRank; this.GuildName = StringHelper.UTF8BytesToString(ref detailInfo.stGuildInfo.szGuildName); this.GuildState = (COM_PLAYER_GUILD_STATE)detailInfo.stGuildInfo.bGuildState; this.qqVipMask = detailInfo.dwQQVIPMask; for (int i = 0; i < detailInfo.stStatistic.stKVDetail.dwNum; i++) { COMDT_STATISTIC_KEY_VALUE_INFO comdt_statistic_key_value_info = detailInfo.stStatistic.stKVDetail.astKVDetail[i]; switch (((RES_STATISTIC_SETTLE_DATA_TYPE)comdt_statistic_key_value_info.dwKey)) { case RES_STATISTIC_SETTLE_DATA_TYPE.RES_STATISTIC_SETTLE_DATA_TYPE_MVP_CNT: this._mvpCnt = (int)comdt_statistic_key_value_info.dwValue; break; case RES_STATISTIC_SETTLE_DATA_TYPE.RES_STATISTIC_SETTLE_DATA_TYPE_LOSE_SOUL: this._loseMvpCount = (int)comdt_statistic_key_value_info.dwValue; break; case RES_STATISTIC_SETTLE_DATA_TYPE.RES_STATISTIC_SETTLE_DATA_TYPE_GODLIKE_CNT: this._holyShitCount = (int)comdt_statistic_key_value_info.dwValue; break; case RES_STATISTIC_SETTLE_DATA_TYPE.RES_STATISTIC_SETTLE_DATA_TYPE_DOUBLE_KILL_CNT: this._doubleKillCount = (int)comdt_statistic_key_value_info.dwValue; break; case RES_STATISTIC_SETTLE_DATA_TYPE.RES_STATISTIC_SETTLE_DATA_TYPE_TRIPLE_KILL_CNT: this._trippleKillCount = (int)comdt_statistic_key_value_info.dwValue; break; case RES_STATISTIC_SETTLE_DATA_TYPE.RES_STATISTIC_SETTLE_DATA_TYPE_QUATARY_KILL_CNT: this._quataryKillCount = (int)comdt_statistic_key_value_info.dwValue; break; case RES_STATISTIC_SETTLE_DATA_TYPE.RES_STATISTIC_SETTLE_DATA_TYPE_PENTA_KILL_CNT: this._pentaKillCount = (int)comdt_statistic_key_value_info.dwValue; break; } } this._5V5TotalCount = (int)detailInfo.stStatistic.stFiveVsFiveInfo.dwTotalNum; this._5V5WinCount = (int)detailInfo.stStatistic.stFiveVsFiveInfo.dwWinNum; this._3V3TotalCount = (int)detailInfo.stStatistic.stThreeVsThreeInfo.dwTotalNum; this._3V3WinCount = (int)detailInfo.stStatistic.stThreeVsThreeInfo.dwWinNum; this._2V2TotalCount = (int)detailInfo.stStatistic.stTwoVsTwoInfo.dwTotalNum; this._2V2WinCount = (int)detailInfo.stStatistic.stTwoVsTwoInfo.dwWinNum; this._1V1TotalCount = (int)detailInfo.stStatistic.stOneVsOneInfo.dwTotalNum; this._1V1WinCount = (int)detailInfo.stStatistic.stOneVsOneInfo.dwWinNum; this._vsAiTotalCount = (int)detailInfo.stStatistic.stVsMachineInfo.dwTotalNum; this._vsAiWinCount = (int)detailInfo.stStatistic.stVsMachineInfo.dwWinNum; this._rankTotalCount = (int)detailInfo.stStatistic.stLadderInfo.dwTotalNum; this._rankWinCount = (int)detailInfo.stStatistic.stLadderInfo.dwWinNum; this._entertainmentTotalCount = (int)detailInfo.stStatistic.stEntertainmentInfo.dwTotalNum; this._entertainmentWinCount = (int)detailInfo.stStatistic.stEntertainmentInfo.dwWinNum; this._heroCnt = (int)detailInfo.stMostUsedHero.dwTotalHeroNum; this._skinCnt = (int)detailInfo.stMostUsedHero.dwTotalSkinNum; this._isOnLine = detailInfo.bIsOnline != 0; if (this._mostUsedHeroList == null) { this._mostUsedHeroList = new ListView <COMDT_MOST_USED_HERO_INFO>(); } else { this._mostUsedHeroList.Clear(); } int num2 = (int)Mathf.Min((float)detailInfo.stMostUsedHero.dwHeroNum, (float)detailInfo.stMostUsedHero.astHeroInfoList.Length); for (int j = 0; j < num2; j++) { this._mostUsedHeroList.Add(detailInfo.stMostUsedHero.astHeroInfoList[j]); } this.SortMostUsedHeroList(); if ((detailInfo.stHonorInfo == null) || (detailInfo.stHonorInfo.bHonorCnt < 6)) { Singleton <CRoleInfoManager> .instance.InsertHonorOnDuplicateUpdate(ref this._honorDic, 1, 0); Singleton <CRoleInfoManager> .instance.InsertHonorOnDuplicateUpdate(ref this._honorDic, 2, 0); Singleton <CRoleInfoManager> .instance.InsertHonorOnDuplicateUpdate(ref this._honorDic, 6, 0); Singleton <CRoleInfoManager> .instance.InsertHonorOnDuplicateUpdate(ref this._honorDic, 4, 0); Singleton <CRoleInfoManager> .instance.InsertHonorOnDuplicateUpdate(ref this._honorDic, 5, 0); Singleton <CRoleInfoManager> .instance.InsertHonorOnDuplicateUpdate(ref this._honorDic, 3, 0); } if (detailInfo.stHonorInfo != null) { for (int k = 0; k < detailInfo.stHonorInfo.bHonorCnt; k++) { COMDT_HONORINFO comdt_honorinfo = detailInfo.stHonorInfo.astHonorInfo[k]; switch (comdt_honorinfo.iHonorID) { case 1: case 2: case 3: case 4: case 5: case 6: Singleton <CRoleInfoManager> .instance.InsertHonorOnDuplicateUpdate(ref this._honorDic, comdt_honorinfo.iHonorID, comdt_honorinfo.iHonorPoint); break; } } COMDT_HONORINFO comdt_honorinfo2 = new COMDT_HONORINFO(); if (this._honorDic.TryGetValue(detailInfo.stHonorInfo.iCurUseHonorID, out comdt_honorinfo2)) { if (comdt_honorinfo2.iHonorLevel > 0) { this._selectedHonorId = detailInfo.stHonorInfo.iCurUseHonorID; } else { this._selectedHonorId = 0; } } } this._geiLiDuiYou = (int)detailInfo.stLikeNum.dwTeammateNum; this._keJingDuiShou = (int)detailInfo.stLikeNum.dwOpponentNum; this._haveExtraCoin = false; this._haveExtraExp = false; } }
public void UpdateSelectedHonor(CUIFormScript form, COMDT_HONORINFO honorInfo) { CTextManager instance = Singleton <CTextManager> .GetInstance(); string text = instance.GetText("Player_Info_Honor_Btn_Using"); string text2 = instance.GetText("Player_Info_Honor_Btn_Use"); string text3 = instance.GetText("Player_Info_Honor_Btn_Browse"); GameObject widget = form.GetWidget(9); if (widget == null) { return; } Transform transform = form.transform.Find("pnlBg/pnlBody/pnlHonorInfo/pnlContainer/SelectedHonor/Button"); Button button = (transform == null) ? null : transform.GetComponent <Button>(); GameObject gameObject = Utility.FindChild(widget, "pnlHonorInfo/pnlContainer/SelectedHonor/CurrentHonor/normal"); GameObject gameObject2 = Utility.FindChild(widget, "pnlHonorInfo/pnlContainer/SelectedHonor/CurrentHonor/label"); GameObject gameObject3 = Utility.FindChild(widget, "pnlHonorInfo/pnlContainer/SelectedHonor/CurrentHonor/cnt"); GameObject gameObject4 = Utility.FindChild(widget, "pnlHonorInfo/pnlContainer/SelectedHonor/Text"); CPlayerProfile profile = Singleton <CPlayerInfoSystem> .GetInstance().GetProfile(); int selectedHonorId = profile.GetSelectedHonorId(); CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); bool flag = true; if (masterRoleInfo != null && masterRoleInfo.playerUllUID != profile.m_uuid) { flag = false; } if (honorInfo == null) { honorInfo = new COMDT_HONORINFO(); if (button != null) { CUICommonSystem.SetButtonEnableWithShader(button, false, true); CUICommonSystem.SetButtonName(transform.gameObject, text2); } if (gameObject != null) { this.SetHonorImage(gameObject.transform, honorInfo); } if (gameObject2 != null) { this.SetHonorName(gameObject2.transform, honorInfo); } if (gameObject3 != null) { this.SetHonorPoint(gameObject3.transform, honorInfo); } if (gameObject4 != null) { this.SetHonorDesc(gameObject4.transform, honorInfo); } if (!flag && button != null) { CUICommonSystem.SetButtonEnableWithShader(button, false, true); CUICommonSystem.SetButtonName(transform.gameObject, text3); return; } return; } else { if (gameObject != null) { this.SetHonorImage(gameObject.transform, honorInfo); } if (gameObject2 != null) { this.SetHonorName(gameObject2.transform, honorInfo); } if (gameObject3 != null) { this.SetHonorPoint(gameObject3.transform, honorInfo); } if (gameObject4 != null) { this.SetHonorDesc(gameObject4.transform, honorInfo); } if (!flag && button != null) { CUICommonSystem.SetButtonEnableWithShader(button, false, true); CUICommonSystem.SetButtonName(transform.gameObject, text3); return; } if (honorInfo.iHonorID == selectedHonorId && honorInfo.iHonorID != 0) { if (button != null) { CUICommonSystem.SetButtonEnableWithShader(button, false, true); CUICommonSystem.SetButtonName(transform.gameObject, text); } } else if (honorInfo.iHonorLevel <= 0) { if (button != null) { CUICommonSystem.SetButtonEnableWithShader(button, false, true); CUICommonSystem.SetButtonName(transform.gameObject, text2); } } else if (button != null) { CUICommonSystem.SetButtonEnableWithShader(button, true, true); CUICommonSystem.SetButtonName(transform.gameObject, text2); } return; } }