InboxPanel
A class in Root.Township, Alta.Meta.UI.ServerManagement.
Client menu panel showing the player's inbox: group invites, friend requests, API status messages and player reports, with accept and decline buttons.
- Listed in Menus, UI and platforms
- Inherits or implements
PanelComponent
Constructors
| Member | What it is |
|---|---|
InboxPanel() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
14 private and internal fields
| Member | What it is |
|---|---|
private Button acceptButton | Accept button; its label comes from the selected notification. |
private IAnalyticsService analyticsService | Analytics service passed to friend request and report notifications. |
private UINotification currentShowing | The notification whose details are shown now. |
private Dictionary<ListElementWithButton, UINotification> dataMapping | Maps each list row to its notification. |
private Button declineButton | Decline button; its label comes from the selected notification. |
private ListElementWithButton friendRequestElement | Row prefab for friend requests. |
private ListElementWithButton groupInviteElement | Row prefab for group invites. |
private TextRenderer infoText | Text showing the selected notification's full message, or "Inbox is empty". |
private PanelComponent[] panelsToRefresh | Other panels marked for reload after an accept or decline. |
private ListElementWithButton playerReportElement | Row prefab for player reports. |
private PlayerReportInboxInfoPanel reportInfoPanel | Panel that shows a player report's details. |
private ListElementWithButton selected | The selected list row. |
private ListElementWithButton statusElement | Row prefab for API status messages and anything else. |
private UIList uiList | The list that holds the notification rows. |
Methods
| Member | What it is |
|---|---|
void Inject(IAnalyticsService analyticsService) | VContainer injection point that supplies the analytics service. |
override async void RefreshData() | Rebuilds the inbox behind a loading screen. |
7 private and internal methods
| Member | What it is |
|---|---|
private void ForceRefresh() | Marks this panel and every panel in panelsToRefresh to reload next time they are shown. |
private async Task<IEnumerable<UINotification>> GetAllNotifications() | Fetches group invites, friend requests, API status and reports awaiting action from the API, sorted by time. Each source fails on its own. |
private static IEnumerable<UINotification> GetFirstTenInReverseOrder(IEnumerable<UINotification> allNotifications) | Returns the newest ten notifications, newest first. |
private async void HandleAccept(Button obj) | Accepts the shown notification (with a loading screen if it asks for one), removes its row and refreshes. |
private async void HandleDecline(Button obj) | Declines the shown notification behind a loading screen, removes its row and refreshes. |
private void HandleSelectedElement(ListElementWithButton element) | Shows the selected notification's message and sets up the accept and decline buttons for it. |
private async Task SetupInbox() | Builds a row for each of the newest ten notifications, picking the prefab by notification type, and reselects the one that was shown. |
Used in
Members of other types that take, return or hold a InboxPanel: