mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* IoC source gen compatibility Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter. * Missed a spot
24 lines
772 B
C#
24 lines
772 B
C#
using Content.Client.Radio.Ui;
|
|
using Content.Shared.Radio;
|
|
using Content.Shared.Radio.Components;
|
|
using Content.Shared.Radio.EntitySystems;
|
|
using Robust.Client.GameObjects;
|
|
|
|
namespace Content.Client.Radio.EntitySystems;
|
|
|
|
public sealed partial class RadioDeviceSystem : SharedRadioDeviceSystem
|
|
{
|
|
[Dependency] private UserInterfaceSystem _ui = default!;
|
|
|
|
/// <inheritdoc/>
|
|
public override void Initialize()
|
|
{
|
|
SubscribeLocalEvent<IntercomComponent, AfterAutoHandleStateEvent>(OnAfterHandleState);
|
|
}
|
|
|
|
private void OnAfterHandleState(Entity<IntercomComponent> ent, ref AfterAutoHandleStateEvent args)
|
|
{
|
|
if (_ui.TryGetOpenUi<IntercomBoundUserInterface>(ent.Owner, IntercomUiKey.Key, out var bui))
|
|
bui.Update(ent);
|
|
}
|
|
}
|