Files
tbd-station-14/Content.Client/Radio/EntitySystems/RadioDeviceSystem.cs
slarticodefast 321331e664 move all the radio components and system to Shared (#40293)
* move all the radio components and system to Shared.

* duh split impl

* address reviews

* cleanup

---------

Co-authored-by: walksanatora <walkerffo22@gmail.com>
2025-09-12 01:26:47 +02:00

25 lines
773 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 class RadioDeviceSystem : SharedRadioDeviceSystem
{
[Dependency] private readonly 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);
}
}