public override void OnRefresh(object msg) { base.OnRefresh(msg); NetworkManager.Instance.GetTeamController().GetTeamList(); //获取组队列表 m_FriendProxy.GetNearbyList(); FillPanel(); }
/// <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(); }