Move FingerprintComponent and FingerprintMaskComponent to shared (#35451)

* init

* review

* whoopsie
This commit is contained in:
ScarKy0
2025-02-24 17:23:11 +01:00
committed by GitHub
parent c3784a3005
commit 88308356db
6 changed files with 28 additions and 24 deletions

View File

@@ -1,12 +0,0 @@
namespace Content.Server.Forensics
{
/// <summary>
/// This component is for mobs that leave fingerprints.
/// </summary>
[RegisterComponent]
public sealed partial class FingerprintComponent : Component
{
[DataField("fingerprint"), ViewVariables(VVAccess.ReadWrite)]
public string? Fingerprint;
}
}

View File

@@ -1,10 +0,0 @@
namespace Content.Server.Forensics
{
/// <summary>
/// This component stops the entity from leaving finger prints,
/// usually so fibres can be left instead.
/// </summary>
[RegisterComponent]
public sealed partial class FingerprintMaskComponent : Component
{}
}

View File

@@ -3,6 +3,7 @@ using Content.Server.Popups;
using Content.Shared.DoAfter;
using Content.Shared.Examine;
using Content.Shared.Forensics;
using Content.Shared.Forensics.Components;
using Content.Shared.IdentityManagement;
using Content.Shared.Interaction;
using Content.Shared.Inventory;

View File

@@ -63,9 +63,10 @@ namespace Content.Server.Forensics
ApplyEvidence(uid, args.Other);
}
private void OnFingerprintInit(EntityUid uid, FingerprintComponent component, MapInitEvent args)
private void OnFingerprintInit(Entity<FingerprintComponent> ent, ref MapInitEvent args)
{
component.Fingerprint = GenerateFingerprint();
ent.Comp.Fingerprint = GenerateFingerprint();
Dirty(ent);
}
private void OnDNAInit(EntityUid uid, DnaComponent component, MapInitEvent args)

View File

@@ -0,0 +1,13 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Forensics.Components;
/// <summary>
/// This component is for mobs that leave fingerprints.
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class FingerprintComponent : Component
{
[DataField, AutoNetworkedField]
public string? Fingerprint;
}

View File

@@ -0,0 +1,11 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Forensics.Components;
/// <summary>
/// This component stops the entity from leaving fingerprints,
/// usually so fibres can be left instead.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class FingerprintMaskComponent : Component;