A class in Root.Township, the global namespace.
Client UI: one row in the recent players list. Shows the name, a rough status text and a nameplate coloured by online and friend status, and a marker for incoming friend requests.
Constructors
| Member | What it is |
|---|
RecentPlayerElement() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
7 private and internal fields
| Member | What it is |
|---|
private Color defaultColor | Nameplate colour for an online non-friend. |
private Color friendColor | Nameplate colour for a friend. |
private ComponentEventSubscriber friendshipStatusSubscriber | Subscription to friendship changes, disposed when the row is cleared or disabled. |
private static readonly Logger logger | NLog logger for this class. |
private RecentPlayerElement.NameplateMeshReference[] meshReferences | Nameplate meshes that get the status colour. |
private GameObject notification | Marker shown when this non-friend has sent a friend request. |
private Color offlineColor | Nameplate colour for a player not on this server. |
Properties
1 private and internal property
| Member | What it is |
|---|
private int Id { get; } | The shown player's user id. |
Methods
| Member | What it is |
|---|
void Clear() | Empties the row and stops listening for friendship changes. |
void Setup(RecentPlayerInteractionInfo recentPlayerInteractionInfo) | Shows the given recent player. |
7 private and internal methods
| Member | What it is |
|---|
private Action FriendshipSubscriber(Action handler) | Subscribes to local friendship status changes. |
private void FriendshipUnsubscriber(Action handler) | Unsubscribes from local friendship status changes. |
private Color GetNameplateColor(bool isOnline, bool isFriend) | Friend colour for friends, else offline or default colour depending on whether they're on this server. |
private void Init() | Starts listening for friendship changes and refreshes the row. |
private void OnDisable() | Stops listening for friendship changes. |
private void OnEnable() | Calls Init. |
private void UpdateView() | Redraws the name, status text, nameplate colour and friend request marker. |
Used in
Members of other types that take, return or hold a RecentPlayerElement: