Files
OldThink/Content.Client/Ghost/GhostComponent.cs

34 lines
924 B
C#
Raw Normal View History

using Content.Client.Ghost.UI;
2021-06-09 22:19:39 +02:00
using Content.Shared.Ghost;
2020-04-05 02:29:04 +02:00
using Robust.Client.Player;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
2021-06-09 22:19:39 +02:00
namespace Content.Client.Ghost
{
[RegisterComponent]
2021-10-24 15:29:38 +13:00
[ComponentReference(typeof(SharedGhostComponent))]
public sealed 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)
2020-03-03 19:10:07 +01:00
{
base.HandleComponentState(curState, nextState);
if (curState is not GhostComponentState)
2020-04-05 02:29:04 +02:00
{
return;
2020-04-05 02:29:04 +02:00
}
if (Owner == _playerManager.LocalPlayer?.ControlledEntity)
{
Gui?.Update();
}
}
}
}