示例#1
0
 public void OnDropNoodle(InputProcedural nodeInput)
 {
     Console.WriteLine("OnDropNoodle");
     //TODO: Properly check for cyclic dependencies
     if (CurDragType != DragType.Noodle || NodeToDrag.GetInputsRecursive().Contains(nodeInput))
     {
         Console.WriteLine("Can't drop here!");
         NodeToDrag = null;
         return;
     }
     nodeInput.InputNode = NodeToDrag;
     NodeToDrag          = null;
     //NoodleEnd = null;
 }
示例#2
0
 public void OnDrop(UIDragEventArgs e)
 {
     if (CurDragType == DragType.Node)
     {
         NodeToDrag?.MoveBy((e.GetClientPos() - cursorStartPos) / ZoomHandler.Zoom);
     }
     else if (CurDragType == DragType.Noodle)
     {
         //TempNoodle.Refresh();
     }
     TempNoodle.Enabled = false;
     TempNoodle.Valid   = false;
     NodeToDrag         = null;
     CurDragType        = DragType.None;
 }
示例#3
0
        public void OnDropNoodle(InputProcedural nodeInput)
        {
            TempNoodle.Connected = false;

            if (NodeToDrag is null)
            {
                return;
            }

            if (NodeToDrag.IsDependentOn(nodeInput))
            {
                toastService.ShowError(
                    "Cyclical dependencies would create a rift in the space-time continuum and are therefore not allowed. " +
                    "If you want to use the same node multiple times in a row, connect it to multiple inputs of a 'Concatenate' node.",
                    "Can't connect these nodes");
            }
            else
            {
                nodeInput.ConnectedNode = NodeToDrag;
            }

            NodeToDrag = null;
        }