Beispiel #1
0
        //接收英雄王者榜数据
        public void OnRecvRequestKingOfHeroRankData(IntPtr ptr, int nLen)
        {
            IntPtrVaArgParseHelper    helper  = new IntPtrVaArgParseHelper(ptr, nLen);
            cmd_Entity_Rank_Info_head cmdHead = helper.get <cmd_Entity_Rank_Info_head>();

            KingOfHeroChartList.AllDataList.Clear();
            for (int i = 0; i < cmdHead.nCount; ++i)
            {
                cmd_entity_king_of_hero_order_info cmdNode = helper.get <cmd_entity_king_of_hero_order_info>();
                KingOfHeroChartList.AllDataList.Add(cmdNode);
            }

            UIMsgCmdData uiMsgData = new UIMsgCmdData((int)WndMsgID.WND_MSG_RECVREQUEST_KING_OF_HERO_CHARTDATA, cmdHead.nOtherCondition, "", IntPtr.Zero, 0);

            UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_RECVREQUEST_KING_OF_HERO_CHARTDATA, uiMsgData);
        }
Beispiel #2
0
        public void SetData(cmd_entity_king_of_hero_order_info info)
        {
            index.text = info.nOrderID.ToString();

            playerName.text = info.szName;

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

            winRate.text = Math.Round((float)info.nWinMatch / (float)info.nTotalMatch * 100, 1).ToString() + "%";

            rankIcon.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_RankImage, WndID.WND_ID_CHART, 2, info.nRankIconID);
            rankIcon.gameObject.SetActive(true);
            rank.text       = info.szGradeName;
            detailData.text = info.nWinMatch + "/" + info.nTotalMatch;

            if (popupMenuHandle == null)
            {
                popupMenuHandle = this.gameObject.AddComponent <UPopupMenuHandle>();
            }

            UPopupAction PopupAction = new UPopupAction();

            PopupAction.Add(UPopupItemDataGetPlayerDetail.GetDescString(), new UPopupItemDataGetPlayerDetail((int)info.nPDBID));

            popupMenuHandle.HandlePopupAction = PopupAction;

            bool bTop3 = false;

            if (info.nOrderID == 1 || info.nOrderID == 2 || info.nOrderID == 3)
            {
                bTop3 = true;
                indexIcon.gameObject.SetActive(true);
                indexIcon.sprite = top3IndexIcons[info.nOrderID - 1];
                index.gameObject.SetActive(false);
            }

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

            index.color      = txtColor;
            playerName.color = txtColor;
            winRate.color    = txtColor;
            rank.color       = txtColor;
            detailData.color = txtColor;
        }