Skip to content

Commit 765ebb6

Browse files
committed
RoleContainer.LateJoinRole property
1 parent 6aad8ba commit 765ebb6

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

LabExtended/API/Containers/RoleContainer.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using LabExtended.API.CustomRoles;
22
using LabExtended.API.CustomTeams;
3+
34
using LabExtended.Extensions;
45
using LabExtended.Utilities.Values;
56

@@ -27,6 +28,9 @@
2728

2829
namespace LabExtended.API.Containers;
2930

31+
/// <summary>
32+
/// Provides properties and methods for easier role management.
33+
/// </summary>
3034
public class RoleContainer
3135
{
3236
internal RoleContainer(PlayerRoleManager manager)
@@ -78,7 +82,12 @@ internal RoleContainer(PlayerRoleManager manager)
7882
public RoleSpawnFlags SpawnFlags => Role.ServerSpawnFlags;
7983

8084
/// <summary>
81-
/// Gets the player's first spawned role (when the round started, will be None if the player joined afterwards).
85+
/// Gets the role assigned to the player by the late join function (will be <see cref="RoleTypeId.None"/> if the player joined after the function's timer).
86+
/// </summary>
87+
public RoleTypeId LateJoinRole { get; internal set; } = RoleTypeId.None;
88+
89+
/// <summary>
90+
/// Gets the player's first spawned role (when the round started, will be <see cref="RoleTypeId.None"/> if the player joined afterwards).
8291
/// </summary>
8392
public RoleTypeId RoundStartRole { get; internal set; } = RoleTypeId.None;
8493

@@ -122,7 +131,9 @@ public WearableElements WearableElements
122131
/// <summary>
123132
/// Gets the name of the player's role.
124133
/// </summary>
125-
public string Name => string.IsNullOrWhiteSpace(Role.RoleName) ? Role.ToString() : Role.RoleName;
134+
public string Name => string.IsNullOrWhiteSpace(Role.RoleName)
135+
? Role.ToString().SpaceByUpperCase()
136+
: Role.RoleName;
126137

127138
/// <summary>
128139
/// Gets the name of the player's role, prefixed with a color tag with the role's color and postfixed with a color closing tag.

0 commit comments

Comments
 (0)