Fix crew manifest sorting (#13286)

This commit is contained in:
Theomund
2023-01-08 22:34:43 -05:00
committed by GitHub
parent 5018c80152
commit f7629adb3e
2 changed files with 3 additions and 11 deletions

View File

@@ -106,21 +106,13 @@ public sealed partial class CrewManifestUi : DefaultWindow
if (Loc.TryGetString($"department-{sectionTitle}", out var localizedDepart))
sectionTitle = localizedDepart;
AddChild(new Label()
{
StyleClasses = { "LabelBig" },
Text = Loc.GetString(sectionTitle)
});
entries.Sort((a, b) =>
{
var posA = crewManifestSystem.GetDepartmentOrder(sectionTitle, a.JobPrototype);
var posB = crewManifestSystem.GetDepartmentOrder(sectionTitle, b.JobPrototype);
return posA.CompareTo(posB);
});
var gridContainer = new GridContainer()
{
HorizontalExpand = true,
@@ -147,7 +139,7 @@ public sealed partial class CrewManifestUi : DefaultWindow
};
var title = new RichTextLabel();
title.SetMessage(Loc.GetString(entry.JobTitle));
title.SetMessage(entry.JobTitle);
if (rsi != null)

View File

@@ -116,7 +116,7 @@ public sealed class StationRecordsSystem : EntitySystem
{
Name = name,
Age = age,
JobTitle = jobPrototype.Name,
JobTitle = jobPrototype.LocalizedName,
JobIcon = jobPrototype.Icon,
JobPrototype = jobId,
Species = species,