From d54a03988a644eaa7deedda79d0065e8d9da273e Mon Sep 17 00:00:00 2001 From: Fernando Molon Toigo <54711579+fernando-toigo-hoplon@users.noreply.github.com> Date: Fri, 22 Nov 2019 21:47:39 -0300 Subject: [PATCH] Added virtual GetBodyHighlightStyle (#197) --- Scripts/Editor/NodeEditor.cs | 6 +++++- Scripts/Editor/NodeEditorGUI.cs | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Scripts/Editor/NodeEditor.cs b/Scripts/Editor/NodeEditor.cs index 13440ea..eae80cd 100644 --- a/Scripts/Editor/NodeEditor.cs +++ b/Scripts/Editor/NodeEditor.cs @@ -100,6 +100,10 @@ namespace XNodeEditor { return NodeEditorResources.styles.nodeBody; } + public virtual GUIStyle GetBodyHighlightStyle() { + return NodeEditorResources.styles.nodeHighlight; + } + /// Add items for the context menu when right-clicking this node. Override to add custom menu items. public virtual void AddContextMenuItems(GenericMenu menu) { // Actions if only one node is selected @@ -143,4 +147,4 @@ namespace XNodeEditor { } } } -} \ No newline at end of file +} diff --git a/Scripts/Editor/NodeEditorGUI.cs b/Scripts/Editor/NodeEditorGUI.cs index c41afd0..74530d8 100644 --- a/Scripts/Editor/NodeEditorGUI.cs +++ b/Scripts/Editor/NodeEditorGUI.cs @@ -413,7 +413,7 @@ namespace XNodeEditor { if (selected) { GUIStyle style = new GUIStyle(nodeEditor.GetBodyStyle()); - GUIStyle highlightStyle = new GUIStyle(NodeEditorResources.styles.nodeHighlight); + GUIStyle highlightStyle = new GUIStyle(nodeEditor.GetBodyHighlightStyle()); highlightStyle.padding = style.padding; style.padding = new RectOffset(); GUI.color = nodeEditor.GetTint(); @@ -524,4 +524,4 @@ namespace XNodeEditor { } } } -} \ No newline at end of file +}