1
0
mirror of https://github.com/Siccity/xNode.git synced 2026-02-14 02:58:45 +08:00

Added NodeEditor.GetBodyStyle, allowing per-node body styles

This commit is contained in:
Thor Brigsted 2018-10-27 18:41:13 +02:00
parent bad05a6e64
commit 16992c3972
2 changed files with 8 additions and 4 deletions

View File

@ -75,6 +75,10 @@ namespace XNodeEditor {
else return Color.white; else return Color.white;
} }
public virtual GUIStyle GetBodyStyle() {
return NodeEditorResources.styles.nodeBody;
}
public void InitiateRename() { public void InitiateRename() {
renaming = 1; renaming = 1;
} }

View File

@ -348,18 +348,18 @@ namespace XNodeEditor {
bool selected = selectionCache.Contains(graph.nodes[n]); bool selected = selectionCache.Contains(graph.nodes[n]);
if (selected) { if (selected) {
GUIStyle style = new GUIStyle(NodeEditorResources.styles.nodeBody); GUIStyle style = new GUIStyle(nodeEditor.GetBodyStyle());
GUIStyle highlightStyle = new GUIStyle(NodeEditorResources.styles.nodeHighlight); GUIStyle highlightStyle = new GUIStyle(NodeEditorResources.styles.nodeHighlight);
highlightStyle.padding = style.padding; highlightStyle.padding = style.padding;
style.padding = new RectOffset(); style.padding = new RectOffset();
GUI.color = nodeEditor.GetTint(); GUI.color = nodeEditor.GetTint();
GUILayout.BeginVertical(new GUIStyle(style)); GUILayout.BeginVertical(style);
GUI.color = NodeEditorPreferences.GetSettings().highlightColor; GUI.color = NodeEditorPreferences.GetSettings().highlightColor;
GUILayout.BeginVertical(new GUIStyle(highlightStyle)); GUILayout.BeginVertical(new GUIStyle(highlightStyle));
} else { } else {
GUIStyle style = NodeEditorResources.styles.nodeBody; GUIStyle style = new GUIStyle(nodeEditor.GetBodyStyle());
GUI.color = nodeEditor.GetTint(); GUI.color = nodeEditor.GetTint();
GUILayout.BeginVertical(new GUIStyle(style)); GUILayout.BeginVertical(style);
} }
GUI.color = guiColor; GUI.color = guiColor;