Add click dragging for buckle (#1290)

This commit is contained in:
DrSmugleaf
2020-07-07 00:04:30 +02:00
committed by GitHub
parent 5056ded35e
commit c78ce3e27a
8 changed files with 69 additions and 11 deletions

View File

@@ -1,10 +1,12 @@
using Content.Shared.GameObjects.Components.Mobs;
using Content.Client.GameObjects.Components.Strap;
using Content.Client.Interfaces.GameObjects.Components.Interaction;
using Content.Shared.GameObjects.Components.Mobs;
using Robust.Shared.GameObjects;
namespace Content.Client.GameObjects.Components.Mobs
{
[RegisterComponent]
public class BuckleComponent : SharedBuckleComponent
public class BuckleComponent : SharedBuckleComponent, IClientDraggable
{
private bool _buckled;
@@ -19,5 +21,15 @@ namespace Content.Client.GameObjects.Components.Mobs
}
protected override bool Buckled => _buckled;
bool IClientDraggable.ClientCanDropOn(CanDropEventArgs eventArgs)
{
return eventArgs.Target.HasComponent<StrapComponent>();
}
bool IClientDraggable.ClientCanDrag(CanDragEventArgs eventArgs)
{
return true;
}
}
}