2020-09-13 14:23:52 +02:00
|
|
|
|
using Content.Shared.GameObjects.Components.ActionBlocking;
|
2020-08-25 08:54:23 -04:00
|
|
|
|
using Robust.Client.GameObjects;
|
2020-09-13 14:23:52 +02:00
|
|
|
|
using Robust.Client.Graphics;
|
|
|
|
|
|
using Robust.Shared.GameObjects;
|
2020-08-25 08:54:23 -04:00
|
|
|
|
|
|
|
|
|
|
namespace Content.Client.GameObjects.Components.ActionBlocking
|
|
|
|
|
|
{
|
|
|
|
|
|
[RegisterComponent]
|
|
|
|
|
|
public class HandcuffComponent : SharedHandcuffComponent
|
|
|
|
|
|
{
|
|
|
|
|
|
public override void HandleComponentState(ComponentState curState, ComponentState nextState)
|
|
|
|
|
|
{
|
|
|
|
|
|
var cuffState = curState as HandcuffedComponentState;
|
|
|
|
|
|
|
|
|
|
|
|
if (cuffState == null || cuffState.IconState == string.Empty)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (Owner.TryGetComponent<SpriteComponent>(out var sprite))
|
|
|
|
|
|
{
|
|
|
|
|
|
sprite.LayerSetState(0, new RSI.StateId(cuffState.IconState)); // TODO: safety check to see if RSI contains the state?
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|