Skip to content

Commit

Permalink
Station AI has their name displayed in announcements now. (space-wiza…
Browse files Browse the repository at this point in the history
…rds#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
  • Loading branch information
ScarKy0 authored Sep 3, 2024
1 parent 0f1d852 commit 6068c23
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Content.Shared/Silicons/StationAi/SharedStationAiSystem.Held.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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()
{
Expand All @@ -22,6 +26,22 @@ private void InitializeHeld()
SubscribeLocalEvent<StationAiHeldComponent, InteractionAttemptEvent>(OnHeldInteraction);
SubscribeLocalEvent<StationAiHeldComponent, AttemptRelayActionComponentChangeEvent>(OnHeldRelay);
SubscribeLocalEvent<StationAiHeldComponent, JumpToCoreEvent>(OnCoreJump);
SubscribeLocalEvent<TryGetIdentityShortInfoEvent>(OnTryGetIdentityShortInfo);
}

private void OnTryGetIdentityShortInfo(TryGetIdentityShortInfoEvent args)
{
if (args.Handled)
{
return;
}

if (!HasComp<StationAiHeldComponent>(args.ForActor))
{
return;
}
args.Title = $"{Name(args.ForActor)} ({Loc.GetString(JobNameLocId)})";
args.Handled = true;
}

private void OnCoreJump(Entity<StationAiHeldComponent> ent, ref JumpToCoreEvent args)
Expand Down

0 comments on commit 6068c23

Please sign in to comment.