Skip to main content

ReportsPanel

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

Client panel listing player report summaries from the API, with accept and decline buttons. Works like InboxPanel but only for reports, probably for moderators.

Constructors​

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

Fields​

10 private and internal fields
MemberWhat it is
private Button acceptButtonAccept button; its label comes from the selected report.
private IAnalyticsService analyticsServiceAnalytics service passed to each report notification.
private UINotification currentShowingThe report whose details are shown now.
private Dictionary<ListElementWithButton, UINotification> dataMappingMaps each list row to its report notification.
private Button declineButtonDecline button; its label comes from the selected report.
private TextRenderer infoTextText showing the selected report's message, or "Inbox is empty".
private ListElementWithButton playerReportElementRow prefab cloned for each report.
private PlayerReportSummaryPanel reportInfoPanelPanel that shows a report summary's details.
private ListElementWithButton selectedThe selected list row.
private UIList uiListThe list that holds the rows.

Methods​

MemberWhat it is
void Inject(IAnalyticsService analyticsService)VContainer injection point that supplies the analytics service.
override async void RefreshData()Rebuilds the list behind a loading screen.
5 private and internal methods
MemberWhat it is
private async Task<IEnumerable<UINotification>> GetAllNotifications()Fetches all player report summaries from the API, wrapped as notifications and sorted by time.
private async void HandleAccept(Button obj)Accepts the shown report (with a loading screen if it asks for one) and reselects it to update the view.
private async void HandleDecline(Button obj)Declines the shown report behind a loading screen and reselects it.
private void HandleSelectedElement(ListElementWithButton element)Shows the selected report's message and sets up the accept and decline buttons for it.
private async Task SetupInbox()Builds a row per report, newest first, and reselects the one that was shown.

Used in​

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