Remove id card console component reference (#15205)
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
using Content.Server.Access.Systems;
|
||||
using Content.Shared.Access.Components;
|
||||
|
||||
namespace Content.Server.Access.Components;
|
||||
|
||||
[RegisterComponent]
|
||||
[ComponentReference(typeof(SharedIdCardConsoleComponent))]
|
||||
[Access(typeof(IdCardConsoleSystem))]
|
||||
public sealed class IdCardConsoleComponent : SharedIdCardConsoleComponent
|
||||
{
|
||||
}
|
||||
@@ -11,7 +11,7 @@ using JetBrains.Annotations;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Prototypes;
|
||||
using static Content.Shared.Access.Components.SharedIdCardConsoleComponent;
|
||||
using static Content.Shared.Access.Components.IdCardConsoleComponent;
|
||||
|
||||
namespace Content.Server.Access.Systems;
|
||||
|
||||
@@ -31,15 +31,15 @@ public sealed class IdCardConsoleSystem : SharedIdCardConsoleSystem
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<SharedIdCardConsoleComponent, WriteToTargetIdMessage>(OnWriteToTargetIdMessage);
|
||||
SubscribeLocalEvent<IdCardConsoleComponent, WriteToTargetIdMessage>(OnWriteToTargetIdMessage);
|
||||
|
||||
// one day, maybe bound user interfaces can be shared too.
|
||||
SubscribeLocalEvent<SharedIdCardConsoleComponent, ComponentStartup>(UpdateUserInterface);
|
||||
SubscribeLocalEvent<SharedIdCardConsoleComponent, EntInsertedIntoContainerMessage>(UpdateUserInterface);
|
||||
SubscribeLocalEvent<SharedIdCardConsoleComponent, EntRemovedFromContainerMessage>(UpdateUserInterface);
|
||||
SubscribeLocalEvent<IdCardConsoleComponent, ComponentStartup>(UpdateUserInterface);
|
||||
SubscribeLocalEvent<IdCardConsoleComponent, EntInsertedIntoContainerMessage>(UpdateUserInterface);
|
||||
SubscribeLocalEvent<IdCardConsoleComponent, EntRemovedFromContainerMessage>(UpdateUserInterface);
|
||||
}
|
||||
|
||||
private void OnWriteToTargetIdMessage(EntityUid uid, SharedIdCardConsoleComponent component, WriteToTargetIdMessage args)
|
||||
private void OnWriteToTargetIdMessage(EntityUid uid, IdCardConsoleComponent component, WriteToTargetIdMessage args)
|
||||
{
|
||||
if (args.Session.AttachedEntity is not { Valid: true } player)
|
||||
return;
|
||||
@@ -49,7 +49,7 @@ public sealed class IdCardConsoleSystem : SharedIdCardConsoleSystem
|
||||
UpdateUserInterface(uid, component, args);
|
||||
}
|
||||
|
||||
private void UpdateUserInterface(EntityUid uid, SharedIdCardConsoleComponent component, EntityEventArgs args)
|
||||
private void UpdateUserInterface(EntityUid uid, IdCardConsoleComponent component, EntityEventArgs args)
|
||||
{
|
||||
if (!component.Initialized)
|
||||
return;
|
||||
@@ -109,7 +109,7 @@ public sealed class IdCardConsoleSystem : SharedIdCardConsoleSystem
|
||||
|
||||
/// <summary>
|
||||
/// Called whenever an access button is pressed, adding or removing that access from the target ID card.
|
||||
/// Writes data passed from the UI into the ID stored in <see cref="SharedIdCardConsoleComponent.TargetIdSlot"/>, if present.
|
||||
/// Writes data passed from the UI into the ID stored in <see cref="IdCardConsoleComponent.TargetIdSlot"/>, if present.
|
||||
/// </summary>
|
||||
private void TryWriteToTargetId(EntityUid uid,
|
||||
string newFullName,
|
||||
@@ -117,7 +117,7 @@ public sealed class IdCardConsoleSystem : SharedIdCardConsoleSystem
|
||||
List<string> newAccessList,
|
||||
string newJobProto,
|
||||
EntityUid player,
|
||||
SharedIdCardConsoleComponent? component = null)
|
||||
IdCardConsoleComponent? component = null)
|
||||
{
|
||||
if (!Resolve(uid, ref component))
|
||||
return;
|
||||
@@ -153,9 +153,9 @@ public sealed class IdCardConsoleSystem : SharedIdCardConsoleSystem
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if there is an ID in <see cref="SharedIdCardConsoleComponent.PrivilegedIdSlot"/> and said ID satisfies the requirements of <see cref="AccessReaderComponent"/>.
|
||||
/// Returns true if there is an ID in <see cref="IdCardConsoleComponent.PrivilegedIdSlot"/> and said ID satisfies the requirements of <see cref="AccessReaderComponent"/>.
|
||||
/// </summary>
|
||||
private bool PrivilegedIdIsAuthorized(EntityUid uid, SharedIdCardConsoleComponent? component = null)
|
||||
private bool PrivilegedIdIsAuthorized(EntityUid uid, IdCardConsoleComponent? component = null)
|
||||
{
|
||||
if (!Resolve(uid, ref component))
|
||||
return true;
|
||||
|
||||
@@ -95,8 +95,8 @@ namespace Content.Server.Access.Systems
|
||||
{
|
||||
jobTitle = jobTitle.Trim();
|
||||
|
||||
if (jobTitle.Length > SharedIdCardConsoleComponent.MaxJobTitleLength)
|
||||
jobTitle = jobTitle[..SharedIdCardConsoleComponent.MaxJobTitleLength];
|
||||
if (jobTitle.Length > IdCardConsoleComponent.MaxJobTitleLength)
|
||||
jobTitle = jobTitle[..IdCardConsoleComponent.MaxJobTitleLength];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -132,8 +132,8 @@ namespace Content.Server.Access.Systems
|
||||
if (!string.IsNullOrWhiteSpace(fullName))
|
||||
{
|
||||
fullName = fullName.Trim();
|
||||
if (fullName.Length > SharedIdCardConsoleComponent.MaxFullNameLength)
|
||||
fullName = fullName[..SharedIdCardConsoleComponent.MaxFullNameLength];
|
||||
if (fullName.Length > IdCardConsoleComponent.MaxFullNameLength)
|
||||
fullName = fullName[..IdCardConsoleComponent.MaxFullNameLength];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user