public void SetData(cmd_entity_herocount_order_info info) { index.text = info.nOrder.ToString(); playerName.text = info.szName; number.text = info.dwHeroCount.ToString(); sexIcon.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_KinSex, WndID.WND_ID_CHART, (int)info.bySex + 1); sexIcon.gameObject.SetActive(true); if (popupMenuHandle == null) { popupMenuHandle = this.gameObject.AddComponent <UPopupMenuHandle>(); } UPopupAction PopupAction = new UPopupAction(); PopupAction.Add(UPopupItemDataGetPlayerDetail.GetDescString(), new UPopupItemDataGetPlayerDetail(info.dwPDBID)); popupMenuHandle.HandlePopupAction = PopupAction; bool bTop3 = false; if (info.nOrder == 1 || info.nOrder == 2 || info.nOrder == 3) { bTop3 = true; indexIcon.gameObject.SetActive(true); indexIcon.sprite = top3IndexIcons[info.nOrder - 1]; index.gameObject.SetActive(false); } if (!U3D_Render.EntityView.isNullOrEmpty(EntityFactory.MainHeroView)) { if (EntityFactory.MainHeroView.Property) { if (EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_ID) == info.dwPDBID) { bSelfItem = true; borderImg.sprite = borderList[1]; } } } Color txtColor = bTop3 ? top3TextColor[info.nOrder - 1] : Color.white; index.color = txtColor; playerName.color = txtColor; number.color = txtColor; }
// 接收英雄数量榜数据 public void OnRecvRequestHeroCountRankData(IntPtr ptr, int nLen) { IntPtrVaArgParseHelper helper = new IntPtrVaArgParseHelper(ptr, nLen); cmd_Entity_Rank_Info_head cmdHead = helper.get <cmd_Entity_Rank_Info_head>(); HeroCountChartList.AllDataList.Clear(); HeroCountChartList.FriendDataList.Clear(); HeroCountChartList.ClanMemberDataList.Clear(); for (int i = 0; i < cmdHead.nCount; ++i) { cmd_entity_herocount_order_info cmdNode = helper.get <cmd_entity_herocount_order_info>(); // 如果有自己数据,存一下排名 if (EntityFactory.MainHeroView != null && EntityFactory.MainHeroView.Property != null) { if (cmdNode.dwPDBID == EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_ID)) { HeroCountChartList.PersonalRank = cmdNode.nOrder; } int m_clanID = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_CLAN); if (m_clanID > 0 && m_clanID == (int)cmdNode.dwClanID) { HeroCountChartList.ClanMemberDataList.Add(cmdNode); } } if (LogicDataCenter.snsDataManager.isBuddyRelation((int)cmdNode.dwUserID)) { HeroCountChartList.FriendDataList.Add(cmdNode); } HeroCountChartList.AllDataList.Add(cmdNode); } if (HeroCountChartList.AllDataList.Count > 0) { HeroCountChartList.LastScore = HeroCountChartList.AllDataList[cmdHead.nCount - 1].dwHeroCount; } UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_RECVREQUESTHEROCOUNTCHARTDATA, null); }