Job icons are stored on ID cards (#18233)
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using Content.Shared.Access.Systems;
|
||||
using Content.Shared.PDA;
|
||||
using Content.Shared.StatusIcon;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
|
||||
namespace Content.Shared.Access.Components
|
||||
{
|
||||
@@ -18,5 +20,13 @@ namespace Content.Shared.Access.Components
|
||||
[AutoNetworkedField]
|
||||
[Access(typeof(SharedIdCardSystem), typeof(SharedPdaSystem), typeof(SharedAgentIdCardSystem), Other = AccessPermissions.ReadWrite)]
|
||||
public string? JobTitle;
|
||||
|
||||
/// <summary>
|
||||
/// The state of the job icon rsi.
|
||||
/// </summary>
|
||||
[DataField("jobIcon", customTypeSerializer: typeof(PrototypeIdSerializer<StatusIconPrototype>))]
|
||||
[AutoNetworkedField]
|
||||
public string JobIcon = "JobIconUnknown";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,11 +23,13 @@ namespace Content.Shared.Access.Systems
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class AgentIDCardBoundUserInterfaceState : BoundUserInterfaceState
|
||||
{
|
||||
public readonly HashSet<string> Icons;
|
||||
public string CurrentName { get; }
|
||||
public string CurrentJob { get; }
|
||||
|
||||
public AgentIDCardBoundUserInterfaceState(string currentName, string currentJob)
|
||||
public AgentIDCardBoundUserInterfaceState(string currentName, string currentJob, HashSet<string> icons)
|
||||
{
|
||||
Icons = icons;
|
||||
CurrentName = currentName;
|
||||
CurrentJob = currentJob;
|
||||
}
|
||||
@@ -54,4 +56,15 @@ namespace Content.Shared.Access.Systems
|
||||
Job = job;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class AgentIDCardJobIconChangedMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public string JobIcon { get; }
|
||||
|
||||
public AgentIDCardJobIconChangedMessage(string jobIcon)
|
||||
{
|
||||
JobIcon = jobIcon;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user