Skip to main content

FriendsListPanel

A class in Root.Township, Alta.Meta.UI.ServerManagement.

Main menu friends list: add friends by username, unfriend them or invite them to a server.

Constructors​

MemberWhat it is
FriendsListPanel()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

7 private and internal fields
MemberWhat it is
private IAnalyticsService analyticsServiceAnalytics service for social events.
private TextRenderer emptyListTextText shown when you have no friends listed.
private PanelComponent friendInvitesPanelSent requests panel, refreshed after sending a request.
private InputField friendSearchUsername input box.
private InviteUserToGroupPanel inviteWindowPanel for inviting a friend to a server.
private ListElementWithButton listElementRow prefab.
private UIList uiListThe list the rows go in.

Methods​

MemberWhat it is
void Inject(IAnalyticsService analyticsService)Receives the analytics service.
override async void RefreshData()Reloads the list behind a loading screen.
protected override void HandleStateChange(Panel panel)Hooks the search box's submit only while the panel is active.
6 private and internal methods
MemberWhat it is
private async void AddFriend(InputField obj)Looks up a username and sends them a friend request, with popups for success or not found.
private async Task AddFriend(string username)Looks up a username and sends them a friend request, with popups for success or not found.
private async void RemoveFriend(FriendshipInfo friendship)Removes a friend, logs analytics and reloads.
private async Task SetupFriendsList()Fetches friends from the web API and builds a row for each.
private void ShowInviteWindow(FriendshipInfo friendship)Opens the invite window for a friend.
private void ShowOptionsForFriend(FriendshipInfo friendship)Shows the Invite to Server and Unfriend options.

Used in​

Members of other types that take, return or hold a FriendsListPanel: