mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-20 17:26:02 +08:00
Added OpenOnCreate settings. (#295)
Adds the option to prevent opening the graph editor when creating a new graph. Suggested in Issues #286
This commit is contained in:
parent
123415bd83
commit
b5fb59a84e
@ -35,6 +35,7 @@ namespace XNodeEditor {
|
|||||||
public Color32 highlightColor = new Color32(255, 255, 255, 255);
|
public Color32 highlightColor = new Color32(255, 255, 255, 255);
|
||||||
public bool gridSnap = true;
|
public bool gridSnap = true;
|
||||||
public bool autoSave = true;
|
public bool autoSave = true;
|
||||||
|
public bool openOnCreate = true;
|
||||||
public bool dragToCreate = true;
|
public bool dragToCreate = true;
|
||||||
public bool zoomToMouse = true;
|
public bool zoomToMouse = true;
|
||||||
public bool portTooltips = true;
|
public bool portTooltips = true;
|
||||||
@ -149,6 +150,7 @@ namespace XNodeEditor {
|
|||||||
//Label
|
//Label
|
||||||
EditorGUILayout.LabelField("System", EditorStyles.boldLabel);
|
EditorGUILayout.LabelField("System", EditorStyles.boldLabel);
|
||||||
settings.autoSave = EditorGUILayout.Toggle(new GUIContent("Autosave", "Disable for better editor performance"), settings.autoSave);
|
settings.autoSave = EditorGUILayout.Toggle(new GUIContent("Autosave", "Disable for better editor performance"), settings.autoSave);
|
||||||
|
settings.openOnCreate = EditorGUILayout.Toggle(new GUIContent("Open Editor on Create", "Disable to prevent openening the editor when creating a new graph"), settings.openOnCreate);
|
||||||
if (GUI.changed) SavePrefs(key, settings);
|
if (GUI.changed) SavePrefs(key, settings);
|
||||||
EditorGUILayout.Space();
|
EditorGUILayout.Space();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -99,7 +99,7 @@ namespace XNodeEditor {
|
|||||||
private static void OnSelectionChanged() {
|
private static void OnSelectionChanged() {
|
||||||
XNode.NodeGraph nodeGraph = Selection.activeObject as XNode.NodeGraph;
|
XNode.NodeGraph nodeGraph = Selection.activeObject as XNode.NodeGraph;
|
||||||
if (nodeGraph && !AssetDatabase.Contains(nodeGraph)) {
|
if (nodeGraph && !AssetDatabase.Contains(nodeGraph)) {
|
||||||
Open(nodeGraph);
|
if (NodeEditorPreferences.GetSettings().openOnCreate) Open(nodeGraph);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user