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:
@@ -31,8 +31,8 @@ public sealed partial class BuckleSystem
|
||||
SubscribeLocalEvent<BuckleComponent, InteractHandEvent>(HandleInteractHand);
|
||||
SubscribeLocalEvent<BuckleComponent, GetVerbsEvent<InteractionVerb>>(AddUnbuckleVerb);
|
||||
SubscribeLocalEvent<BuckleComponent, InsertIntoEntityStorageAttemptEvent>(OnEntityStorageInsertAttempt);
|
||||
SubscribeLocalEvent<BuckleComponent, CanDropEvent>(OnBuckleCanDrop);
|
||||
SubscribeLocalEvent<BuckleComponent, DragDropEvent>(OnBuckleDragDrop);
|
||||
SubscribeLocalEvent<BuckleComponent, CanDropDraggedEvent>(OnBuckleCanDrop);
|
||||
SubscribeLocalEvent<BuckleComponent, DragDropDraggedEvent>(OnBuckleDragDrop);
|
||||
}
|
||||
|
||||
private void AddUnbuckleVerb(EntityUid uid, BuckleComponent component, GetVerbsEvent<InteractionVerb> args)
|
||||
@@ -104,12 +104,12 @@ public sealed partial class BuckleSystem
|
||||
args.Cancelled = true;
|
||||
}
|
||||
|
||||
private void OnBuckleCanDrop(EntityUid uid, BuckleComponent component, CanDropEvent args)
|
||||
private void OnBuckleCanDrop(EntityUid uid, BuckleComponent component, ref CanDropDraggedEvent args)
|
||||
{
|
||||
args.Handled = HasComp<StrapComponent>(args.Target);
|
||||
}
|
||||
|
||||
private void OnBuckleDragDrop(EntityUid uid, BuckleComponent component, DragDropEvent args)
|
||||
private void OnBuckleDragDrop(EntityUid uid, BuckleComponent component, ref DragDropDraggedEvent args)
|
||||
{
|
||||
args.Handled = TryBuckle(uid, args.User, args.Target, component);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public sealed partial class BuckleSystem
|
||||
SubscribeLocalEvent<StrapComponent, DestructionEventArgs>((_,c,_) => StrapRemoveAll(c));
|
||||
SubscribeLocalEvent<StrapComponent, BreakageEventArgs>((_, c, _) => StrapRemoveAll(c));
|
||||
SubscribeLocalEvent<StrapComponent, ConstructionBeforeDeleteEvent>((_, c, _) => StrapRemoveAll(c));
|
||||
SubscribeLocalEvent<StrapComponent, DragDropEvent>(OnStrapDragDrop);
|
||||
SubscribeLocalEvent<StrapComponent, DragDropTargetEvent>(OnStrapDragDrop);
|
||||
}
|
||||
|
||||
private void OnStrapGetState(EntityUid uid, StrapComponent component, ref ComponentGetState args)
|
||||
@@ -185,9 +185,9 @@ public sealed partial class BuckleSystem
|
||||
Dirty(strap);
|
||||
}
|
||||
|
||||
private void OnStrapDragDrop(EntityUid uid, StrapComponent component, DragDropEvent args)
|
||||
private void OnStrapDragDrop(EntityUid uid, StrapComponent component, ref DragDropTargetEvent args)
|
||||
{
|
||||
if (!StrapCanDragDropOn(uid, args.User, args.Target, args.Dragged, component))
|
||||
if (!StrapCanDragDropOn(uid, args.User, uid, args.Dragged, component))
|
||||
return;
|
||||
|
||||
args.Handled = TryBuckle(args.Dragged, args.User, uid);
|
||||
|
||||
Reference in New Issue
Block a user