From f6fe9ce85cb0ff296d27cd6136418a249b5faa07 Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Mon, 20 Jan 2020 10:21:59 +0100 Subject: [PATCH] Show job title in character setup. --- .../UserInterface/CharacterSetupGui.cs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/Content.Client/UserInterface/CharacterSetupGui.cs b/Content.Client/UserInterface/CharacterSetupGui.cs index e3e210dfb2..e058047a0d 100644 --- a/Content.Client/UserInterface/CharacterSetupGui.cs +++ b/Content.Client/UserInterface/CharacterSetupGui.cs @@ -1,6 +1,8 @@ -using Content.Client.GameObjects.Components.Mobs; +using System.Linq; +using Content.Client.GameObjects.Components.Mobs; using Content.Client.Interfaces; using Content.Client.Utility; +using Content.Shared.Jobs; using Content.Shared.Preferences; using Robust.Client.GameObjects; using Robust.Client.Graphics.Drawing; @@ -8,6 +10,7 @@ using Robust.Client.Interfaces.ResourceManagement; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; using Robust.Shared.Interfaces.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Localization; using Robust.Shared.Map; using Robust.Shared.Maths; @@ -209,7 +212,8 @@ namespace Content.Client.UserInterface _previewDummy = entityManager.SpawnEntityAt("HumanMob_Dummy", new MapCoordinates(Vector2.Zero, MapId.Nullspace)); _previewDummy.GetComponent().UpdateFromProfile(profile); - if (profile is HumanoidCharacterProfile humanoid) + var humanoid = profile as HumanoidCharacterProfile; + if (humanoid != null) { LobbyCharacterPreviewPanel.GiveDummyJobClothes(_previewDummy, humanoid); } @@ -235,9 +239,18 @@ namespace Content.Client.UserInterface OverrideDirection = Direction.South }; + var description = profile.Name; + + var highPriorityJob = humanoid?.JobPriorities.SingleOrDefault(p => p.Value == JobPriority.High).Key; + if (highPriorityJob != null) + { + var jobName = IoCManager.Resolve().Index(highPriorityJob).Name; + description = $"{description}\n{jobName}"; + } + var descriptionLabel = new Label { - Text = $"{profile.Name}\nAssistant" //TODO implement job selection + Text = description }; var deleteButton = new Button {