Files
crystall-punk-14/Content.Shared/Access/Components/IdCardComponent.cs

59 lines
1.9 KiB
C#
Raw Permalink Normal View History

2021-12-16 23:42:02 +13:00
using Content.Shared.Access.Systems;
using Content.Shared.PDA;
using Content.Shared.Roles;
using Content.Shared.StatusIcon;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
2023-12-09 23:38:50 -06:00
namespace Content.Shared.Access.Components;
[RegisterComponent, NetworkedComponent]
[AutoGenerateComponentState]
[Access(typeof(SharedIdCardSystem), typeof(SharedPdaSystem), typeof(SharedAgentIdCardSystem), Other = AccessPermissions.ReadWrite)]
public sealed partial class IdCardComponent : Component
{
[DataField]
2023-12-09 23:38:50 -06:00
[AutoNetworkedField]
// FIXME Friends
public string? FullName;
[DataField]
2023-12-09 23:38:50 -06:00
[AutoNetworkedField]
[Access(typeof(SharedIdCardSystem), typeof(SharedPdaSystem), typeof(SharedAgentIdCardSystem), Other = AccessPermissions.ReadWrite)]
public LocId? JobTitle;
private string? _jobTitle;
[Access(typeof(SharedIdCardSystem), typeof(SharedPdaSystem), typeof(SharedAgentIdCardSystem), Other = AccessPermissions.ReadWriteExecute)]
public string? LocalizedJobTitle { set => _jobTitle = value; get => _jobTitle ?? Loc.GetString(JobTitle ?? string.Empty); }
2023-12-09 23:38:50 -06:00
/// <summary>
/// The state of the job icon rsi.
/// </summary>
[DataField]
2023-12-09 23:38:50 -06:00
[AutoNetworkedField]
public ProtoId<JobIconPrototype> JobIcon = "JobIconUnknown";
2023-12-09 23:38:50 -06:00
/// <summary>
/// The proto IDs of the departments associated with the job
2023-12-09 23:38:50 -06:00
/// </summary>
[DataField]
2023-12-09 23:38:50 -06:00
[AutoNetworkedField]
public List<ProtoId<DepartmentPrototype>> JobDepartments = new();
2023-12-26 16:24:53 -06:00
/// <summary>
/// Determines if accesses from this card should be logged by <see cref="AccessReaderComponent"/>
/// </summary>
[DataField]
2023-12-26 16:24:53 -06:00
public bool BypassLogging;
[DataField]
public LocId NameLocId = "access-id-card-component-owner-name-job-title-text";
[DataField]
public LocId FullNameLocId = "access-id-card-component-owner-full-name-job-title-text";
[DataField]
public bool CanMicrowave = true;
}