From 6068c23f06cd798bbae02478b70214d727ed7913 Mon Sep 17 00:00:00 2001 From: ScarKy0 <106310278+ScarKy0@users.noreply.github.com> Date: Wed, 4 Sep 2024 00:05:02 +0200 Subject: [PATCH] Station AI has their name displayed in announcements now. (#31802) * Station AI has their name displayed in announcements now. * I'm so sorry * Corrections * part 2 * part 3 :| * part 4 * Whitespace * Fixing whitespace part 1 * No more whitespace * PLEASE NO MORE WHITESPACE --- .../StationAi/SharedStationAiSystem.Held.cs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Content.Shared/Silicons/StationAi/SharedStationAiSystem.Held.cs b/Content.Shared/Silicons/StationAi/SharedStationAiSystem.Held.cs index a6c57f5940..c59c472307 100644 --- a/Content.Shared/Silicons/StationAi/SharedStationAiSystem.Held.cs +++ b/Content.Shared/Silicons/StationAi/SharedStationAiSystem.Held.cs @@ -1,5 +1,6 @@ using System.Diagnostics.CodeAnalysis; using Content.Shared.Actions.Events; +using Content.Shared.IdentityManagement; using Content.Shared.Interaction.Events; using Content.Shared.Verbs; using Robust.Shared.Serialization; @@ -12,6 +13,9 @@ public abstract partial class SharedStationAiSystem /* * Added when an entity is inserted into a StationAiCore. */ + + //TODO: Fix this, please + private const string JobNameLocId = "job-name-station-ai"; private void InitializeHeld() { @@ -22,6 +26,22 @@ public abstract partial class SharedStationAiSystem SubscribeLocalEvent(OnHeldInteraction); SubscribeLocalEvent(OnHeldRelay); SubscribeLocalEvent(OnCoreJump); + SubscribeLocalEvent(OnTryGetIdentityShortInfo); + } + + private void OnTryGetIdentityShortInfo(TryGetIdentityShortInfoEvent args) + { + if (args.Handled) + { + return; + } + + if (!HasComp(args.ForActor)) + { + return; + } + args.Title = $"{Name(args.ForActor)} ({Loc.GetString(JobNameLocId)})"; + args.Handled = true; } private void OnCoreJump(Entity ent, ref JumpToCoreEvent args) -- 2.51.2