Files
tbd-station-14/Content.Client/Ghost/GhostComponent.cs
Visne 610ff0083f Ghost UI to XAML and minor cleanup (#4637)
* Remove unused class, clean up XAML

* Move GhostGui.cs into UI folder and namespace

* GhostTargetWindow to seperate file

* GhostTargetWindow to XAML

* Center request button

* Improve UI, localisation
2021-09-21 13:03:14 +10:00

33 lines
862 B
C#

using Content.Client.Ghost.UI;
using Content.Shared.Ghost;
using Robust.Client.Player;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
namespace Content.Client.Ghost
{
[RegisterComponent]
public class GhostComponent : SharedGhostComponent
{
[Dependency] private readonly IPlayerManager _playerManager = default!;
public GhostGui? Gui { get; set; }
public bool IsAttached { get; set; }
public override void HandleComponentState(ComponentState? curState, ComponentState? nextState)
{
base.HandleComponentState(curState, nextState);
if (curState is not GhostComponentState)
{
return;
}
if (Owner == _playerManager.LocalPlayer?.ControlledEntity)
{
Gui?.Update();
}
}
}
}