Skip to content

Commit

Permalink
#144 Added option to disable tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
mdwigley authored and Siccity committed Jun 8, 2019
1 parent 53f85a5 commit 8b0eb6b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Scripts/Editor/NodeEditorGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ private bool ShouldBeCulled(XNode.Node node) {
}

private void DrawTooltip() {
if (hoveredPort != null) {
if (hoveredPort != null && NodeEditorPreferences.GetSettings().portTooltips) {
Type type = hoveredPort.ValueType;
GUIContent content = new GUIContent();
content.text = type.PrettyName();
Expand Down
2 changes: 2 additions & 0 deletions Scripts/Editor/NodeEditorPreferences.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class Settings : ISerializationCallbackReceiver {
public bool gridSnap = true;
public bool autoSave = true;
public bool zoomToMouse = true;
public bool portTooltips = true;
[SerializeField] private string typeColorsData = "";
[NonSerialized] public Dictionary<string, Color> typeColors = new Dictionary<string, Color>();
public NoodleType noodleType = NoodleType.Curve;
Expand Down Expand Up @@ -147,6 +148,7 @@ private static void NodeSettingsGUI(string key, Settings settings) {
EditorGUILayout.LabelField("Node", EditorStyles.boldLabel);
settings.highlightColor = EditorGUILayout.ColorField("Selection", settings.highlightColor);
settings.noodleType = (NoodleType) EditorGUILayout.EnumPopup("Noodle type", (Enum) settings.noodleType);
settings.portTooltips = EditorGUILayout.Toggle("Port Tooltips", settings.portTooltips);
if (GUI.changed) {
SavePrefs(key, settings);
NodeEditorWindow.RepaintAll();
Expand Down

0 comments on commit 8b0eb6b

Please sign in to comment.