Agent ID Cards (#7041)
This commit is contained in:
@@ -1,15 +1,12 @@
|
||||
using Content.Shared.Access.Systems;
|
||||
using Content.Shared.PDA;
|
||||
using Robust.Shared.Analyzers;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
|
||||
namespace Content.Shared.Access.Components
|
||||
{
|
||||
// TODO BUI NETWORKING if ever clients can open their own BUI's (id card console, pda), then this data should be
|
||||
// networked.
|
||||
[RegisterComponent]
|
||||
[Friend(typeof(SharedIdCardSystem), typeof(SharedPDASystem))]
|
||||
[Friend(typeof(SharedIdCardSystem), typeof(SharedPDASystem), typeof(SharedAgentIdCardSystem))]
|
||||
public sealed class IdCardComponent : Component
|
||||
{
|
||||
[DataField("originalOwnerName")]
|
||||
|
||||
55
Content.Shared/Access/SharedAgentIDCardSystem.cs
Normal file
55
Content.Shared/Access/SharedAgentIDCardSystem.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Access.Systems
|
||||
{
|
||||
public class SharedAgentIdCardSystem : EntitySystem
|
||||
{
|
||||
/// Just for friending for now
|
||||
}
|
||||
/// <summary>
|
||||
/// Key representing which <see cref="BoundUserInterface"/> is currently open.
|
||||
/// Useful when there are multiple UI for an object. Here it's future-proofing only.
|
||||
/// </summary>
|
||||
[Serializable, NetSerializable]
|
||||
public enum AgentIDCardUiKey
|
||||
{
|
||||
Key,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents an <see cref="AgentIDCardComponent"/> state that can be sent to the client
|
||||
/// </summary>
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class AgentIDCardBoundUserInterfaceState : BoundUserInterfaceState
|
||||
{
|
||||
public string CurrentName { get; }
|
||||
public string CurrentJob { get; }
|
||||
|
||||
public AgentIDCardBoundUserInterfaceState(string currentName, string currentJob)
|
||||
{
|
||||
CurrentName = currentName;
|
||||
CurrentJob = currentJob;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class AgentIDCardNameChangedMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public string Name { get; }
|
||||
|
||||
public AgentIDCardNameChangedMessage(string name)
|
||||
{
|
||||
Name = name;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class AgentIDCardJobChangedMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public string Job { get; }
|
||||
public AgentIDCardJobChangedMessage(string job)
|
||||
{
|
||||
Job = job;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user