From d6af11a0840562bd0ca5d092f8f59d5fc086df34 Mon Sep 17 00:00:00 2001 From: faint <46868845+ficcialfaint@users.noreply.github.com> Date: Tue, 14 Mar 2023 05:55:56 +0300 Subject: [PATCH] Station Records Computer now shows fingerprints (#14524) * station records fingerprints * Add UI + Fixes * now itll display N/A if a mob doesnt have a fingerprint * ? - 0 * f8 * N/A is a fluent string now * remove locale string duplicating * no whitespace --- .../GeneralStationRecordConsoleWindow.xaml.cs | 4 ++++ .../StationRecords/Systems/StationRecordsSystem.cs | 11 ++++++++--- Content.Shared/StationRecords/GeneralStationRecord.cs | 6 ++++++ .../en-US/station-records/general-station-records.ftl | 1 + 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Content.Client/StationRecords/GeneralStationRecordConsoleWindow.xaml.cs b/Content.Client/StationRecords/GeneralStationRecordConsoleWindow.xaml.cs index 8172651a4c..91b3c3d8b7 100644 --- a/Content.Client/StationRecords/GeneralStationRecordConsoleWindow.xaml.cs +++ b/Content.Client/StationRecords/GeneralStationRecordConsoleWindow.xaml.cs @@ -115,6 +115,10 @@ public sealed partial class GeneralStationRecordConsoleWindow : DefaultWindow new Label() { Text = Loc.GetString("general-station-record-console-record-gender", ("gender", record.Gender.ToString())) + }, + new Label() + { + Text = Loc.GetString("general-station-record-console-record-fingerprint", ("fingerprint", record.Fingerprint is null ? Loc.GetString("generic-not-available-shorthand") : record.Fingerprint)) } }; diff --git a/Content.Server/StationRecords/Systems/StationRecordsSystem.cs b/Content.Server/StationRecords/Systems/StationRecordsSystem.cs index 50f62d323b..8ab2ca2129 100644 --- a/Content.Server/StationRecords/Systems/StationRecordsSystem.cs +++ b/Content.Server/StationRecords/Systems/StationRecordsSystem.cs @@ -3,7 +3,9 @@ using System.Linq; using Content.Server.GameTicking; using Content.Server.Station.Systems; using Content.Shared.Access.Components; +using Content.Server.Forensics; using Content.Shared.Inventory; +using Content.Shared.Nuke; using Content.Shared.PDA; using Content.Shared.Preferences; using Content.Shared.Roles; @@ -71,7 +73,9 @@ public sealed class StationRecordsSystem : EntitySystem return; } - CreateGeneralRecord(station, idUid.Value, profile.Name, profile.Age, profile.Species, profile.Gender, jobId, profile, records); + TryComp(player, out var fingerprintComponent); + + CreateGeneralRecord(station, idUid.Value, profile.Name, profile.Age, profile.Species, profile.Gender, jobId, fingerprintComponent?.Fingerprint, profile, records); } @@ -99,7 +103,7 @@ public sealed class StationRecordsSystem : EntitySystem /// Optional - other systems should anticipate this. /// /// Station records component. - public void CreateGeneralRecord(EntityUid station, EntityUid? idUid, string name, int age, string species, Gender gender, string jobId, HumanoidCharacterProfile? profile = null, + public void CreateGeneralRecord(EntityUid station, EntityUid? idUid, string name, int age, string species, Gender gender, string jobId, string? mobFingerprint, HumanoidCharacterProfile? profile = null, StationRecordsComponent? records = null) { if (!Resolve(station, ref records)) @@ -121,7 +125,8 @@ public sealed class StationRecordsSystem : EntitySystem JobPrototype = jobId, Species = species, Gender = gender, - DisplayPriority = jobPrototype.Weight + DisplayPriority = jobPrototype.Weight, + Fingerprint = mobFingerprint }; var key = AddRecord(station, records); diff --git a/Content.Shared/StationRecords/GeneralStationRecord.cs b/Content.Shared/StationRecords/GeneralStationRecord.cs index b1e2a6065a..74964178c6 100644 --- a/Content.Shared/StationRecords/GeneralStationRecord.cs +++ b/Content.Shared/StationRecords/GeneralStationRecord.cs @@ -56,4 +56,10 @@ public sealed class GeneralStationRecord /// [ViewVariables] public int DisplayPriority; + + /// + /// Fingerprint of the person. + /// + [ViewVariables] + public string? Fingerprint; } diff --git a/Resources/Locale/en-US/station-records/general-station-records.ftl b/Resources/Locale/en-US/station-records/general-station-records.ftl index 299f75399d..a041a8cbee 100644 --- a/Resources/Locale/en-US/station-records/general-station-records.ftl +++ b/Resources/Locale/en-US/station-records/general-station-records.ftl @@ -7,3 +7,4 @@ general-station-record-console-record-age = Age: {$age} general-station-record-console-record-title = Job: {$job} general-station-record-console-record-species = Species: {$species} general-station-record-console-record-gender = Gender: {$gender} +general-station-record-console-record-fingerprint = Fingerprint: {$fingerprint}