Forensics QOL (Autolabeling of pads and reports) (#9610)
This commit is contained in:
@@ -18,6 +18,8 @@ namespace Content.Server.Forensics
|
|||||||
[ViewVariables(VVAccess.ReadOnly)]
|
[ViewVariables(VVAccess.ReadOnly)]
|
||||||
public List<string> Fibers = new();
|
public List<string> Fibers = new();
|
||||||
|
|
||||||
|
public string LastScanned = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The time (in seconds) that it takes to scan an entity.
|
/// The time (in seconds) that it takes to scan an entity.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -100,6 +100,11 @@ namespace Content.Server.Forensics
|
|||||||
if (!EntityManager.TryGetComponent(ev.Pad, out ForensicPadComponent? component))
|
if (!EntityManager.TryGetComponent(ev.Pad, out ForensicPadComponent? component))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (HasComp<FingerprintComponent>(ev.Target))
|
||||||
|
MetaData(component.Owner).EntityName = Loc.GetString("forensic-pad-fingerprint-name", ("entity", ev.Target));
|
||||||
|
else
|
||||||
|
MetaData(component.Owner).EntityName = Loc.GetString("forensic-pad-gloves-name", ("entity", ev.Target));
|
||||||
|
|
||||||
component.CancelToken = null;
|
component.CancelToken = null;
|
||||||
component.Sample = ev.Sample;
|
component.Sample = ev.Sample;
|
||||||
component.Used = true;
|
component.Used = true;
|
||||||
@@ -124,11 +129,11 @@ namespace Content.Server.Forensics
|
|||||||
private sealed class TargetPadSuccessfulEvent : EntityEventArgs
|
private sealed class TargetPadSuccessfulEvent : EntityEventArgs
|
||||||
{
|
{
|
||||||
public EntityUid User;
|
public EntityUid User;
|
||||||
public EntityUid? Target;
|
public EntityUid Target;
|
||||||
public EntityUid Pad;
|
public EntityUid Pad;
|
||||||
public string Sample = string.Empty;
|
public string Sample = string.Empty;
|
||||||
|
|
||||||
public TargetPadSuccessfulEvent(EntityUid user, EntityUid? target, EntityUid pad, string sample)
|
public TargetPadSuccessfulEvent(EntityUid user, EntityUid target, EntityUid pad, string sample)
|
||||||
{
|
{
|
||||||
User = user;
|
User = user;
|
||||||
Target = target;
|
Target = target;
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ namespace Content.Server.Forensics
|
|||||||
|
|
||||||
scanner.Fingerprints = forensics.Fingerprints.ToList();
|
scanner.Fingerprints = forensics.Fingerprints.ToList();
|
||||||
scanner.Fibers = forensics.Fibers.ToList();
|
scanner.Fibers = forensics.Fibers.ToList();
|
||||||
|
scanner.LastScanned = MetaData(ev.Target).EntityName;
|
||||||
OpenUserInterface(ev.User, scanner);
|
OpenUserInterface(ev.User, scanner);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,7 +63,7 @@ namespace Content.Server.Forensics
|
|||||||
component.CancelToken = new CancellationTokenSource();
|
component.CancelToken = new CancellationTokenSource();
|
||||||
_doAfterSystem.DoAfter(new DoAfterEventArgs(args.User, component.ScanDelay, component.CancelToken.Token, target: args.Target)
|
_doAfterSystem.DoAfter(new DoAfterEventArgs(args.User, component.ScanDelay, component.CancelToken.Token, target: args.Target)
|
||||||
{
|
{
|
||||||
BroadcastFinishedEvent = new TargetScanSuccessfulEvent(args.User, args.Target, component.Owner),
|
BroadcastFinishedEvent = new TargetScanSuccessfulEvent(args.User, (EntityUid) args.Target, component.Owner),
|
||||||
BroadcastCancelledEvent = new ScanCancelledEvent(component.Owner),
|
BroadcastCancelledEvent = new ScanCancelledEvent(component.Owner),
|
||||||
BreakOnTargetMove = true,
|
BreakOnTargetMove = true,
|
||||||
BreakOnUserMove = true,
|
BreakOnUserMove = true,
|
||||||
@@ -110,7 +111,7 @@ namespace Content.Server.Forensics
|
|||||||
var ui = _uiSystem.GetUi(component.Owner, ForensicScannerUiKey.Key);
|
var ui = _uiSystem.GetUi(component.Owner, ForensicScannerUiKey.Key);
|
||||||
|
|
||||||
ui.Open(actor.PlayerSession);
|
ui.Open(actor.PlayerSession);
|
||||||
ui.SendMessage(new ForensicScannerUserMessage(component.Fingerprints, component.Fibers));
|
ui.SendMessage(new ForensicScannerUserMessage(component.Fingerprints, component.Fibers, component.LastScanned));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnPrint(EntityUid uid, ForensicScannerComponent component, ForensicScannerPrintMessage args)
|
private void OnPrint(EntityUid uid, ForensicScannerComponent component, ForensicScannerPrintMessage args)
|
||||||
@@ -124,7 +125,7 @@ namespace Content.Server.Forensics
|
|||||||
if (!TryComp<PaperComponent>(printed, out var paper))
|
if (!TryComp<PaperComponent>(printed, out var paper))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
MetaData(printed).EntityName = Loc.GetString("forensic-scanner-report-title");
|
MetaData(printed).EntityName = Loc.GetString("forensic-scanner-report-title", ("entity", component.LastScanned));
|
||||||
|
|
||||||
var text = new StringBuilder();
|
var text = new StringBuilder();
|
||||||
|
|
||||||
@@ -156,9 +157,9 @@ namespace Content.Server.Forensics
|
|||||||
private sealed class TargetScanSuccessfulEvent : EntityEventArgs
|
private sealed class TargetScanSuccessfulEvent : EntityEventArgs
|
||||||
{
|
{
|
||||||
public EntityUid User;
|
public EntityUid User;
|
||||||
public EntityUid? Target;
|
public EntityUid Target;
|
||||||
public EntityUid Scanner;
|
public EntityUid Scanner;
|
||||||
public TargetScanSuccessfulEvent(EntityUid user, EntityUid? target, EntityUid scanner)
|
public TargetScanSuccessfulEvent(EntityUid user, EntityUid target, EntityUid scanner)
|
||||||
{
|
{
|
||||||
User = user;
|
User = user;
|
||||||
Target = target;
|
Target = target;
|
||||||
|
|||||||
@@ -7,11 +7,13 @@ namespace Content.Shared.Forensics
|
|||||||
{
|
{
|
||||||
public readonly List<string> Fingerprints = new();
|
public readonly List<string> Fingerprints = new();
|
||||||
public readonly List<string> Fibers = new();
|
public readonly List<string> Fibers = new();
|
||||||
|
public readonly string LastScanned = string.Empty;
|
||||||
|
|
||||||
public ForensicScannerUserMessage(List<string> fingerprints, List<string> fibers)
|
public ForensicScannerUserMessage(List<string> fingerprints, List<string> fibers, string lastScanned)
|
||||||
{
|
{
|
||||||
Fingerprints = fingerprints;
|
Fingerprints = fingerprints;
|
||||||
Fibers = fibers;
|
Fibers = fibers;
|
||||||
|
LastScanned = lastScanned;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ forensic-scanner-interface-fingerprints = Fingerprints
|
|||||||
forensic-scanner-interface-fibers = Fibers
|
forensic-scanner-interface-fibers = Fibers
|
||||||
forensic-scanner-interface-no-data = No scan data available
|
forensic-scanner-interface-no-data = No scan data available
|
||||||
forensic-scanner-interface-print = Print
|
forensic-scanner-interface-print = Print
|
||||||
forensic-scanner-report-title = Forensics Report
|
forensic-scanner-report-title = Forensics Report: {$entity}
|
||||||
forensic-pad-unused = It hasn't been used.
|
forensic-pad-unused = It hasn't been used.
|
||||||
forensic-pad-sample = It has a sample: {$sample}
|
forensic-pad-sample = It has a sample: {$sample}
|
||||||
forensic-pad-gloves = {CAPITALIZE($target)} is wearing gloves.
|
forensic-pad-gloves = {CAPITALIZE($target)} is wearing gloves.
|
||||||
@@ -13,3 +13,6 @@ forensic-pad-already-used = This pad has already been used.
|
|||||||
forensic-scanner-match-fiber = Match in fiber found!
|
forensic-scanner-match-fiber = Match in fiber found!
|
||||||
forensic-scanner-match-fingerprint = Match in fingerprint found!
|
forensic-scanner-match-fingerprint = Match in fingerprint found!
|
||||||
forensic-scanner-match-none = No matches found!
|
forensic-scanner-match-none = No matches found!
|
||||||
|
|
||||||
|
forensic-pad-fingerprint-name = {$entity}'s fingerprints
|
||||||
|
forensic-pad-gloves-name = fibers from {$entity}
|
||||||
|
|||||||
Reference in New Issue
Block a user