Пример #1
0
    /// <summary>
    /// 填充面板
    /// </summary>
    private void FillPanel()
    {
        //Debug.Log("刷新界面.................." + m_TeamProxy.GetMembersList().Count);
        int pageIndex   = State.GetPageIndex();
        int filterIndex = State.GetPageCategoryIndex(State.GetPageIndex());

        m_SocialSubClass = (SocialSubClass)filterIndex;
        m_SocialType     = (SocialType)pageIndex;
        List <FriendInfoVO> list         = new List <FriendInfoVO>();
        List <FriendInfoVO> volistNearby = new List <FriendInfoVO>();

        ClearData();
        UIViewCategory category = State.GetPageCategoryData();

        switch (m_SocialType)
        {
        case SocialType.Team:
            m_TeamProxy.SortMembers();
            AddTeamDataToView(m_TeamProxy.GetMembersList());
            // SetRightLabelCapacity(0, m_TeamProxy.GetMembersList().Count, m_TeamProxy.MEMBERCOUNTLIMIT);
            break;

        case SocialType.Friend:
            if (category.IsAll)
            {
                list.Clear();
                UIViewPage page = State.GetPage();
                for (int i = 0; i < page.Categorys.Length; i++)
                {
                    if (page.Categorys[i].IsAll)
                    {
                        continue;
                    }
                    category = page.Categorys[i];
                    if ((SocialSubClass)category.Arguments[0] == SocialSubClass.First)
                    {
                        for (int j = 0; j < m_FriendProxy.GetFriendList().Count; j++)
                        {
                            if (m_FriendProxy.GetFriendList()[j].Status == FriendState.ONLINE)
                            {
                                list.Add(m_FriendProxy.GetFriendList()[j]);
                            }
                        }
                        AddFriendDataToView(list, category.Label);
                        list.Clear();
                    }
                    else if ((SocialSubClass)category.Arguments[0] == SocialSubClass.Second)
                    {
                        for (int k = 0; k < m_FriendProxy.GetFriendList().Count; k++)
                        {
                            if (m_FriendProxy.GetFriendList()[k].Status == FriendState.LEAVE)
                            {
                                list.Add(m_FriendProxy.GetFriendList()[k]);
                            }
                        }
                        AddFriendDataToView(list, category.Label);
                        list.Clear();
                    }
                }
            }
            else
            {
                list.Clear();
                switch ((SocialSubClass)category.Arguments[0])
                {
                case SocialSubClass.First:
                    for (int i = 0; i < m_FriendProxy.GetFriendList().Count; i++)
                    {
                        if (m_FriendProxy.GetFriendList()[i].Status == FriendState.ONLINE)
                        {
                            list.Add(m_FriendProxy.GetFriendList()[i]);
                        }
                    }
                    break;

                case SocialSubClass.Second:
                    list.Clear();
                    for (int i = 0; i < m_FriendProxy.GetFriendList().Count; i++)
                    {
                        if (m_FriendProxy.GetFriendList()[i].Status == FriendState.LEAVE)
                        {
                            list.Add(m_FriendProxy.GetFriendList()[i]);
                        }
                    }
                    break;

                case SocialSubClass.Blacklist:
                    for (int i = 0; i < m_FriendProxy.GetBlackList().Count; i++)
                    {
                        list.Add(m_FriendProxy.GetBlackList()[i]);
                    }
                    break;

                default:
                    break;
                }
                AddFriendDataToView(list, category.Label);
            }
            break;

        case SocialType.Ship:
            list.Clear();
            //SetRightLabelCapacity(2, 0, 0);
            //m_IsOpenTips = false;
            List <FriendInfoVO> listShip = new List <FriendInfoVO>();
            list = listShip;
            AddFriendDataToView(list, null);
            // UIManager.Instance.ClosePanel(PanelName.TipsFriendPanel);
            // SetActiveNullTips(true);
            break;

        case SocialType.Other:
            if (category.IsAll)
            {
                list.Clear();
                UIViewPage page = State.GetPage();
                for (int i = 0; i < page.Categorys.Length; i++)
                {
                    if (page.Categorys[i].IsAll)
                    {
                        continue;
                    }
                    category = page.Categorys[i];
                    if ((SocialSubClass)category.Arguments[0] == SocialSubClass.First)
                    {
                        volistNearby = m_FriendProxy.GetNearbyList();
                        for (int j = 0; j < volistNearby.Count; j++)
                        {
                            list.Add(volistNearby[j]);
                        }
                    }
                    else if ((SocialSubClass)category.Arguments[0] == SocialSubClass.Second)
                    {
                        for (int k = 0; k < m_FriendProxy.GetRecentList().Count; k++)
                        {
                            list.Add(m_FriendProxy.GetRecentList()[k]);
                        }
                    }
                    AddFriendDataToView(list, category.Label);
                    list.Clear();
                }
            }
            else
            {
                list.Clear();
                switch ((SocialSubClass)category.Arguments[0])
                {
                case SocialSubClass.First:
                    volistNearby = m_FriendProxy.GetNearbyList();
                    for (int i = 0; i < volistNearby.Count; i++)
                    {
                        list.Add(volistNearby[i]);
                    }
                    break;

                case SocialSubClass.Second:
                    list.Clear();
                    for (int i = 0; i < m_FriendProxy.GetRecentList().Count; i++)
                    {
                        list.Add(m_FriendProxy.GetRecentList()[i]);
                    }
                    break;

                default:
                    break;
                }
                AddFriendDataToView(list, category.Label);
            }
            break;

        default:
            break;
        }
        //State.SetPageLabel(string.Format(GetLocalization("package_title_1008"), 0, 100));
        RefreshHotKey();
    }
