1
0
mirror of https://github.com/Siccity/xNode.git synced 2026-03-26 22:49:02 +08:00

move GraphEditor.GetNodeTooltip to NodeEditor.GetHeaderTooltip

This commit is contained in:
mayuntian 2020-08-11 14:16:42 +08:00
parent d1324f3148
commit e62df1a4a6
3 changed files with 6 additions and 6 deletions

View File

@ -104,6 +104,11 @@ namespace XNodeEditor {
return NodeEditorResources.styles.nodeHighlight;
}
/// <summary> Override to display custom node header tooltips </summary>
public virtual string GetHeaderTooltip(XNode.Node node) {
return null;
}
/// <summary> Add items for the context menu when right-clicking this node. Override to add custom menu items. </summary>
public virtual void AddContextMenuItems(GenericMenu menu) {
bool canRemove = true;

View File

@ -563,7 +563,7 @@ namespace XNodeEditor {
tooltip = graphEditor.GetPortTooltip(hoveredPort);
}
else if (hoveredNode != null && IsHoveringNode && IsHoveringTitle(hoveredNode)) {
tooltip = graphEditor.GetNodeTooltip(hoveredNode);
tooltip = NodeEditor.GetEditor(hoveredNode, this).GetHeaderTooltip(hoveredNode);
}
if (string.IsNullOrEmpty(tooltip)) return;
GUIContent content = new GUIContent(tooltip);

View File

@ -158,11 +158,6 @@ namespace XNodeEditor {
return tooltip;
}
/// <summary> Override to display custom node tooltips </summary>
public virtual string GetNodeTooltip(XNode.Node node) {
return null;
}
/// <summary> Deal with objects dropped into the graph through DragAndDrop </summary>
public virtual void OnDropObjects(UnityEngine.Object[] objects) {
if (GetType() != typeof(NodeGraphEditor)) Debug.Log("No OnDropObjects override defined for " + GetType());