ECS dragdrop (#12973)
* ECS dragdrop No more excuses. * AAAAAAAAAAAAAA * kry * events * aaaaaaaaaa * HUH * Fix stripping * aaaaaa * spoike * asease * fix table vaulting * ded * rebiew * aaaaaaaaaaaaa * drag * aeaeae * weh
This commit is contained in:
77
Content.Shared/Strip/Components/StrippableComponent.cs
Normal file
77
Content.Shared/Strip/Components/StrippableComponent.cs
Normal file
@@ -0,0 +1,77 @@
|
||||
using Content.Shared.Inventory;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Strip.Components
|
||||
{
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed class StrippableComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The strip delay for hands.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("handDelay")]
|
||||
public float HandStripDelay = 4f;
|
||||
}
|
||||
|
||||
[NetSerializable, Serializable]
|
||||
public enum StrippingUiKey : byte
|
||||
{
|
||||
Key,
|
||||
}
|
||||
|
||||
[NetSerializable, Serializable]
|
||||
public sealed class StrippingSlotButtonPressed : BoundUserInterfaceMessage
|
||||
{
|
||||
public readonly string Slot;
|
||||
|
||||
public readonly bool IsHand;
|
||||
|
||||
public StrippingSlotButtonPressed(string slot, bool isHand)
|
||||
{
|
||||
Slot = slot;
|
||||
IsHand = isHand;
|
||||
}
|
||||
}
|
||||
|
||||
[NetSerializable, Serializable]
|
||||
public sealed class StrippingEnsnareButtonPressed : BoundUserInterfaceMessage
|
||||
{
|
||||
public StrippingEnsnareButtonPressed()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class BaseBeforeStripEvent : EntityEventArgs, IInventoryRelayEvent
|
||||
{
|
||||
public readonly float InitialTime;
|
||||
public float Time => MathF.Max(InitialTime * Multiplier + Additive, 0f);
|
||||
public float Additive = 0;
|
||||
public float Multiplier = 1f;
|
||||
public bool Stealth;
|
||||
|
||||
public SlotFlags TargetSlots { get; } = SlotFlags.GLOVES;
|
||||
|
||||
public BaseBeforeStripEvent(float initialTime, bool stealth = false)
|
||||
{
|
||||
InitialTime = initialTime;
|
||||
Stealth = stealth;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used to modify strip times. Raised directed at the user.
|
||||
/// </summary>
|
||||
public sealed class BeforeStripEvent : BaseBeforeStripEvent
|
||||
{
|
||||
public BeforeStripEvent(float initialTime, bool stealth = false) : base(initialTime, stealth) { }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used to modify strip times. Raised directed at the target.
|
||||
/// </summary>
|
||||
public sealed class BeforeGettingStrippedEvent : BaseBeforeStripEvent
|
||||
{
|
||||
public BeforeGettingStrippedEvent(float initialTime, bool stealth = false) : base(initialTime, stealth) { }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user