1
0

IdCardComponent.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using Content.Shared.Access.Systems;
  2. using Content.Shared.PDA;
  3. using Content.Shared.Roles;
  4. using Content.Shared.StatusIcon;
  5. using Robust.Shared.GameStates;
  6. using Robust.Shared.Prototypes;
  7. namespace Content.Shared.Access.Components;
  8. [RegisterComponent, NetworkedComponent]
  9. [AutoGenerateComponentState]
  10. [Access(typeof(SharedIdCardSystem), typeof(SharedPdaSystem), typeof(SharedAgentIdCardSystem), Other = AccessPermissions.ReadWrite)]
  11. public sealed partial class IdCardComponent : Component
  12. {
  13. [DataField]
  14. [AutoNetworkedField]
  15. // FIXME Friends
  16. public string? FullName;
  17. [DataField]
  18. [AutoNetworkedField]
  19. [Access(typeof(SharedIdCardSystem), typeof(SharedPdaSystem), typeof(SharedAgentIdCardSystem), Other = AccessPermissions.ReadWrite)]
  20. public LocId? JobTitle;
  21. [DataField]
  22. [AutoNetworkedField]
  23. private string? _jobTitle;
  24. [Access(typeof(SharedIdCardSystem), typeof(SharedPdaSystem), typeof(SharedAgentIdCardSystem), Other = AccessPermissions.ReadWriteExecute)]
  25. public string? LocalizedJobTitle { set => _jobTitle = value; get => _jobTitle ?? Loc.GetString(JobTitle ?? string.Empty); }
  26. /// <summary>
  27. /// The state of the job icon rsi.
  28. /// </summary>
  29. [DataField]
  30. [AutoNetworkedField]
  31. public ProtoId<JobIconPrototype> JobIcon = "JobIconUnknown";
  32. /// <summary>
  33. /// The proto IDs of the departments associated with the job
  34. /// </summary>
  35. [DataField]
  36. [AutoNetworkedField]
  37. public List<ProtoId<DepartmentPrototype>> JobDepartments = new();
  38. /// <summary>
  39. /// Determines if accesses from this card should be logged by <see cref="AccessReaderComponent"/>
  40. /// </summary>
  41. [DataField]
  42. public bool BypassLogging;
  43. [DataField]
  44. public LocId NameLocId = "access-id-card-component-owner-name-job-title-text";
  45. [DataField]
  46. public LocId FullNameLocId = "access-id-card-component-owner-full-name-job-title-text";
  47. [DataField]
  48. public bool CanMicrowave = true;
  49. }