Moves spike to ECS (#5706)
This commit is contained in:
@@ -56,7 +56,7 @@ namespace Content.Shared.DragDrop
|
||||
}
|
||||
}
|
||||
|
||||
public class StartDragDropEvent : EntityEventArgs
|
||||
public class StartDragDropEvent : HandledEntityEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Entity doing the drag and drop.
|
||||
|
||||
@@ -16,11 +16,11 @@ namespace Content.Shared.Kitchen.Components
|
||||
|
||||
[ViewVariables]
|
||||
[DataField("delay")]
|
||||
protected float SpikeDelay = 12.0f;
|
||||
public float SpikeDelay = 12.0f;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("sound")]
|
||||
protected SoundSpecifier SpikeSound = new SoundPathSpecifier("/Audio/Effects/Fluids/splat.ogg");
|
||||
public SoundSpecifier SpikeSound = new SoundPathSpecifier("/Audio/Effects/Fluids/splat.ogg");
|
||||
|
||||
bool IDragDropOn.CanDragDropOn(DragDropEvent eventArgs)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using Content.Shared.DragDrop;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Content.Shared.Nutrition.Components
|
||||
@@ -13,13 +15,23 @@ namespace Content.Shared.Nutrition.Components
|
||||
{
|
||||
public override string Name => "Butcherable";
|
||||
|
||||
//TODO: List for sub-products like animal-hides, organs and etc?
|
||||
[ViewVariables]
|
||||
public string? MeatPrototype => _meatPrototype;
|
||||
[DataField("meat", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
|
||||
public string MeatPrototype = "FoodMeat";
|
||||
|
||||
[ViewVariables]
|
||||
[DataField("meat")]
|
||||
private string? _meatPrototype;
|
||||
[DataField("pieces")]
|
||||
public int Pieces = 5;
|
||||
|
||||
/// <summary>
|
||||
/// Prevents butchering same entity on two and more spikes simultaneously and multiple doAfters on the same Spike
|
||||
/// </summary>
|
||||
public bool BeingButchered;
|
||||
|
||||
// TODO: ECS this out!, my guess CanDropEvent should be client side only and then "ValidDragDrop" in the DragDropSystem needs a little touch
|
||||
// But this may lead to creating client-side systems for every Draggable component subbed to CanDrop. Actually those systems could control
|
||||
// CanDropOn behaviors as well (IDragDropOn)
|
||||
bool IDraggable.CanDrop(CanDropEvent args)
|
||||
{
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user