Ejemplo n.º 1
0
        public void CreateItems(List <PanelElementDataModel> list, FriendBtnType type)
        {
            m_thisType = type;

            Clear();

            list.ApplyAllItem(p => {
                CreateItem(p, type);
            });

            //初始页数
            if (m_FriendList.Count == 0)
            {
                ItemPagerManager_Friend.InitPager(1, 1, 0);
            }
            else
            {
                ItemPagerManager_Friend.InitPager(m_FriendList.Count, 1, 0);
            }

            if (gameObject.activeInHierarchy)
            {
                StartCoroutine("LateReposition");
            }
        }
Ejemplo n.º 2
0
        public void Init(SMsgRecvAnswerFriends_SC smsg, FriendBtnType type, Action <int> aciton)
        {
            m_FriendInfo     = smsg;
            m_callBackAction = aciton;
            for (int i = 0; i < ButtonInterface.Length; i++)
            {
                if (i == (int)type)
                {
                    ButtonInterface[i].SetActive(true);
                }
                else
                {
                    ButtonInterface[i].SetActive(false);
                }
            }
            var headRes = CommonDefineManager.Instance.CommonDefine.HeroIcon_MailFriend.FirstOrDefault(P => P.VocationID == smsg.dProfession && P.FashionID == smsg.dbSysActorImageHeadID);;

            if (headRes != null)
            {
                UI_Head.spriteName = headRes.ResName;
            }
            UI_Profession.spriteName = Team.SpriteName.PROFESSION_CHAR + smsg.dProfession.ToString();
            Label_Name.text          = smsg.Name;
            Label_Level.text         = LanguageTextManager.GetString("IDS_I22_38") + smsg.sActorLevel.ToString();
            Label_Combat.text        = smsg.dwFight.ToString();

            Tip_Unline.SetActive(smsg.bOnLine == 0);
        }
Ejemplo n.º 3
0
        private void CreateItem(PanelElementDataModel data, FriendBtnType type)
        {
            GameObject    item       = UI.CreatObjectToNGUI.InstantiateObj(FriendItemPrefab, Grid.transform);
            FriendItem_V3 friendItem = item.GetComponent <FriendItem_V3>();

            friendItem.Init(data.sMsgRecvAnswerFriends_SC, type, DeleteFriendItemCallBack);
            m_FriendList.Add(friendItem);
        }
Ejemplo n.º 4
0
        public void UpdateLabelNum(FriendBtnType type)
        {
            switch (type)
            {
            case FriendBtnType.MyFriend:
                Label_PeopleNum.text = m_FriendList.Count.ToString() + "/" + FriendDataManager.Instance.FriendMaxNum.ToString();
                break;

            case FriendBtnType.Request:
                Label_PeopleNum.text = m_FriendList.Count.ToString() + "/" + CommonDefineManager.Instance.CommonDefine.FriendRequestLimit.ToString();
                break;

            case FriendBtnType.Town:
                Label_PeopleNum.text = m_FriendList.Count.ToString();
                break;
            }
        }
Ejemplo n.º 5
0
    //显示子面板
    private void ShowChildPanel(FriendBtnType type)
    {
        m_curFriendChildPanelType = type;

        //开启关闭面板
        m_ChildPanelDict.ApplyAllItem(p => {
            if (p.Key == type)
            {
                p.Value.Show();
            }
            else
            {
                p.Value.Close();
            }
        });
        //切换按钮状态
        m_ButtonDict.ApplyAllItem(p => {
            if (p.Key == type)
            {
                p.Value.SetBoxCollider(false);
                p.Value.SetSwith(2);
            }
            else
            {
                p.Value.SetBoxCollider(true);
                p.Value.SetSwith(1);
            }
        });


        switch (type)
        {
        case FriendBtnType.Town:
            m_ChildPanelDict[FriendBtnType.Town].Clear();
            NetServiceManager.Instance.FriendService.SendNearbyPlayerRequst((uint)PlayerManager.Instance.FindHeroDataModel().ActorID);
            break;

        case FriendBtnType.MyFriend:
            ShowMyFriendList();
            break;

        case FriendBtnType.Request:
            ShowRequestList();
            break;
        }
    }