bool IDragDropOn.DragDropOn(DragDropEvent eventArgs) { // Handled by StrippableComponent return(true); }
private void HandleDragDropRequestEvent(DragDropRequestEvent msg, EntitySessionEventArgs args) { if (!ValidateClientInput(args.SenderSession, msg.DropLocation, msg.Target, out var userEntity)) { Logger.InfoS("system.interaction", $"DragDropRequestEvent input validation failed"); return; } if (!_actionBlockerSystem.CanInteract(userEntity.Value)) { return; } if (Deleted(msg.Dropped) || Deleted(msg.Target)) { return; } var interactionArgs = new DragDropEvent(userEntity.Value, msg.DropLocation, msg.Dropped, msg.Target); // must be in range of both the target and the object they are drag / dropping // Client also does this check but ya know we gotta validate it. if (!interactionArgs.InRangeUnobstructed(ignoreInsideBlocker: true, popup: true)) { return; } // trigger dragdrops on the dropped entity RaiseLocalEvent(msg.Dropped, interactionArgs); if (interactionArgs.Handled) { return; } foreach (var dragDrop in AllComps <IDraggable>(msg.Dropped)) { if (dragDrop.CanDrop(interactionArgs) && dragDrop.Drop(interactionArgs)) { return; } } // trigger dragdropons on the targeted entity RaiseLocalEvent(msg.Target, interactionArgs, false); if (interactionArgs.Handled) { return; } foreach (var dragDropOn in AllComps <IDragDropOn>(msg.Target)) { if (dragDropOn.CanDragDropOn(interactionArgs) && dragDropOn.DragDropOn(interactionArgs)) { return; } } }
public abstract bool DragDropOn(DragDropEvent eventArgs);
// ECS this out!, when DragDropSystem and InteractionSystem refactored public override bool DragDropOn(DragDropEvent eventArgs) { return(true); }
private void HandleDragDropOn(EntityUid uid, MedicalScannerComponent scannerComponent, DragDropEvent args) { InsertBody(uid, args.Dragged, scannerComponent); }
public abstract bool Drop(DragDropEvent args);
bool IDraggable.Drop(DragDropEvent args) { return(TryBuckle(args.User, args.Target)); }
public override bool Drop(DragDropEvent args) { // TODO: Prediction return(false); }
bool IDragDropOn.CanDragDropOn(DragDropEvent eventArgs) { return(eventArgs.Dragged.HasComponent <SharedBodyComponent>()); }
bool IDragDropOn.CanDragDropOn(DragDropEvent eventArgs) { return(CanInsert(eventArgs.Dragged)); }
public override bool Drop(DragDropEvent args) { IoCManager.Resolve <IEntitySystemManager>().GetEntitySystem <StrippableSystem>().StartOpeningStripper(args.User, this); return(true); }
public virtual bool CanDragDropOn(DragDropEvent eventArgs) { return(eventArgs.Dragged.HasComponent <SharedClimbingComponent>()); }
public virtual bool CanDragDropOn(DragDropEvent eventArgs) { return(IoCManager.Resolve <IEntityManager>().HasComponent <SharedClimbingComponent>(eventArgs.Dragged)); }
public static void DragDrop(DragDropEvent dropEvent) { loadPath = dropEvent.File; }
public void AlertDragDrop(DragDropEvent dd) { _rgatUI !.LoadSelectedBinary(dd.File, false); }