Files
Delta-v/Content.Shared/_DV/Silicon/SiliconPdaScreenSystem.cs
T
pathetic meowmeow ab62d18431 Give silicons PDAs (#5738)
* Give silicons PDAs

* unsaved

* borgos can have a little notification as a treat

* .Value
2026-05-09 22:19:47 +00:00

31 lines
853 B
C#

using Content.Shared.Actions;
using Content.Shared.PDA;
using Robust.Shared.GameObjects;
using Robust.Shared.Player;
namespace Content.Shared._DV.Silicon;
public sealed class SiliconPdaScreenSystem : EntitySystem
{
[Dependency] private readonly SharedUserInterfaceSystem _userInterface = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<PdaComponent, TogglePdaScreenEvent>(OnTogglePdaScreen);
}
private void OnTogglePdaScreen(Entity<PdaComponent> ent, ref TogglePdaScreenEvent args)
{
if (args.Handled || !TryComp<ActorComponent>(ent, out var actor))
return;
args.Handled = true;
_userInterface.TryToggleUi(ent.Owner, PdaUiKey.Key, actor.PlayerSession);
}
}
public sealed partial class TogglePdaScreenEvent : InstantActionEvent;