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:
metalgearsloth
2023-02-14 00:29:34 +11:00
committed by GitHub
parent 4183b5f449
commit c8f89eca60
53 changed files with 936 additions and 1079 deletions

View File

@@ -0,0 +1,31 @@
using Content.Shared.DragDrop;
using Content.Shared.Kitchen.Components;
using Content.Shared.Nutrition.Components;
namespace Content.Shared.Kitchen;
public abstract class SharedKitchenSpikeSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<SharedKitchenSpikeComponent, CanDropTargetEvent>(OnCanDrop);
}
private void OnCanDrop(EntityUid uid, SharedKitchenSpikeComponent component, ref CanDropTargetEvent args)
{
if (args.Handled)
return;
args.Handled = true;
if (!HasComp<ButcherableComponent>(args.Dragged))
{
args.CanDrop = false;
return;
}
// TODO: Once we get silicons need to check organic
args.CanDrop = true;
}
}