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

@@ -2,6 +2,8 @@ using Content.Server.Power.EntitySystems;
using Content.Server.Research.Components;
using Content.Shared.UserInterface;
using Content.Shared.Access.Components;
using Content.Shared.Emag.Components;
using Content.Shared.IdentityManagement;
using Content.Shared.Research.Components;
using Content.Shared.Research.Prototypes;
@@ -37,10 +39,20 @@ public sealed partial class ResearchSystem
if (!UnlockTechnology(uid, args.Id, act))
return;
var message = Loc.GetString("research-console-unlock-technology-radio-broadcast",
("technology", Loc.GetString(technologyPrototype.Name)),
("amount", technologyPrototype.Cost));
_radio.SendRadioMessage(uid, message, component.AnnouncementChannel, uid, escapeMarkup: false);
if (!HasComp<EmaggedComponent>(uid))
{
var getIdentityEvent = new TryGetIdentityShortInfoEvent(uid, act);
RaiseLocalEvent(getIdentityEvent);
var message = Loc.GetString(
"research-console-unlock-technology-radio-broadcast",
("technology", Loc.GetString(technologyPrototype.Name)),
("amount", technologyPrototype.Cost),
("approver", getIdentityEvent.Title ?? string.Empty)
);
_radio.SendRadioMessage(uid, message, component.AnnouncementChannel, uid, escapeMarkup: false);
}
SyncClientWithServer(uid);
UpdateConsoleInterface(uid, component);
}
@@ -87,4 +99,5 @@ public sealed partial class ResearchSystem
{
UpdateConsoleInterface(uid, component);
}
}