feat: now when research is unlocked in console, approver of reasearch is radio-ed too (#31170)

* feat: now when research is unlocked in console, approver of reasearch is radio-ed too

* refactor: now most of events that require actor name to be radio-ed or logged use TryGetIdentityShortInfoEvent which is subscibed by id-card system and borg system (to work for both carbon and synthetic life-forms)

* refactor: moved TryGetIdentityShortInfoEvent on id card system to shared, fixed cargo cent-com-originated orders

* remove unused check

* refactor: decoupled systems from IdCardSystem (those that are not dependent on it anymore)

* refactor: removed unuseed usings

* feat: emagged cargo/research consoles wont radio messages on buy/research confirm anymore

---------

Co-authored-by: pa.pecherskij <pa.pecherskij@interfax.ru>
This commit is contained in:
Fildrance
2024-09-03 16:01:38 +03:00
committed by GitHub
parent 894d4980f5
commit 6380a9adca
13 changed files with 141 additions and 50 deletions

View File

@@ -1,15 +1,11 @@
using System.Globalization;
using Content.Server.Access.Systems;
using Content.Server.Administration.Logs;
using Content.Server.AlertLevel;
using Content.Server.Chat.Systems;
using Content.Server.DeviceNetwork;
using Content.Server.DeviceNetwork.Components;
using Content.Server.DeviceNetwork.Systems;
using Content.Server.Interaction;
using Content.Server.Popups;
using Content.Server.RoundEnd;
using Content.Server.Screens;
using Content.Server.Screens.Components;
using Content.Server.Shuttles.Systems;
using Content.Server.Station.Systems;
@@ -21,8 +17,8 @@ using Content.Shared.Communications;
using Content.Shared.Database;
using Content.Shared.DeviceNetwork;
using Content.Shared.Emag.Components;
using Content.Shared.IdentityManagement;
using Content.Shared.Popups;
using Content.Shared.Silicons.Borgs.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Configuration;
@@ -35,7 +31,6 @@ namespace Content.Server.Communications
[Dependency] private readonly ChatSystem _chatSystem = default!;
[Dependency] private readonly DeviceNetworkSystem _deviceNetworkSystem = default!;
[Dependency] private readonly EmergencyShuttleSystem _emergency = default!;
[Dependency] private readonly IdCardSystem _idCardSystem = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly RoundEndSystem _roundEndSystem = default!;
[Dependency] private readonly StationSystem _stationSystem = default!;
@@ -251,17 +246,9 @@ 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();
}
var tryGetIdentityShortInfoEvent = new TryGetIdentityShortInfoEvent(uid, mob);
RaiseLocalEvent(tryGetIdentityShortInfoEvent);
author = tryGetIdentityShortInfoEvent.Title;
}
comp.AnnouncementCooldownRemaining = comp.Delay;