Пример #2
0
    /// <summary>
    /// 填充面板
    /// </summary>
    private void FillPanel()
    {
        int count;

        //Debug.LogError("刷新hud ");
        if (m_TeamProxy.GetMembersList() != null)
        {
            List <TeamMemberVO> datas = m_TeamProxy.GetMembersList();
            m_TeamProxy.SortMembers();
            count = datas.Count;
            for (int i = 0; i < count; i++)
            {
                m_TeamContents[i].gameObject.SetActive(true);
                m_TypeIsAlive[i].SetActive(false);
                m_TypeOnLine[i].SetActive(false);
                m_TeamNameLabel[i].text = datas[i].Name;
                if (datas[i].MaxHP == 0)
                {
                    datas[i].MaxHP = 1;
                }
                if (datas[i].MaxDefense == 0)
                {
                    datas[i].MaxDefense = 1;
                }
                //if (datas[i].HP<=0)
                //{
                //	datas[i].IsDead = true;
                //}
                Debug.Log("HP------" + datas[i].HP + datas[i].Name);
                m_TeamHPSlider[i].value      = datas[i].HP * 1.0f / datas[i].MaxHP;
                m_TeamDefenseSlider[i].value = datas[i].Defense * 1.0f / datas[i].MaxDefense;
                m_TeamCanvasGroup[i].alpha   = 1f;
                if (datas[i].IsDead)
                {
                    //Debug.Log("dead------" + datas[i].Name);
                    m_TeamCanvasGroup[i].alpha   = m_Alpha;
                    m_TeamHPSlider[i].value      = 1;
                    m_TeamDefenseSlider[i].value = 1;
                    m_TypeIsAlive[i].SetActive(true);
                    m_TypeOnLine[i].SetActive(false);
                }
                else
                {
                    //Debug.LogError(datas[i].HP+"huozhe------" + datas[i].Name);
                }
                if (!m_FriendProxy.NearbyList(datas[i].UID) && datas[i].UID != m_ServerListProxy.GetCurrentCharacterVO().UId)
                {
                    //Debug.Log("yuanli------" + datas[i].Name);
                    m_TeamCanvasGroup[i].alpha   = m_Alpha;
                    m_TeamHPSlider[i].value      = 1;
                    m_TeamDefenseSlider[i].value = 1;
                    m_TypeIsAlive[i].SetActive(false);
                    m_TypeOnLine[i].SetActive(false);
                }
                if (!datas[i].IsOnline)                 //todo 离线
                {
                    //Debug.Log("xiaxian------" + datas[i].Name);
                    m_TeamCanvasGroup[i].alpha = m_Alpha;
                    m_TypeIsAlive[i].SetActive(false);
                    m_TypeOnLine[i].SetActive(true);
                }
                if (datas[i].UID == m_ServerListProxy.GetCurrentCharacterVO().UId)
                {
                    CfgEternityProxy cfgEternityProxy = GameFacade.Instance.RetrieveProxy(ProxyName.CfgEternityProxy) as CfgEternityProxy;
                    if (!cfgEternityProxy.IsSpace())
                    {
                        datas[i].IsDead              = false;
                        m_TeamCanvasGroup[i].alpha   = 1f;
                        m_TeamHPSlider[i].value      = 1;
                        m_TeamDefenseSlider[i].value = 1;
                        m_TypeIsAlive[i].SetActive(false);
                        m_TypeOnLine[i].SetActive(false);
                    }
                }
                else
                {
                    CfgEternityProxy cfgEternityProxy = GameFacade.Instance.RetrieveProxy(ProxyName.CfgEternityProxy) as CfgEternityProxy;
                    if (!cfgEternityProxy.IsSpace())
                    {
                        m_FriendProxy.GetNearbyList();
                        if (m_FriendProxy.GetNearby(datas[i].UID) != null)
                        {
                            datas[i].IsDead              = false;
                            m_TeamCanvasGroup[i].alpha   = 1f;
                            m_TeamHPSlider[i].value      = 1;
                            m_TeamDefenseSlider[i].value = 1;
                            m_TypeIsAlive[i].SetActive(false);
                            m_TypeOnLine[i].SetActive(false);
                        }
                    }
                }
            }

            for (int i = count; i < m_TeamProxy.MEMBERCOUNTLIMIT; i++)
            {
                m_TeamContents[i].gameObject.SetActive(false);
            }
        }
        else
        {
            for (int i = 0; i < m_TeamProxy.MEMBERCOUNTLIMIT; i++)
            {
                m_TeamContents[i].gameObject.SetActive(false);
            }
        }
    }