Dragdrop fold rollerbed (#30002)

* Deploy foldable

* Add NetworkedComponent and access to the component

* Add handled to afterinteract

* Use drop target location instead of setcoordinates

* Put back in hand after failed deploy

This prevents dropping the bed when clicking while inside a locker.

* Created BaseDeployFoldable for folding chairs, body bags, and rollerbeds

* Add dragdrop to fold rollerbed to hand
This commit is contained in:
ShadowCommander
2024-08-07 02:19:10 -07:00
committed by GitHub
parent d86438c22b
commit 6a5cc883ce
3 changed files with 42 additions and 5 deletions

View File

@@ -61,11 +61,12 @@ public abstract class SharedStrippableSystem : EntitySystem
private void OnCanDropOn(EntityUid uid, StrippingComponent component, ref CanDropTargetEvent args)
{
args.Handled = true;
args.CanDrop |= uid == args.User &&
HasComp<StrippableComponent>(args.Dragged) &&
HasComp<HandsComponent>(args.User) &&
HasComp<StrippingComponent>(args.User);
var val = uid == args.User &&
HasComp<StrippableComponent>(args.Dragged) &&
HasComp<HandsComponent>(args.User) &&
HasComp<StrippingComponent>(args.User);
args.Handled |= val;
args.CanDrop |= val;
}
private void OnCanDrop(EntityUid uid, StrippableComponent component, ref CanDropDraggedEvent args)