Files
tbd-station-14/Content.Server/Body/Components/BodyScannerComponent.cs
Rane 926e36d81d Convert almost all IActivate instances that open UIs to ActivatableUI (#7028)
* Chem master

* Drone support for handhelds

* Vending machines, scanners

* Cloners, R&D computers

* make research a little less sussy

* Unfuck wires

* PA control computer

* Unfuck merge

* Clean up git gore for good

* Disposals

* Microwaves

* paper

* Magic mirror

* More vendors for drones

* Solar computer whitelist

* EFR review updates
2022-03-12 11:26:06 -07:00

37 lines
1.2 KiB
C#

using Content.Server.UserInterface;
using Content.Shared.Body.Components;
using Robust.Server.GameObjects;
namespace Content.Server.Body.Components
{
[RegisterComponent]
[ComponentReference(typeof(SharedBodyScannerComponent))]
public sealed class BodyScannerComponent : SharedBodyScannerComponent
{
[Dependency] private readonly IEntityManager _entMan = default!;
[ViewVariables] private BoundUserInterface? UserInterface => Owner.GetUIOrNull(BodyScannerUiKey.Key);
protected override void Initialize()
{
base.Initialize();
Owner.EnsureComponentWarn<ServerUserInterfaceComponent>();
if (UserInterface != null)
{
UserInterface.OnReceiveMessage += UserInterfaceOnOnReceiveMessage;
}
}
private void UserInterfaceOnOnReceiveMessage(ServerBoundUserInterfaceMessage serverMsg) { }
/// <summary>
/// Copy BodyTemplate and BodyPart data into a common data class that the client can read.
/// </summary>
private BodyScannerUIState InterfaceState(SharedBodyComponent body)
{
return new(body.Owner);
}
}
}