Beispiel #1
0
        public void SetData(cmd_legendcup_recv_regist_memberlistnode memeberNode)
        {
            KinMemberName.text  = memeberNode.szActorName;
            KinMemberLevel.text = memeberNode.nActorLevel.ToString();

            if (memeberNode.nRankIconId != 0)
            {
                KinMemberRank.gameObject.SetActive(true);
                KinMemberRank.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_RankImage, WndID.WND_ID_LEGENDCUP_REGIST, 1, memeberNode.nRankIconId);
            }
            else
            {
                KinMemberRank.gameObject.SetActive(false);
            }

            if (memeberNode.nActorSex < (int)PERSON_SEX.SEX_MAX && memeberNode.nActorSex >= (int)PERSON_SEX.SEX_MALE)
            {
                KinMemberSex.gameObject.SetActive(true);
                KinMemberSex.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_KinSex, WndID.WND_ID_LEGENDCUP_REGIST, memeberNode.nActorSex + 1);
            }
            else
            {
                KinMemberSex.gameObject.SetActive(false);
            }

            // 添加右键弹窗
            this.gameObject.RemoveComponent <UPopupMenuHandle>();
            UPopupMenuHandle popupMenuHandle = this.gameObject.AddComponent <UPopupMenuHandle>();

            if (popupMenuHandle != null)
            {
                UPopupAction popupAction = new UPopupAction();
                popupAction.Add(UPopupItemDataGetPlayerDetail.GetDescString(), new UPopupItemDataGetPlayerDetail((int)memeberNode.nPDBID));
                popupAction.Add(UPopupItemDataAddFriend.GetDescString(), new UPopupItemDataAddFriend(memeberNode.uDBID, memeberNode.szActorName));
                popupAction.Add(UPopupItemDataAddBlackList.GetDescString(), new UPopupItemDataAddBlackList(memeberNode.uDBID, memeberNode.szActorName));
                popupAction.Add(UPopupItemDataCopyName.GetDescString(), new UPopupItemDataCopyName(memeberNode.szActorName));
                popupAction.Add(UPopupItemDataPrivateChat.GetDescString(), new UPopupItemDataPrivateChat(memeberNode.szActorName));

                popupMenuHandle.HandlePopupAction = popupAction;
            }

            this.gameObject.SetActive(true);
        }
