Exemplo n.º 1
0
        public void FilterSupportPlayer(IntPtr ptrParam, int nPtrLen)
        {
            if (nPtrLen <= 0)
            {
                return;
            }

            ClearMobaData();

            IntPtrVaArgParseHelper helper = new IntPtrVaArgParseHelper(ptrParam, nPtrLen);

            cmd_count countData = helper.get <cmd_count>();
            int       nCount    = countData.nCount;

            for (int i = 0; i < nCount; i++)
            {
                cmd_update_support_vote_person data = helper.get <cmd_update_support_vote_person>();
                m_dicPlayersSupportInfo[data.uPDBIU] = data;
            }

            SortPlayersSupportInfo();
            UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_WAR_FILTER_SUPPORT_PLAYER, null);
        }
Exemplo n.º 2
0
        public void SetData(cmd_update_support_vote_person data, int nPlayerCount)
        {
            if (data.uPDBIU <= 0)
            {
                return;
            }

            // 初始化标签轮盘
            WarLabelSelectItem labelItem = VoteButton.GetComponent <WarLabelSelectItem>();

            if (labelItem != null && labelItem.gameObject.activeSelf)
            {
                labelItem.Init(data.nVoteID, data.uPDBIU);
            }

            m_PDBIU = data.uPDBIU;

            // 计算玩家本次的点赞总数
            int nSupportNum = LogicDataCenter.labelDataManager.getPlayerSupportNum(m_PDBIU);

            if (parentsView)
            {
                VotePointImage.sprite = parentsView.GetSupportNumSprite(nSupportNum);
            }

            cmd_war_add_label lastLabel;
            int nLabelCount;
            // 当前玩家是否最新被点赞的玩家
            bool isLastPlayer = LogicDataCenter.labelDataManager.getLastPlayerLabel(m_PDBIU, out lastLabel, out nLabelCount);

            if (isLastPlayer)
            {
                // 播放标签特效
                loadLabelEffect(lastLabel, nLabelCount);
            }

            VotePointImage.SetNativeSize();
            VotePointImage.gameObject.SetActive(VotePointImage.sprite);
            SSchemeWarSupportPlayerConfig config = WarSupportPlayerConfigPage.Instance.GetWarSupportPlayerConfig(data.nVoteID);

            if (config != null)
            {
                VoteDescText.text = config.sVoteDesc;
                TitleImage.sprite = parentsView.GetSupportTitleSprite(config.nVoteIconID);
                TitleImage.gameObject.SetActive(TitleImage.sprite);
            }
            else
            {
                Debug.LogError(String.Format("GetWarSupportPlayerConfig failed. nVoteID={0},pdbid={1}", data.nVoteID, data.uPDBIU));
            }

            DataCenter.WarRecordTableDataManager.WarPersonInfo info = LogicDataCenter.recordTableDataManager.getWarPersonInfoByPDBID(data.uPDBIU);
            if (info == null)
            {
                return;
            }

            PlayerNameText.text = info.playerName;
            bool    bSameCamp     = info.nCamp == EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_CAMP);
            string  szColor       = bSameCamp ? "7BDBEDFF" : "FF3434FF";
            string  szEffectColor = bSameCamp ? "0072FF99" : "92000099";
            Color32 color         = ColorExtension.FromHex(szColor);
            Color32 effectcolor   = ColorExtension.FromHex(szEffectColor);

            PlayerNameText.color = color;
            PlayerNameText.gameObject.GetComponent <Outline>().effectColor = effectcolor;
            SSchemeWarSupportPositionConfig positionConfig = WarSupportPlayerConfigPage.Instance.GetWarSupportPositionConfig(data.nSortID, nPlayerCount);

            if (positionConfig == null)
            {
                return;
            }

            Vector3 oldAnchoredPosition = this.GetComponent <RectTransform>().anchoredPosition;

            this.GetComponent <RectTransform>().anchoredPosition = new Vector3(positionConfig.fUIPositionOffsetX, oldAnchoredPosition.y, oldAnchoredPosition.z);

            // 播放光效
            if (isLastPlayer)
            {
                DoEffect(m_PDBIU, bSameCamp, nSupportNum, data.nSortID);
            }

            // 播放音效
            if (isLastPlayer)
            {
                DoSound(nSupportNum);
            }
        }