Skip to content

Commit ca1db0b

Browse files
committed
language Add
1 parent 2608f37 commit ca1db0b

File tree

12 files changed

+88
-16
lines changed

12 files changed

+88
-16
lines changed

Content.Client/CriminalRecords/CriminalRecordsConsoleWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
StyleClasses="LabelBig" />
6363
<BoxContainer Orientation="Horizontal"
6464
Margin="0 0 0 5">
65-
<Label Text="{Loc 'crew-monitoring-user-interface-job'}"
65+
<Label Text="{Loc 'crew-monitoring-ui-job-label'}"
6666
FontColorOverride="DarkGray" />
6767
<TextureRect Name="PersonJobIcon"
6868
TextureScale="2 2"

Content.Client/CriminalRecords/CriminalRecordsConsoleWindow.xaml.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Content.Client.UserInterface.Controls;
2+
using Content.Shared._WL.Languages;
23
using Content.Shared._WL.Records; // WL-Records-Start
34
using Content.Shared.Access.Systems;
45
using Content.Shared.Administration;
@@ -8,7 +9,9 @@
89
using Content.Shared.Random.Helpers;
910
using Content.Shared.Security;
1011
using Content.Shared.StationRecords;
12+
using Content.Shared.StatusIcon;
1113
using Robust.Client.AutoGenerated;
14+
using Robust.Client.GameObjects;
1215
using Robust.Client.Player;
1316
using Robust.Client.UserInterface.Controls;
1417
using Robust.Client.UserInterface.XAML;
@@ -17,8 +20,6 @@
1720
using Robust.Shared.Utility;
1821
using System.Linq;
1922
using System.Numerics;
20-
using Content.Shared.StatusIcon;
21-
using Robust.Client.GameObjects;
2223

2324
namespace Content.Client.CriminalRecords;
2425

@@ -280,9 +281,12 @@ private void PopulateRecordContainer(GeneralStationRecord stationRecord, Crimina
280281
}
281282

282283
// WL-Records-Start
283-
var confederation = !string.IsNullOrEmpty(stationRecord.Confederation)
284-
? Loc.GetString(_proto.Index<ConfederationRecordsPrototype>(stationRecord.Confederation).Name)
285-
: "N/A";
284+
var confederation = string.Empty;
285+
286+
if (_proto.TryIndex<ConfederationRecordsPrototype>(stationRecord.Confederation, out var protoConf))
287+
confederation = Loc.GetString(protoConf.Name);
288+
else
289+
confederation = Loc.GetString("generic-not-available-shorthand");
286290

