mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-20 09:16:01 +08:00
Added support in preferences for default node tint
This commit is contained in:
parent
6aacfbfd2d
commit
d4deeed45b
@ -14,8 +14,6 @@ namespace XNodeEditor {
|
||||
[CustomNodeEditor(typeof(XNode.Node))]
|
||||
public class NodeEditor : XNodeEditor.Internal.NodeEditorBase<NodeEditor, NodeEditor.CustomNodeEditorAttribute, XNode.Node> {
|
||||
|
||||
private readonly Color DEFAULTCOLOR = new Color32(90, 97, 105, 255);
|
||||
|
||||
/// <summary> Fires every whenever a node was modified through the editor </summary>
|
||||
public static Action<XNode.Node> onUpdateNode;
|
||||
public readonly static Dictionary<XNode.NodePort, Vector2> portPositions = new Dictionary<XNode.NodePort, Vector2>();
|
||||
@ -93,7 +91,7 @@ namespace XNodeEditor {
|
||||
Color color;
|
||||
if (type.TryGetAttributeTint(out color)) return color;
|
||||
// Return default color (grey)
|
||||
else return DEFAULTCOLOR;
|
||||
else return NodeEditorPreferences.GetSettings().tintColor;
|
||||
}
|
||||
|
||||
public virtual GUIStyle GetBodyStyle() {
|
||||
|
||||
@ -32,6 +32,7 @@ namespace XNodeEditor {
|
||||
[UnityEngine.Serialization.FormerlySerializedAs("zoomOutLimit")]
|
||||
public float maxZoom = 5f;
|
||||
public float minZoom = 1f;
|
||||
public Color32 tintColor = new Color32(90, 97, 105, 255);
|
||||
public Color32 highlightColor = new Color32(255, 255, 255, 255);
|
||||
public bool gridSnap = true;
|
||||
public bool autoSave = true;
|
||||
@ -160,6 +161,7 @@ namespace XNodeEditor {
|
||||
private static void NodeSettingsGUI(string key, Settings settings) {
|
||||
//Label
|
||||
EditorGUILayout.LabelField("Node", EditorStyles.boldLabel);
|
||||
settings.tintColor = EditorGUILayout.ColorField("Tint", settings.tintColor);
|
||||
settings.highlightColor = EditorGUILayout.ColorField("Selection", settings.highlightColor);
|
||||
settings.noodlePath = (NoodlePath) EditorGUILayout.EnumPopup("Noodle path", (Enum) settings.noodlePath);
|
||||
settings.noodleThickness = EditorGUILayout.FloatField(new GUIContent("Noodle thickness", "Noodle Thickness of the node connections"), settings.noodleThickness);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user