GroupMembersPage
A class in Root.Township, Alta.Meta.UI.ServerManagement.
Client menu page listing a group's members, with kick and ban options and an invite-by-username field. A GroupPage in the server management UI.
- Listed in Menus, UI and platforms
- Inherits or implements
GroupPage
Constructors
| Member | What it is |
|---|---|
GroupMembersPage() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
7 private and internal fields
| Member | What it is |
|---|---|
private IAnalyticsService analyticsService | Analytics service used to report bans. |
private TextRenderer emptyListText | Text shown when the group has no members. |
private GroupMemberListElement groupMemberListElement | Prefab cloned for each member row. |
private InputField inviteField | Input field where the user types a username to invite. |
private PanelComponent invitesPanel | Outgoing invites panel, told to refresh after a new invite is sent. |
private TextRenderer tooManyMembersText | Text shown instead of the list when the group has more than 100 members. |
private UIList uiList | The list that holds the member rows. |
Methods
| Member | What it is |
|---|---|
void Inject(IAnalyticsService analyticsService) | VContainer injection point that supplies the analytics service. |
override async void RefreshData() | Hooks up the invite field and rebuilds the member list behind a loading screen. |
protected override void OnGroupDataChange() | Clears and destroys the member list when the shown group changes. |
7 private and internal methods
| Member | What it is |
|---|---|
private void BanMember(GroupMember member) | Asks for confirmation, then bans the member from the group's first server through SocialService and sends an analytics event. |
private async void HandleInvitePressed(InputField obj) | Handler for the invite field's Submitted event; runs InviteUser with the typed name behind a loading screen. |
private async Task InviteUser(string username) | Looks up a user by username through the API and adds a group invite for them, showing a popup with the result. |
private void KickMember(GroupMember member) | Asks for confirmation, then kicks the member with KickMemberAsync behind a loading screen. |
private async Task KickMemberAsync(GroupMember member) | Kicks the member through the API and shows an error popup if it fails. |
private async Task SetupMembersList() | Fetches all members and builds a list element for each. Shows a notice instead if the group has over 100 members. |
private void ShowOptionsPopup(ListElementWithButton member) | Shows Kick and Ban options for the selected member, depending on the local player's group permissions. |
Used in
Members of other types that take, return or hold a GroupMembersPage: