Ejemplo n.º 1
0
        //接收上周学徒榜数据
        public void OnRecvRequestLastWeekPrenticeRankData(IntPtr ptr, int nLen)
        {
            IntPtrVaArgParseHelper    helper = new IntPtrVaArgParseHelper(ptr, nLen);
            cmd_Entity_Rank_Info_head head   = helper.get <cmd_Entity_Rank_Info_head>();

            LastWeekPrenticeChartList.AllDataList.Clear();
            for (int i = 0; i < head.nCount; i++)
            {
                cmd_entity_mentorship_order_info data = helper.get <cmd_entity_mentorship_order_info>();
                //如果有自己数据,存一下排名
                if (EntityFactory.MainHeroView != null && EntityFactory.MainHeroView.Property != null)
                {
                    if (data.dwPDBID == EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_ID))
                    {
                        LastWeekPrenticeChartList.PersonalRank = data.nOrder;
                    }
                }
                LastWeekPrenticeChartList.AllDataList.Add(data);
            }
            if (LastWeekPrenticeChartList.AllDataList.Count > 0)
            {
                LastWeekPrenticeChartList.LastScore = (int)LastWeekPrenticeChartList.AllDataList[head.nCount - 1].dwShipVal;
            }
            UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_RECVREQUESTLASTWEEKPRENTICECHARTDATA, null);
        }
Ejemplo n.º 2
0
        public void SetData(cmd_entity_mentorship_order_info info)
        {
            index.text = info.nOrder.ToString();

            playerName.text = info.szName;
            score.text      = info.dwShipVal.ToString();

            sexIcon.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_KinSex, WndID.WND_ID_CHART, (int)info.bySex + 1);
            sexIcon.gameObject.SetActive(true);

            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_KIN) == info.dwPDBID)
                    {
                        bSelfItem        = true;
                        borderImg.sprite = borderList[1];
                    }
                }
            }

            Color txtColor = bTop3 ? top3TextColor[info.nOrder - 1] : Color.white;

            index.color      = txtColor;
            playerName.color = txtColor;
            score.color      = txtColor;
        }