Skip to content

Commit 2608f37

Browse files
committed
fix
1 parent 4297bd9 commit 2608f37

File tree

9 files changed

+36
-27
lines changed

9 files changed

+36
-27
lines changed

Content.Client/StationRecords/GeneralRecord.xaml.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@ public GeneralRecord(GeneralStationRecord record, bool canDelete, uint? id, IPro
2424
// Gender.Text = Loc.GetString("general-station-record-console-record-gender",
2525
// ("gender", record.Gender.ToString()));
2626

27-
var confederation = !string.IsNullOrEmpty(record.Confederation)
28-
? prototypeManager.Index<ConfederationRecordsPrototype>(record.Confederation).Name
29-
: Loc.GetString("generic-not-available-shorthand");
27+
var confederation = string.Empty;
28+
29+
if (prototypeManager.TryIndex<ConfederationRecordsPrototype>(record.Confederation, out var proto))
30+
confederation = proto.Name;
31+
else
32+
confederation = Loc.GetString("generic-not-available-shorthand");
3033

3134
Record.Text = $"""
3235
{Loc.GetString("records-full-name-edit")} {(!string.IsNullOrEmpty(record.Fullname)

Content.Client/_WL/MedicalRecords/MedicalRecordsConsoleWindow.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public void UpdateState(MedicalRecordsConsoleState state)
8484
PopulateRecordContainer(state.StationRecord);
8585
}
8686

87-
PrintButton.Disabled = !state.CanPrintedRecords;
87+
PrintButton.Disabled = !state.CanPrintRecords;
8888
}
8989

9090
private void PopulateRecordListing(Dictionary<uint, string>? listing)
@@ -126,7 +126,7 @@ private string GenerateMedicalRecord(GeneralStationRecord stationRecord)
126126
? stationRecord.DateOfBirth : Loc.GetString("generic-not-available-shorthand"))}
127127
{Loc.GetString("records-species")} {Loc.GetString(_prototypeManager.Index<SpeciesPrototype>(stationRecord.Species).Name)}
128128
{Loc.GetString("records-height", ("height", stationRecord.Height))}
129-
{(!string.IsNullOrEmpty(stationRecord.SecurityRecord) ? stationRecord.SecurityRecord
129+
{(!string.IsNullOrEmpty(stationRecord.MedicalRecord) ? stationRecord.MedicalRecord
130130
: Loc.GetString("medical-records-console-no-record"))}
131131
""";
132132

Content.Server/CriminalRecords/Systems/CriminalRecordsConsoleSystem.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,12 @@ private void OnPrinted(Entity<CriminalRecordsConsoleComponent> ent, ref PrintSta
103103

104104
if (_records.TryGetRecord<GeneralStationRecord>(new StationRecordKey(msg.Id, owning.Value), out var record))
105105
{
106-
var confederation = !string.IsNullOrEmpty(record.Confederation)
107-
? _prototypeManager.Index<ConfederationRecordsPrototype>(record.Confederation).Name
108-
: Loc.GetString("generic-not-available-shorthand");
106+
var confederation = string.Empty;
107+
108+
if (_prototypeManager.TryIndex<ConfederationRecordsPrototype>(record.Confederation, out var proto))
109+
confederation = proto.Name;
110+
else
111+
confederation = Loc.GetString("generic-not-available-shorthand");
109112

110113
ent.Comp.ContextPrint = $"""
111114
{Loc.GetString("records-full-name-edit")} {(!string.IsNullOrEmpty(record.Fullname)
@@ -136,9 +139,9 @@ private void ProcessPrintingAnimation(EntityUid uid, float frameTime, CriminalRe
136139
{
137140
comp.TimePrintRemaining -= frameTime;
138141

139-
var PrintSoundEnd = comp.TimePrintRemaining <= 0;
142+
var printSoundEnd = comp.TimePrintRemaining <= 0;
140143

141-
if (PrintSoundEnd)
144+
if (printSoundEnd)
142145
{
143146
var printed = Spawn(comp.PrintPaperId, Transform(uid).Coordinates);
144147

Content.Server/StationRecords/Systems/GeneralStationRecordConsoleSystem.cs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,12 @@ private void OnRecordPrint(Entity<GeneralStationRecordConsoleComponent> ent, ref
7676

7777
if (_stationRecords.TryGetRecord<GeneralStationRecord>(new StationRecordKey(args.Id, owning.Value), out var record))
7878
{
79-
var confederation = !string.IsNullOrEmpty(record.Confederation)
80-
? _prototypeManager.Index<ConfederationRecordsPrototype>(record.Confederation).Name
81-
: Loc.GetString("generic-not-available-shorthand");
79+
var confederation = string.Empty;
80+
81+
if (_prototypeManager.TryIndex<ConfederationRecordsPrototype>(record.Confederation, out var proto))
82+
confederation = proto.Name;
83+
else
84+
confederation = Loc.GetString("generic-not-available-shorthand");
8285

8386
ent.Comp.ContextPrint = $"""
8487
{Loc.GetString("records-full-name-edit")} {(!string.IsNullOrEmpty(record.Fullname)
@@ -89,8 +92,8 @@ private void OnRecordPrint(Entity<GeneralStationRecordConsoleComponent> ent, ref
8992
{Loc.GetString("records-country-edit")} {(!string.IsNullOrEmpty(record.Country)
9093
? record.Country : Loc.GetString("generic-not-available-shorthand"))}
9194
{Loc.GetString("records-species")} {Loc.GetString(_prototypeManager.Index<SpeciesPrototype>(record.Species).Name)}
92-
{(!string.IsNullOrEmpty(record.EmploymentRecord) ? record.SecurityRecord
93-
: Loc.GetString("criminal-records-console-no-security-record"))}
95+
{(!string.IsNullOrEmpty(record.EmploymentRecord) ? record.EmploymentRecord
96+
: Loc.GetString("general-station-console-no-employment-record"))}
9497
""";
9598
}
9699
else
@@ -108,9 +111,9 @@ private void ProcessPrintingAnimation(EntityUid uid, float frameTime, GeneralSta
108111
{
109112
comp.TimePrintRemaining -= frameTime;
110113

111-
var PrintSoundEnd = comp.TimePrintRemaining <= 0;
114+
var printSoundEnd = comp.TimePrintRemaining <= 0;
112115

113-
if (PrintSoundEnd)
116+
if (printSoundEnd)
114117
{
115118
var printed = Spawn(comp.PrintPaperId, Transform(uid).Coordinates);
116119

Content.Server/_WL/MedicalRecords/MedicalRecordsConsoleSystem.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ private void ProcessPrintingAnimation(EntityUid uid, float frameTime, MedicalRec
109109
{
110110
comp.TimePrintRemaining -= frameTime;
111111

112-
var PrintSoundEnd = comp.TimePrintRemaining <= 0;
112+
var printSoundEnd = comp.TimePrintRemaining <= 0;
113113

114-
if (PrintSoundEnd)
114+
if (printSoundEnd)
115115
{
116116
var printed = Spawn(comp.PrintPaperId, Transform(uid).Coordinates);
117117

Content.Shared/CriminalRecords/Components/CriminalRecordsConsoleComponent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public sealed partial class CriminalRecordsConsoleComponent : Component
5555

5656
// WL-Records-Start
5757
[DataField]
58-
public bool CanPrintEntries;
58+
public bool CanPrintEntries = true;
5959

6060
[DataField]
6161
public float TimePrint = 2.3f;

Content.Shared/StationRecords/GeneralRecordsUi.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ public GeneralStationRecordConsoleState(uint? key,
4545
Dictionary<uint, string>? recordListing,
4646
StationRecordsFilter? newFilter,
4747
bool canDeleteEntries,
48-
bool canPrintRerods) // WL-Records
48+
bool canPrintRecords) // WL-Records
4949
{
5050
SelectedKey = key;
5151
Record = record;
5252
RecordListing = recordListing;
5353
Filter = newFilter;
5454
CanDeleteEntries = canDeleteEntries;
55-
CanPrintRecords = canPrintRerods; // WL-Records
55+
CanPrintRecords = canPrintRecords; // WL-Records
5656
}
5757

5858
public GeneralStationRecordConsoleState() : this(null, null, null, null, false, false) // WL-Records

Content.Shared/_WL/MedicalRecords/MedicalRecordsUi.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ public sealed class MedicalRecordsConsoleState : BoundUserInterfaceState
1616
public GeneralStationRecord? StationRecord = null;
1717
public readonly Dictionary<uint, string>? RecordListing;
1818
public readonly StationRecordsFilter? Filter;
19-
public readonly bool CanPrintedRecords;
19+
public readonly bool CanPrintRecords;
2020

21-
public MedicalRecordsConsoleState(Dictionary<uint, string>? recordListing, StationRecordsFilter? newFilter, bool canPrintedRecords)
21+
public MedicalRecordsConsoleState(Dictionary<uint, string>? recordListing, StationRecordsFilter? newFilter, bool CanPrintRecords)
2222
{
2323
RecordListing = recordListing;
2424
Filter = newFilter;
25-
CanPrintedRecords = canPrintedRecords;
25+
CanPrintRecords = CanPrintRecords;
2626
}
2727

2828
public MedicalRecordsConsoleState() : this(null, null, false) { }

Resources/Locale/ru-RU/_WL/records/records.ftl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ humanoid-profile-editor-records-tab = Записи
33
records-medical = МЕДИЦИНСКИЕ ЗАПИСИ
44
records-security = ОХРАННЫЕ ЗАПИСИ
55
records-employment = ТРУДОВЫЕ ЗАПИСИ
6-
records-general = ОБЩИЕ СВЕДЕНЬЯ
6+
records-general = ОБЩИЕ СВЕДЕНИЯ
77
88
records-template-medical = Шаблон мед.записей
99
records-template-security = Шаблон охр.записей
@@ -28,7 +28,7 @@ records-confederation-social = СоцКон
2828
records-confederation-interspecies-alliance = Межвидовой Альянс
2929
records-confederation-holy-empire-of-eden = Священная Империя Эдема
3030
records-confederation-metafront = Метафронт
31-
records-confederation-no = Нету конфедирации
31+
records-confederation-no = Нет конфедерации
3232
3333
3434
# Медицинские записи

0 commit comments

Comments
 (0)