287291
SecurityRecord.Text = $"""
288292
{Loc.GetString("records-full-name-edit")} {(!string.IsNullOrEmpty(stationRecord.Fullname)

Content.Client/StationRecords/GeneralRecord.xaml.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
using Content.Shared.StationRecords;
1+
using Content.Shared._WL.Languages;
22
using Content.Shared._WL.Records; // WL-Records
33
using Content.Shared.Humanoid.Prototypes;
4+
using Content.Shared.StationRecords;
45
using Robust.Client.AutoGenerated;
56
using Robust.Client.UserInterface;
67
using Robust.Client.UserInterface.XAML;
@@ -27,10 +28,22 @@ public GeneralRecord(GeneralStationRecord record, bool canDelete, uint? id, IPro
2728
var confederation = string.Empty;
2829

2930
if (prototypeManager.TryIndex<ConfederationRecordsPrototype>(record.Confederation, out var proto))
30-
confederation = proto.Name;
31+
confederation = Loc.GetString(proto.Name);
3132
else
3233
confederation = Loc.GetString("generic-not-available-shorthand");
3334

35+
string languages = string.Empty;
36+
37+
for (int i = 0; i < record.Languages.Count; i++)
38+
{
39+
languages += Loc.GetString(prototypeManager.Index<LanguagePrototype>(record.Languages[i]).Name);
40+
41+
if (i != record.Languages.Count - 1)
42+
languages += ", ";
43+
else
44+
languages += ".";
45+
}
46+
3447
Record.Text = $"""
3548
{Loc.GetString("records-full-name-edit")} {(!string.IsNullOrEmpty(record.Fullname)
3649
? record.Fullname : record.Name)}
@@ -40,6 +53,7 @@ public GeneralRecord(GeneralStationRecord record, bool canDelete, uint? id, IPro
4053
{Loc.GetString("records-country-edit")} {(!string.IsNullOrEmpty(record.Country)
4154
? record.Country : Loc.GetString("generic-not-available-shorthand"))}
4255
{Loc.GetString("records-species")} {Loc.GetString(prototypeManager.Index<SpeciesPrototype>(record.Species).Name)}
56+
{Loc.GetString("records-language")} {languages}
4357
{(!string.IsNullOrEmpty(record.EmploymentRecord) ? record.EmploymentRecord
4458
: Loc.GetString("general-station-console-no-employment-record"))}
4559
""";

Content.Client/_WL/MedicalRecords/MedicalRecordsConsoleWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
StyleClasses="LabelBig" />
5757
<BoxContainer Orientation="Horizontal"
5858
Margin="0 0 0 5">
59-
<Label Text="{Loc 'crew-monitoring-user-interface-job'}"
59+
<Label Text="{Loc 'crew-monitoring-ui-job-label'}"
6060
FontColorOverride="DarkGray" />
6161
<Label Name="PersonJob" />
6262
</BoxContainer>

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Content.Client.UserInterface.Controls;
2+
using Content.Shared._WL.Languages;
23
using Content.Shared._WL.MedicalRecords;
34
using Content.Shared._WL.Records;
45
using Content.Shared.Humanoid.Prototypes;
@@ -119,13 +120,26 @@ private void PopulateRecordContainer(GeneralStationRecord stationRecord)
119120

120121
private string GenerateMedicalRecord(GeneralStationRecord stationRecord)
121122
{
123+
string languages = string.Empty;
124+
125+
for (int i = 0; i < stationRecord.Languages.Count; i++)
126+
{
127+
languages += Loc.GetString(_prototypeManager.Index<LanguagePrototype>(stationRecord.Languages[i]).Name);
128+
129+
if (i != stationRecord.Languages.Count - 1)
130+
languages += ", ";
131+
else
132+
languages += ".";
133+
}
134+
122135
var medicalRecord = $"""
123136
{Loc.GetString("records-full-name-edit")} {(!string.IsNullOrEmpty(stationRecord.Fullname)
124137
? stationRecord.Fullname : stationRecord.Name)}
125138
{Loc.GetString("records-date-of-birth-edit")} {(!string.IsNullOrEmpty(stationRecord.DateOfBirth)
126139
? stationRecord.DateOfBirth : Loc.GetString("generic-not-available-shorthand"))}
127140
{Loc.GetString("records-species")} {Loc.GetString(_prototypeManager.Index<SpeciesPrototype>(stationRecord.Species).Name)}
128141
{Loc.GetString("records-height", ("height", stationRecord.Height))}
142+
{Loc.GetString("records-language")} {languages}
129143
{(!string.IsNullOrEmpty(stationRecord.MedicalRecord) ? stationRecord.MedicalRecord
130144
: Loc.GetString("medical-records-console-no-record"))}
131145
""";

Content.Server/CriminalRecords/Systems/CriminalRecordsConsoleSystem.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
using Content.Shared.Security.Components;
2323
using System.Linq;
2424
using Content.Shared.Roles.Jobs;
25+
using Content.Shared._WL.Languages;
2526

2627
namespace Content.Server.CriminalRecords.Systems;
2728

@@ -106,7 +107,7 @@ private void OnPrinted(Entity<CriminalRecordsConsoleComponent> ent, ref PrintSta
106107
var confederation = string.Empty;
107108

108109
if (_prototypeManager.TryIndex<ConfederationRecordsPrototype>(record.Confederation, out var proto))
109-
confederation = proto.Name;
110+
confederation = Loc.GetString(proto.Name);
110111
else
111112
confederation = Loc.GetString("generic-not-available-shorthand");
112113

Content.Server/StationRecords/Systems/GeneralStationRecordConsoleSystem.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Content.Server.Power.Components; // WL-Records
22
using Content.Server.Station.Systems;
33
using Content.Server.StationRecords.Components;
4+
using Content.Shared._WL.Languages;
45
using Content.Shared._WL.Records;
56
using Content.Shared.Humanoid.Prototypes; // WL-Records
67
using Content.Shared.Paper;
@@ -79,10 +80,22 @@ private void OnRecordPrint(Entity<GeneralStationRecordConsoleComponent> ent, ref
7980
var confederation = string.Empty;
8081

8182
if (_prototypeManager.TryIndex<ConfederationRecordsPrototype>(record.Confederation, out var proto))
82-
confederation = proto.Name;
83+
confederation = Loc.GetString(proto.Name);
8384
else
8485
confederation = Loc.GetString("generic-not-available-shorthand");
8586

87+
string languages = string.Empty;
88+
89+
for (int i = 0; i < record.Languages.Count; i++)
90+
{
91+
languages += Loc.GetString(_prototypeManager.Index<LanguagePrototype>(record.Languages[i]).Name);
92+
93+
if (i != record.Languages.Count - 1)
94+
languages += ", ";
95+
else
96+
languages += ".";
97+
}
98+
8699
ent.Comp.ContextPrint = $"""
87100
{Loc.GetString("records-full-name-edit")} {(!string.IsNullOrEmpty(record.Fullname)
88101
? record.Fullname : record.Name)}
@@ -92,6 +105,7 @@ private void OnRecordPrint(Entity<GeneralStationRecordConsoleComponent> ent, ref
92105
{Loc.GetString("records-country-edit")} {(!string.IsNullOrEmpty(record.Country)
93106
? record.Country : Loc.GetString("generic-not-available-shorthand"))}
94107
{Loc.GetString("records-species")} {Loc.GetString(_prototypeManager.Index<SpeciesPrototype>(record.Species).Name)}
108+
{Loc.GetString("records-language")} {languages}
95109
{(!string.IsNullOrEmpty(record.EmploymentRecord) ? record.EmploymentRecord
96110
: Loc.GetString("general-station-console-no-employment-record"))}
97111
""";

Content.Server/StationRecords/Systems/StationRecordsSystem.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
using Robust.Shared.Enums;
1616
using Robust.Shared.Prototypes;
1717
using Robust.Shared.Random;
18+
using Content.Shared._WL.Languages;
19+
using Content.Shared._WL.Languages.Components;
1820

1921
namespace Content.Server.StationRecords.Systems;
2022

@@ -98,12 +100,16 @@ private void CreateGeneralRecord(EntityUid station, EntityUid player, HumanoidCh
98100
if (!_inventory.TryGetSlotEntity(player, "id", out var idUid))
99101
return;
100102

103+
TryComp<LanguagesComponent>(player, out var languages);
101104
TryComp<FingerprintComponent>(player, out var fingerprintComponent);
102105
TryComp<DnaComponent>(player, out var dnaComponent);
103106

107+
if (languages == null)
108+
return;
109+
104110
var jobName = _role.GetSubnameByEntity(player, jobId) ?? jobProto.LocalizedName; //WL-changes
105111

106-
CreateGeneralRecord(station, idUid.Value, profile.Name, profile.Age, profile.Species, profile.Gender, profile.MedicalRecord, profile.SecurityRecord, profile.EmploymentRecord, profile.FullName, profile.DateOfBirth, profile.Confederation, profile.Country, profile.Height, jobId, jobName, fingerprintComponent?.Fingerprint, dnaComponent?.DNA, profile, records); //WL-changes
112+
CreateGeneralRecord(station, idUid.Value, profile.Name, profile.Age, profile.Species, profile.Gender, profile.MedicalRecord, profile.SecurityRecord, profile.EmploymentRecord, profile.FullName, profile.DateOfBirth, profile.Confederation, profile.Country, profile.Height, languages.Speaking, jobId, jobName, fingerprintComponent?.Fingerprint, dnaComponent?.DNA, profile, records); //WL-changes
107113
}
108114

109115

@@ -150,6 +156,7 @@ public void CreateGeneralRecord(
150156
string confederation,
151157
string country,
152158
int height,
159+
List<ProtoId<LanguagePrototype>> languages,
153160
// WL-Records-end
154161
string jobId,
155162
string jobName,
@@ -187,6 +194,7 @@ public void CreateGeneralRecord(
187194
Confederation = confederation,
188195
Country = country,
189196
Height = height,
197+
Languages = languages,
190198
// WL-Records-end
191199
DisplayPriority = jobPrototype.RealDisplayWeight,
192200
Fingerprint = mobFingerprint,

Content.Server/_WL/MedicalRecords/MedicalRecordsConsoleSystem.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using Content.Server.Station.Systems;
33
using Content.Server.StationRecords;
44
using Content.Server.StationRecords.Systems;
5+
using Content.Shared._WL.Languages;
56
using Content.Shared._WL.MedicalRecords;
67
using Content.Shared._WL.MedicalRecords.Components;
78
using Content.Shared._WL.Records;
@@ -82,6 +83,17 @@ private void OnPrinted(Entity<MedicalRecordsConsoleComponent> ent, ref PrintStat
8283

8384
if (_records.TryGetRecord<GeneralStationRecord>(new StationRecordKey(msg.Id, owning.Value), out var record))
8485
{
86+
string languages = string.Empty;
87+
88+
for (int i = 0; i < record.Languages.Count; i++)
89+
{
90+
languages += Loc.GetString(_prototypeManager.Index<LanguagePrototype>(record.Languages[i]).Name);
91+
92+
if (i != record.Languages.Count - 1)
93+
languages += ", ";
94+
else
95+
languages += ".";
96+
}
8597

8698
ent.Comp.ContextPrint = $"""
8799
{Loc.GetString("records-full-name-edit")} {(!string.IsNullOrEmpty(record.Fullname)
@@ -90,6 +102,7 @@ private void OnPrinted(Entity<MedicalRecordsConsoleComponent> ent, ref PrintStat
90102
? record.DateOfBirth : Loc.GetString("generic-not-available-shorthand"))}
91103
{Loc.GetString("records-species")} {Loc.GetString(_prototypeManager.Index<SpeciesPrototype>(record.Species).Name)}
92104
{Loc.GetString("records-height", ("height", record.Height))}
105+
{Loc.GetString("records-language")} {languages}
93106
{(!string.IsNullOrEmpty(record.SecurityRecord) ? record.SecurityRecord
94107
: Loc.GetString("medical-records-console-no-record"))}
95108
""";

Content.Shared/StationRecords/GeneralStationRecord.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
using Content.Shared._WL.Languages;
12
using Content.Shared.CrewManifest;
23
using Robust.Shared.Enums;
4+
using Robust.Shared.Prototypes;
35
using Robust.Shared.Serialization;
46

57
namespace Content.Shared.StationRecords;
@@ -75,6 +77,9 @@ public sealed record GeneralStationRecord
7577
[DataField]
7678
public int Height;
7779

80+
[DataField]
81+
public List<ProtoId<LanguagePrototype>> Languages = [];
82+
7883
// WL-Records-End
7984

8085
/// <summary>

0 commit comments

Comments
 (0)