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:
parent
d1324f3148
commit
e62df1a4a6
@ -104,6 +104,11 @@ namespace XNodeEditor {
|
|||||||
return NodeEditorResources.styles.nodeHighlight;
|
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>
|
/// <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) {
|
public virtual void AddContextMenuItems(GenericMenu menu) {
|
||||||
bool canRemove = true;
|
bool canRemove = true;
|
||||||
|
|||||||
@ -563,7 +563,7 @@ namespace XNodeEditor {
|
|||||||
tooltip = graphEditor.GetPortTooltip(hoveredPort);
|
tooltip = graphEditor.GetPortTooltip(hoveredPort);
|
||||||
}
|
}
|
||||||
else if (hoveredNode != null && IsHoveringNode && IsHoveringTitle(hoveredNode)) {
|
else if (hoveredNode != null && IsHoveringNode && IsHoveringTitle(hoveredNode)) {
|
||||||
tooltip = graphEditor.GetNodeTooltip(hoveredNode);
|
tooltip = NodeEditor.GetEditor(hoveredNode, this).GetHeaderTooltip(hoveredNode);
|
||||||
}
|
}
|
||||||
if (string.IsNullOrEmpty(tooltip)) return;
|
if (string.IsNullOrEmpty(tooltip)) return;
|
||||||
GUIContent content = new GUIContent(tooltip);
|
GUIContent content = new GUIContent(tooltip);
|
||||||
|
|||||||
@ -158,11 +158,6 @@ namespace XNodeEditor {
|
|||||||
return tooltip;
|
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>
|
/// <summary> Deal with objects dropped into the graph through DragAndDrop </summary>
|
||||||
public virtual void OnDropObjects(UnityEngine.Object[] objects) {
|
public virtual void OnDropObjects(UnityEngine.Object[] objects) {
|
||||||
if (GetType() != typeof(NodeGraphEditor)) Debug.Log("No OnDropObjects override defined for " + GetType());
|
if (GetType() != typeof(NodeGraphEditor)) Debug.Log("No OnDropObjects override defined for " + GetType());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user