mirror of
https://github.com/Siccity/xNode.git
synced 2026-02-06 07:14:56 +08:00
Added NodeEditor.GetBodyStyle, allowing per-node body styles
This commit is contained in:
parent
bad05a6e64
commit
16992c3972
@ -75,6 +75,10 @@ namespace XNodeEditor {
|
||||
else return Color.white;
|
||||
}
|
||||
|
||||
public virtual GUIStyle GetBodyStyle() {
|
||||
return NodeEditorResources.styles.nodeBody;
|
||||
}
|
||||
|
||||
public void InitiateRename() {
|
||||
renaming = 1;
|
||||
}
|
||||
|
||||
@ -348,18 +348,18 @@ namespace XNodeEditor {
|
||||
bool selected = selectionCache.Contains(graph.nodes[n]);
|
||||
|
||||
if (selected) {
|
||||
GUIStyle style = new GUIStyle(NodeEditorResources.styles.nodeBody);
|
||||
GUIStyle style = new GUIStyle(nodeEditor.GetBodyStyle());
|
||||
GUIStyle highlightStyle = new GUIStyle(NodeEditorResources.styles.nodeHighlight);
|
||||
highlightStyle.padding = style.padding;
|
||||
style.padding = new RectOffset();
|
||||
GUI.color = nodeEditor.GetTint();
|
||||
GUILayout.BeginVertical(new GUIStyle(style));
|
||||
GUILayout.BeginVertical(style);
|
||||
GUI.color = NodeEditorPreferences.GetSettings().highlightColor;
|
||||
GUILayout.BeginVertical(new GUIStyle(highlightStyle));
|
||||
} else {
|
||||
GUIStyle style = NodeEditorResources.styles.nodeBody;
|
||||
GUIStyle style = new GUIStyle(nodeEditor.GetBodyStyle());
|
||||
GUI.color = nodeEditor.GetTint();
|
||||
GUILayout.BeginVertical(new GUIStyle(style));
|
||||
GUILayout.BeginVertical(style);
|
||||
}
|
||||
|
||||
GUI.color = guiColor;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user