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.
- Listed in Menus, UI and platforms
- Inherits or implements
PanelComponent
Constructors
| Member | What it is |
|---|---|
FriendsListPanel() | 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 for social events. |
private TextRenderer emptyListText | Text shown when you have no friends listed. |
private PanelComponent friendInvitesPanel | Sent requests panel, refreshed after sending a request. |
private InputField friendSearch | Username input box. |
private InviteUserToGroupPanel inviteWindow | Panel for inviting a friend to a server. |
private ListElementWithButton listElement | Row prefab. |
private UIList uiList | The list the rows go in. |
Methods
| Member | What 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
| Member | What 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: