mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-20 17:26:02 +08:00
Added filtered node at port contextMenu
Added compatible menus when the right mouse button is clicked on the port and preferences filter is active
This commit is contained in:
parent
37d82ad215
commit
a03c4c5d0e
@ -118,6 +118,16 @@ namespace XNodeEditor {
|
||||
contextMenu.AddItem(new GUIContent($"Disconnect({name})"), false, () => hoveredPort.Disconnect(index));
|
||||
}
|
||||
contextMenu.AddItem(new GUIContent("Clear Connections"), false, () => hoveredPort.ClearConnections());
|
||||
//Get compatible nodes with this port
|
||||
if (NodeEditorPreferences.GetSettings().dragToCreateFilter)
|
||||
{
|
||||
contextMenu.AddSeparator("");
|
||||
|
||||
if (hoveredPort.direction == XNode.NodePort.IO.Input)
|
||||
graphEditor.AddContextMenuItems(contextMenu, hoveredPort.ValueType, XNode.NodePort.IO.Output);
|
||||
else
|
||||
graphEditor.AddContextMenuItems(contextMenu, hoveredPort.ValueType, XNode.NodePort.IO.Input);
|
||||
}
|
||||
contextMenu.DropDown(new Rect(Event.current.mousePosition, Vector2.zero));
|
||||
if (NodeEditorPreferences.GetSettings().autoSave) AssetDatabase.SaveAssets();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user