Beispiel #2
0
        public virtual void SetData(UListItemClanMember item)
        {
            if (DefalutBGSprite == null)
            {
                DefalutBGSprite = ComponentBG.sprite;
            }

            if (item.data.nSex < (int)PERSON_SEX.SEX_MAX && item.data.nSex >= (int)PERSON_SEX.SEX_MALE)
            {
                SexIcon.enabled = true;
                // 这里使用战队那边的,重复资源没必要再弄一份
                SexIcon.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_KinSex, WndID.WND_ID_SOCIALCONTACT, item.data.nSex + 1);
            }
            else
            {
                SexIcon.enabled = false;
            }
            actorName.text = item.data.szName;
            if ((item.data.nIdentity == (int)EMClanIdentity.EMCLANIDENTITY_SHAIKH) &&
                (LogicDataCenter.clanDataManager.ClanBaseData.nShaikhState == (int)EMClanShaikhState.ClanShaikhState_Outgoing))
            {
                actorName.text += "(卸任)";
            }

            job.text          = LogicDataCenter.clanDataManager.GetClanIdentityName(item.data.nIdentity);
            level.text        = item.data.nLevel.ToString();
            gaveThisWeek.text = item.data.nDonateThisWeek.ToString() + "/" + item.data.nDonateTotal;
            power.text        = item.data.dwBattleVal.ToString();
            rank.text         = item.data.dwBVOrder.ToString();
            if (Convert.ToInt32(item.data.dwBVOrder) <= (int)EMClanOrderMax.EMCLANORDERMAX)
            {
                rank.enabled    = false;
                rankImg.enabled = true;
                // 这里使用战队那边的,重复资源没必要再弄一份
                rankImg.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_KinBattleOrder, WndID.WND_ID_SOCIALCONTACT, item.data.dwBVOrder);
            }
            else
            {
                rank.enabled    = true;
                rankImg.enabled = false;
            }
            int nChangeOrder = item.data.dwLastOrder - item.data.dwBVOrder;

            if (item.data.dwLastOrder == 0)
            {
                nChangeOrder = 0;
            }
            sortChange.text = nChangeOrder.ToString();
            if (nChangeOrder >= 0)
            {
                changeImage.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_ClanRankChange, WndID.WND_ID_SOCIALCONTACT, 1);
                Color clr;
                ColorUtility.TryParseHtmlString("#fb8507", out clr);
                sortChange.color = clr;
            }
            else
            {
                changeImage.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_ClanRankChange, WndID.WND_ID_SOCIALCONTACT, 2);
                Color clr;
                ColorUtility.TryParseHtmlString("#71bf81", out clr);
                sortChange.color = clr;
            }
            grade.text   = item.data.szGrade;
            kinName.text = item.data.szKinName;

            int    nGameState    = item.data.nIsOnline == 0 ? (int)ACTOR_GAME_STATE.GAME_STATE_OFFLINE : item.data.nGameStatus;
            string strStateColor = UDefines.GetGameStateColor(nGameState);
            string strStateDesc  = UDefines.GetGameStateDesc(nGameState);

            status.text = String.Format("<color=#{0}>{1}</color>", strStateColor, ULocalizationService.Instance.Get("UIView", "Common", strStateDesc));

            if (item.data.nIsOnline > 0)
            {
                Color clr;
                ColorUtility.TryParseHtmlString("#FFFFFF", out clr);
                actorName.color    = clr;
                job.color          = clr;
                level.color        = clr;
                gaveThisWeek.color = clr;
                power.color        = clr;
                rank.color         = clr;
                grade.color        = clr;
                kinName.color      = clr;
            }
            else
            {
                Color clr;
                ColorUtility.TryParseHtmlString("#adadad", out clr);
                status.color       = clr;
                actorName.color    = clr;
                job.color          = clr;
                level.color        = clr;
                gaveThisWeek.color = clr;
                power.color        = clr;
                rank.color         = clr;
                grade.color        = clr;
                kinName.color      = clr;
            }

            m_nMemberID = item.data.nPDBID;

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

            int nHeroID    = 0;
            int nHeroKinID = 0;

            if (EntityFactory.MainHeroView != null)
            {
                nHeroID    = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_ID);
                nHeroKinID = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_KIN);

                m_bSelf = item.data.nPDBID == nHeroID ? true : false;
                // 设置显示图片
                setComponentBG(0);
            }

            if (m_nMemberID != nHeroID)
            {
                UPopupAction popupAction = new UPopupAction();
                popupAction.Add(UPopupItemDataTeamInvite.GetDescString(), new UPopupItemDataTeamInvite(m_nMemberID));
                popupAction.Add(UPopupItemDataTeamRequest.GetDescString(), new UPopupItemDataTeamRequest(m_nMemberID));
                popupAction.Add(UPopupItemDataGetPlayerDetail.GetDescString(), new UPopupItemDataGetPlayerDetail(m_nMemberID));
                popupAction.Add(UPopupItemDataAddFriend.GetDescString(), new UPopupItemDataAddFriend(0, actorName.text));
                popupAction.Add(UPopupItemDataCopyName.GetDescString(), new UPopupItemDataCopyName(item.data.szName));
                if (item.data.nIsOnline > 0 && GameLogicAPI.isMainMap((int)item.data.dwSceneID))
                {
                    popupAction.Add(UPopupItemDataTransmitTo.GetDescString(), new UPopupItemDataTransmitTo((int)item.data.dwWorldID, (int)item.data.serverID, (int)item.data.dwSceneID));
                }

                if (item.data.nIdentity == (int)EMClanIdentity.EMCLANIDENTITY_ELDER)
                {
                    popupAction.Add(ULocalizationService.Instance.Get("UIView", "PopupMenu", "ClanSetLeader"), new UListComponentItemDataPopup(OnSetLeader));
                }

                if (item.data.nKinID != nHeroKinID)
                {
                    popupAction.Add(ULocalizationService.Instance.Get("UIView", "PopupMenu", "ClanKick"), new UListComponentItemDataPopup(OnKick));
                }

                popupMenuHandle.HandlePopupAction = popupAction;
            }
        }