Make the Borgs Names Appear When they Make an Announcement (#30107)

* Make the Borgs Names Appear When they Make an Announcement

* bwomp

* re-order

* Use Name instead of metadata

* goiup
This commit is contained in:
Cojoke
2024-08-13 13:31:33 -05:00
committed by GitHub
parent dba0ea76b4
commit 5d6baea7d3

View File

@@ -22,6 +22,7 @@ using Content.Shared.Database;
using Content.Shared.DeviceNetwork;
using Content.Shared.Emag.Components;
using Content.Shared.Popups;
using Content.Shared.Silicons.Borgs.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Configuration;
@@ -255,10 +256,17 @@ namespace Content.Server.Communications
return;
}
// User has an id
if (_idCardSystem.TryFindIdCard(mob, out var id))
{
author = $"{id.Comp.FullName} ({CultureInfo.CurrentCulture.TextInfo.ToTitleCase(id.Comp.JobTitle ?? string.Empty)})".Trim();
}
// User does not have an id and is a borg, so use the borg's name
if (HasComp<BorgChassisComponent>(mob))
{
author = Name(mob).Trim();
}
}
comp.AnnouncementCooldownRemaining = comp.Delay;