コード例 #1
0
ファイル: InputCollection.cs プロジェクト: MilkyBrain/nodexr
        public void AddItem()
        {
            var newInput = new InputProcedural();

            //newInput.Pos = new Vector2L(Pos.x, Pos.y + 35 * Inputs.Count); //TODO: refactor
            Inputs.Add(newInput);
            //nodeHandler.OnRequireNoodleRefresh?.Invoke();
            OnValueChanged?.Invoke();
        }
コード例 #2
0
ファイル: InputCollection.cs プロジェクト: MilkyBrain/nodexr
        public void MoveDown(InputProcedural input)
        {
            int index = Inputs.IndexOf(input);

            if (index < Inputs.Count - 1)
            {
                Inputs[index]     = Inputs[index + 1];
                Inputs[index + 1] = input;
                //(Inputs[index].Pos, Inputs[index + 1].Pos) = (Inputs[index + 1].Pos, Inputs[index].Pos);
                //nodeHandler.OnRequireNoodleRefresh?.Invoke();
                OnValueChanged?.Invoke();
            }
        }
コード例 #3
0
ファイル: NodeDragService.cs プロジェクト: prilcool/nodexr
        //[JSInvokable]
        //public void DropNodeJS(long xPos, long yPos)
        //{
        //    if (CurDragType == DragType.Node)
        //    {
        //        //NodeToDrag?.MoveBy(xPos, yPos);
        //        Console.WriteLine("Drop from JS: " + xPos + ", " + yPos);
        //        NodeToDrag.Pos = new Vector2L(xPos, yPos);
        //        nodeHandler.OnNodeCountChanged();
        //    }
        //    TempNoodle.Enabled = false;
        //    TempNoodle.Valid = false;
        //    NodeToDrag = null;
        //    CurDragType = DragType.None;
        //}

        public void OnDropNoodle(InputProcedural nodeInput)
        {
            Console.WriteLine("OnDropNoodle");
            if (CurDragType == DragType.Node || NodeToDrag.NodeInputs.Contains(nodeInput))
            {
                Console.WriteLine("Can't drop here!");
                NodeToDrag = null;
                return;
            }
            nodeInput.InputNode = NodeToDrag;
            NodeToDrag          = null;
            //NoodleEnd = null;
        }
コード例 #4
0
ファイル: InputCollection.cs プロジェクト: MilkyBrain/nodexr
        public void MoveUp(InputProcedural input)
        {
            //var temp = input;
            int index = Inputs.IndexOf(input);

            if (index > 0)
            {
                Inputs[index]     = Inputs[index - 1];
                Inputs[index - 1] = input;
                //(Inputs[index].Pos, Inputs[index - 1].Pos) = (Inputs[index - 1].Pos, Inputs[index].Pos);
                //nodeHandler.OnRequireNoodleRefresh?.Invoke();
                OnValueChanged?.Invoke();
            }
        }
コード例 #5
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;
 }
コード例 #6
0
ファイル: InputCollection.cs プロジェクト: MilkyBrain/nodexr
 public void RemoveItem(InputProcedural item)
 {
     Inputs.Remove(item);
     //nodeHandler.OnRequireNoodleRefresh?.Invoke();
     OnValueChanged?.Invoke();
 }