From: ScarKy0 <106310278+ScarKy0@users.noreply.github.com> Date: Tue, 3 Sep 2024 22:05:02 +0000 (+0200) Subject: Station AI has their name displayed in announcements now. (#31802) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=6068c23f06cd798bbae02478b70214d727ed7913;p=space-station-14.git 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 --- 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)