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(); }
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(); } }
//[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; }
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(); } }
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; }
public void RemoveItem(InputProcedural item) { Inputs.Remove(item); //nodeHandler.OnRequireNoodleRefresh?.Invoke(); OnValueChanged?.Invoke(); }