private void AddMemberListToPanel(List <CommunityMember> memberList)
        {
            this.ClearContentPanel();
            if (!this.m_filterOffline)
            {
                memberList = this.FilterByPresence(memberList);
            }
            if (this.m_alphabeticalOrdering)
            {
                memberList = this.SortListAlphabetically(memberList);
            }
            else
            {
                memberList = memberList.OrderBy((CommunityMember member) => member, CommunityRosterDialog.Sorter).ToList <CommunityMember>();
            }
            GameObject          gameObject = this.AddChildToObject(this.m_contentPanel, this.m_rosterItemPagePrefab);
            CommunityRosterPage component  = gameObject.GetComponent <CommunityRosterPage>();

            foreach (CommunityMember member2 in memberList)
            {
                if (component.AtCapacity())
                {
                    gameObject = this.AddChildToObject(this.m_contentPanel, this.m_rosterItemPagePrefab);
                    component  = gameObject.GetComponent <CommunityRosterPage>();
                }
                component.AddMemberToRoster(member2);
            }
            Canvas.ForceUpdateCanvases();
            AutoCenterScrollRect componentInChildren  = base.GetComponentInChildren <AutoCenterScrollRect>();
            ScrollRect           componentInChildren2 = base.GetComponentInChildren <ScrollRect>();

            if (componentInChildren != null && componentInChildren2 != null)
            {
                componentInChildren2.horizontalNormalizedPosition = 0f;
                componentInChildren.ForceSetCenteredItemIndex(0);
            }
        }
示例#2
0
        private void AddMemberListToPanel(List <CommunityMember> memberList)
        {
            this.ClearContentPanel();
            if (!this.m_showOffline)
            {
                memberList = this.FilterByPresence(memberList);
            }
            if (this.m_alphabeticalOrdering)
            {
                memberList = this.SortListAlphabetically(memberList);
            }
            GameObject          obj       = this.AddChildToObject(this.m_contentPanel, this.m_rosterItemPagePrefab);
            CommunityRosterPage component = obj.GetComponent <CommunityRosterPage>();

            foreach (CommunityMember communityMember in memberList)
            {
                if (component.AtCapacity())
                {
                    obj       = this.AddChildToObject(this.m_contentPanel, this.m_rosterItemPagePrefab);
                    component = obj.GetComponent <CommunityRosterPage>();
                }
                component.AddMemberToRoster(communityMember);
            }
        }