コード例 #1
0
 bool IDragDropOn.DragDropOn(DragDropEvent eventArgs)
 {
     // Handled by StrippableComponent
     return(true);
 }
コード例 #2
0
        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;
                }
            }
        }
コード例 #3
0
 public abstract bool DragDropOn(DragDropEvent eventArgs);
コード例 #4
0
 // ECS this out!, when DragDropSystem and InteractionSystem refactored
 public override bool DragDropOn(DragDropEvent eventArgs)
 {
     return(true);
 }
コード例 #5
0
 private void HandleDragDropOn(EntityUid uid, MedicalScannerComponent scannerComponent, DragDropEvent args)
 {
     InsertBody(uid, args.Dragged, scannerComponent);
 }
コード例 #6
0
 public abstract bool Drop(DragDropEvent args);
コード例 #7
0
 bool IDraggable.Drop(DragDropEvent args)
 {
     return(TryBuckle(args.User, args.Target));
 }
コード例 #8
0
 public override bool Drop(DragDropEvent args)
 {
     // TODO: Prediction
     return(false);
 }
コード例 #9
0
 bool IDragDropOn.CanDragDropOn(DragDropEvent eventArgs)
 {
     return(eventArgs.Dragged.HasComponent <SharedBodyComponent>());
 }
コード例 #10
0
 bool IDragDropOn.CanDragDropOn(DragDropEvent eventArgs)
 {
     return(CanInsert(eventArgs.Dragged));
 }
コード例 #11
0
 public override bool Drop(DragDropEvent args)
 {
     IoCManager.Resolve <IEntitySystemManager>().GetEntitySystem <StrippableSystem>().StartOpeningStripper(args.User, this);
     return(true);
 }
コード例 #12
0
 public virtual bool CanDragDropOn(DragDropEvent eventArgs)
 {
     return(eventArgs.Dragged.HasComponent <SharedClimbingComponent>());
 }
コード例 #13
0
 public virtual bool CanDragDropOn(DragDropEvent eventArgs)
 {
     return(IoCManager.Resolve <IEntityManager>().HasComponent <SharedClimbingComponent>(eventArgs.Dragged));
 }
コード例 #14
0
 public static void DragDrop(DragDropEvent dropEvent)
 {
     loadPath = dropEvent.File;
 }
コード例 #15
0
 public void AlertDragDrop(DragDropEvent dd)
 {
     _rgatUI !.LoadSelectedBinary(dd.File, false);
 }