* fix species name in station records * the hellish commit * Update GeneralStationRecordConsoleWindow.xaml.cs * fix --------- Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
37 lines
1.7 KiB
C#
37 lines
1.7 KiB
C#
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<uint>? 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<SpeciesPrototype>(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);
|
|
}
|
|
}
|
|
}
|