2020-08-15 20:33:42 +02:00
|
|
|
using System.Threading;
|
2021-06-09 22:19:39 +02:00
|
|
|
using Content.Shared.DragDrop;
|
|
|
|
|
using Content.Shared.Strip.Components;
|
2020-08-15 20:33:42 +02:00
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Server.Strip
|
2020-08-15 20:33:42 +02:00
|
|
|
{
|
|
|
|
|
[RegisterComponent]
|
2021-02-05 18:46:09 +11:00
|
|
|
[ComponentReference(typeof(SharedStrippableComponent))]
|
2022-06-07 15:26:28 +02:00
|
|
|
[Access(typeof(StrippableSystem))]
|
2020-10-14 15:24:07 +02:00
|
|
|
public sealed class StrippableComponent : SharedStrippableComponent
|
2020-08-15 20:33:42 +02:00
|
|
|
{
|
2022-06-19 20:55:59 -04:00
|
|
|
/// <summary>
|
|
|
|
|
/// How long it takes to open the strip menu.
|
|
|
|
|
/// This should be relatively short so it's not a hassle
|
|
|
|
|
/// but so it also doesn't open immediately during melee combat
|
|
|
|
|
/// </summary>
|
2020-09-01 12:34:53 +02:00
|
|
|
[ViewVariables]
|
2022-05-13 14:59:57 +10:00
|
|
|
[DataField("openDelay")]
|
2022-06-19 20:55:59 -04:00
|
|
|
public float OpenDelay = 1f;
|
2020-08-22 22:29:20 +02:00
|
|
|
|
2022-06-19 20:55:59 -04:00
|
|
|
/// <summary>
|
|
|
|
|
/// The strip delay for hands.
|
|
|
|
|
/// </summary>
|
2022-05-13 14:59:57 +10:00
|
|
|
[ViewVariables]
|
2022-06-19 20:55:59 -04:00
|
|
|
[DataField("handDelay")]
|
|
|
|
|
public float HandStripDelay = 3f;
|
2020-08-15 20:33:42 +02:00
|
|
|
|
2021-05-22 21:06:40 -07:00
|
|
|
public override bool Drop(DragDropEvent args)
|
2020-08-25 17:43:27 +02:00
|
|
|
{
|
2022-05-13 14:59:57 +10:00
|
|
|
IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<StrippableSystem>().StartOpeningStripper(args.User, this);
|
2020-08-15 20:33:42 +02:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-13 14:59:57 +10:00
|
|
|
public Dictionary<EntityUid, CancellationTokenSource> CancelTokens = new();
|
2020-08-15 20:33:42 +02:00
|
|
|
}
|
|
|
|
|
}
|