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:
@@ -8,11 +8,11 @@ using Content.Shared.Hands.EntitySystems;
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.NameIdentifier;
|
||||
using Content.Shared.PDA;
|
||||
using Content.Shared.Silicons.Borgs.Components;
|
||||
using Content.Shared.StationRecords;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameStates;
|
||||
using Content.Shared.GameTicking;
|
||||
using Content.Shared.IdentityManagement;
|
||||
using Robust.Shared.Collections;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Timing;
|
||||
@@ -26,7 +26,6 @@ public sealed class AccessReaderSystem : EntitySystem
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
[Dependency] private readonly SharedGameTicker _gameTicker = default!;
|
||||
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
|
||||
[Dependency] private readonly SharedIdCardSystem _idCardSystem = default!;
|
||||
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
|
||||
[Dependency] private readonly SharedStationRecordsSystem _recordsSystem = default!;
|
||||
|
||||
@@ -402,9 +401,12 @@ public sealed class AccessReaderSystem : EntitySystem
|
||||
|
||||
// TODO pass the ID card on IsAllowed() instead of using this expensive method
|
||||
// Set name if the accessor has a card and that card has a name and allows itself to be recorded
|
||||
if (_idCardSystem.TryFindIdCard(accessor, out var idCard)
|
||||
&& idCard.Comp is { BypassLogging: false, FullName: not null })
|
||||
name = idCard.Comp.FullName;
|
||||
var getIdentityShortInfoEvent = new TryGetIdentityShortInfoEvent(ent, accessor, true);
|
||||
RaiseLocalEvent(getIdentityShortInfoEvent);
|
||||
if (getIdentityShortInfoEvent.Title != null)
|
||||
{
|
||||
name = getIdentityShortInfoEvent.Title;
|
||||
}
|
||||
|
||||
LogAccess(ent, name ?? Loc.GetString("access-reader-unknown-id"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user