using Content.Shared.StationRecords; using Content.Shared.Humanoid.Prototypes; using Robust.Client.AutoGenerated; using Robust.Client.UserInterface; using Robust.Client.UserInterface.XAML; using Robust.Shared.Prototypes; namespace Content.Client.StationRecords; [GenerateTypedNameReferences] public sealed partial class GeneralRecord : Control { public Action? OnDeletePressed; public GeneralRecord(GeneralStationRecord record, bool canDelete, uint? id, IPrototypeManager prototypeManager) { RobustXamlLoader.Load(this); RecordName.Text = record.Name; Age.Text = Loc.GetString("general-station-record-console-record-age", ("age", record.Age.ToString())); Title.Text = Loc.GetString("general-station-record-console-record-title", ("job", Loc.GetString(record.JobTitle))); var species = Loc.GetString(prototypeManager.Index(record.Species).Name); Species.Text = Loc.GetString("general-station-record-console-record-species", ("species", species)); Gender.Text = Loc.GetString("general-station-record-console-record-gender", ("gender", record.Gender.ToString())); Fingerprint.Text = Loc.GetString("general-station-record-console-record-fingerprint", ("fingerprint", record.Fingerprint ?? Loc.GetString("generic-not-available-shorthand"))); Dna.Text = Loc.GetString("general-station-record-console-record-dna", ("dna", record.DNA ?? Loc.GetString("generic-not-available-shorthand"))); if (canDelete && id != null) { DeleteButton.Visible = true; DeleteButton.OnPressed += _ => OnDeletePressed?.Invoke(id.Value); } } }