From 6f2ec7fb5f94e183f716a5195065574b22e4c806 Mon Sep 17 00:00:00 2001 From: zvinless Date: Sun, 20 Nov 2016 22:52:20 -0800 Subject: [PATCH 1/3] Added simple search filter to highlight blocks --- .../Fungus/Scripts/Editor/FlowchartWindow.cs | 44 ++++++++++++++++++- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/Assets/Fungus/Scripts/Editor/FlowchartWindow.cs b/Assets/Fungus/Scripts/Editor/FlowchartWindow.cs index f7d3b90b..b6bbadde 100644 --- a/Assets/Fungus/Scripts/Editor/FlowchartWindow.cs +++ b/Assets/Fungus/Scripts/Editor/FlowchartWindow.cs @@ -131,7 +131,10 @@ namespace Fungus.EditorUtils // Context Click occurs on MouseDown which interferes with panning // Track right click positions manually to show menus on MouseUp protected Vector2 rightClickDown = -Vector2.one; - protected readonly float rightClickTolerance = 5f; + protected const float rightClickTolerance = 5f; + + protected string searchString = string.Empty; + protected const string searchFieldName = "search"; [MenuItem("Tools/Fungus/Flowchart Window")] static void Init() @@ -268,6 +271,25 @@ namespace Fungus.EditorUtils } deleteList.Clear(); + // Clear search filter focus + if (Event.current.type == EventType.MouseDown) + { + GUIUtility.keyboardControl = 0; + } + + if (Event.current.type == EventType.KeyDown && Event.current.keyCode == KeyCode.Escape) + { + if (GUI.GetNameOfFocusedControl() == searchFieldName) + { + searchString = string.Empty; + GUIUtility.keyboardControl = 0; + } + else if (flowchart.SelectedBlocks.Count > 0) + { + DeselectAll(flowchart); + } + } + DrawFlowchartView(flowchart); DrawOverlay(flowchart); @@ -318,6 +340,15 @@ namespace Fungus.EditorUtils GUILayout.FlexibleSpace(); + GUI.SetNextControlName(searchFieldName); + searchString = EditorGUILayout.TextField(searchString, GUI.skin.FindStyle("ToolbarSeachTextField"), GUILayout.Width(150)); + + if (GUILayout.Button("", GUI.skin.FindStyle("ToolbarSeachCancelButton"))) // These are spelled correctly + { + searchString = string.Empty; + GUIUtility.keyboardControl = 0; + } + GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); @@ -1016,6 +1047,11 @@ namespace Fungus.EditorUtils var brightness = tintColor.r * 0.3 + tintColor.g * 0.59 + tintColor.b * 0.11; nodeStyleCopy.normal.textColor = brightness >= 0.5 ? Color.black : Color.white; + if (searchString != string.Empty && !block.BlockName.ToLower().Contains(searchString.ToLower())) + { + tintColor.a *= 0.2f; + } + nodeStyleCopy.normal.background = offTex; GUI.backgroundColor = tintColor; GUI.Box(boxRect, block.BlockName, nodeStyleCopy); @@ -1293,7 +1329,7 @@ namespace Fungus.EditorUtils Event.current.Use(); } } - else if (c == "SelectAll") + else if (c == "SelectAll" || c == "Find") { Event.current.Use(); } @@ -1340,6 +1376,10 @@ namespace Fungus.EditorUtils } Event.current.Use(); break; + case "Find": + EditorGUI.FocusTextInControl(searchFieldName); + Event.current.Use(); + break; } } } From 4ca7ecbdc647ab8c58353466875e1952943a6fb9 Mon Sep 17 00:00:00 2001 From: zvinless Date: Wed, 23 Nov 2016 22:22:13 -0800 Subject: [PATCH 2/3] Added block search dropdown Added popup window that appears beneath search filter so that users can easily find blocks by name --- .../FungusEditorResources.asset | 3 + .../EditorResources/Textures/bullet_point.png | Bin 0 -> 3071 bytes .../Textures/bullet_point.png.meta | 55 +++ .../Fungus/Scripts/Editor/FlowchartWindow.cs | 312 ++++++++++++++---- .../Editor/FungusEditorResourcesGenerated.cs | 2 + 5 files changed, 311 insertions(+), 61 deletions(-) create mode 100644 Assets/Fungus/EditorResources/Textures/bullet_point.png create mode 100644 Assets/Fungus/EditorResources/Textures/bullet_point.png.meta diff --git a/Assets/Fungus/EditorResources/FungusEditorResources.asset b/Assets/Fungus/EditorResources/FungusEditorResources.asset index 594b27ed..05ea3abc 100644 --- a/Assets/Fungus/EditorResources/FungusEditorResources.asset +++ b/Assets/Fungus/EditorResources/FungusEditorResources.asset @@ -30,6 +30,9 @@ MonoBehaviour: up: free: {fileID: 2800000, guid: 8f1242ad894201f43b2b6d52fd990f77, type: 3} pro: {fileID: 2800000, guid: 2a76a781db2994b33b83cd84b8835da7, type: 3} + bullet_point: + free: {fileID: 2800000, guid: 4ef739c68bb234717a60a2bb83ff8602, type: 3} + pro: {fileID: 0} choice_node_off: free: {fileID: 2800000, guid: 7b6fc04aac74540e39e9502da5312ce7, type: 3} pro: {fileID: 0} diff --git a/Assets/Fungus/EditorResources/Textures/bullet_point.png b/Assets/Fungus/EditorResources/Textures/bullet_point.png new file mode 100644 index 0000000000000000000000000000000000000000..bcafc7337b26c8cfccda88c688f191cd1960ef17 GIT binary patch literal 3071 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 copyList = new List(); public static List deleteList = new List(); @@ -133,9 +140,15 @@ namespace Fungus.EditorUtils protected Vector2 rightClickDown = -Vector2.one; protected const float rightClickTolerance = 5f; - protected string searchString = string.Empty; protected const string searchFieldName = "search"; - + private string searchString = string.Empty; + protected Rect searchRect; + protected Rect popupRect; + protected Block[] filteredBlocks; + protected int blockPopupSelection = -1; + protected Vector2 popupScroll; + protected bool mouseOverPopup; + [MenuItem("Tools/Fungus/Flowchart Window")] static void Init() { @@ -162,6 +175,8 @@ namespace Fungus.EditorUtils gridLineColor.a = EditorGUIUtility.isProSkin ? 0.5f : 0.25f; copyList.Clear(); + + wantsMouseMove = true; // For hover selection in block search popup } protected virtual void OnInspectorUpdate() @@ -272,21 +287,18 @@ namespace Fungus.EditorUtils deleteList.Clear(); // Clear search filter focus - if (Event.current.type == EventType.MouseDown) + if (Event.current.type == EventType.MouseDown && !searchRect.Contains(Event.current.mousePosition) && + !popupRect.Contains(Event.current.mousePosition)) { - GUIUtility.keyboardControl = 0; + CloseBlockPopup(); } if (Event.current.type == EventType.KeyDown && Event.current.keyCode == KeyCode.Escape) { - if (GUI.GetNameOfFocusedControl() == searchFieldName) - { - searchString = string.Empty; - GUIUtility.keyboardControl = 0; - } - else if (flowchart.SelectedBlocks.Count > 0) + if (GUI.GetNameOfFocusedControl() != searchFieldName && flowchart.SelectedBlocks.Count > 0) { DeselectAll(flowchart); + Event.current.Use(); } } @@ -340,13 +352,95 @@ namespace Fungus.EditorUtils GUILayout.FlexibleSpace(); + var blocks = flowchart.GetComponents(); + + // Intercept mouse and keyboard events before search field uses them + if (GUI.GetNameOfFocusedControl() == searchFieldName) + { + if (Event.current.type == EventType.KeyDown) + { + var centerBlock = false; + var selectBlock = false; + var closePopup = false; + var useEvent = false; + + switch (Event.current.keyCode) + { + case KeyCode.DownArrow: + ++blockPopupSelection; + centerBlock = true; + useEvent = true; + break; + case KeyCode.UpArrow: + --blockPopupSelection; + centerBlock = true; + useEvent = true; + break; + case KeyCode.Return: + centerBlock = true; + selectBlock = true; + closePopup = true; + useEvent = true; + break; + case KeyCode.Escape: + closePopup = true; + useEvent = true; + break; + } + + blockPopupSelection = Mathf.Clamp(blockPopupSelection, 0, filteredBlocks.Length - 1); + + if (centerBlock && filteredBlocks.Length > 0) + { + var block = filteredBlocks[blockPopupSelection]; + CenterBlock(flowchart, block); + + if (selectBlock) + { + SelectBlock(flowchart, block); + } + } + + if (closePopup) + { + CloseBlockPopup(); + } + + if (useEvent) + { + Event.current.Use(); + } + } + } + else if (Event.current.type == EventType.MouseDown && Event.current.button == 0 && + searchRect.Contains(Event.current.mousePosition)) + { + blockPopupSelection = 0; + } + GUI.SetNextControlName(searchFieldName); - searchString = EditorGUILayout.TextField(searchString, GUI.skin.FindStyle("ToolbarSeachTextField"), GUILayout.Width(150)); + var newString = EditorGUILayout.TextField(searchString, GUI.skin.FindStyle("ToolbarSeachTextField"), GUILayout.Width(150)); + if (newString != searchString) + { + searchString = newString; + } + + // Update this every frame in case of redo/undo while popup is open + filteredBlocks = blocks.Where(block => block.BlockName.ToLower().Contains(searchString.ToLower())).ToArray(); + blockPopupSelection = Mathf.Clamp(blockPopupSelection, 0, filteredBlocks.Length - 1); + + if (Event.current.type == EventType.Repaint) + { + searchRect = GUILayoutUtility.GetLastRect(); + popupRect = searchRect; + popupRect.width += 12; + popupRect.y += popupRect.height; + popupRect.height = Mathf.Min(filteredBlocks.Length * 16, position.height - 22); + } - if (GUILayout.Button("", GUI.skin.FindStyle("ToolbarSeachCancelButton"))) // These are spelled correctly + if (GUILayout.Button("", GUI.skin.FindStyle("ToolbarSeachCancelButton"))) { - searchString = string.Empty; - GUIUtility.keyboardControl = 0; + CloseBlockPopup(); } GUILayout.EndHorizontal(); @@ -396,7 +490,9 @@ namespace Fungus.EditorUtils if (Event.current.type == EventType.Repaint) { Rect toolbarRect = new Rect(0, 0, position.width, 18); - mouseOverVariables = variableWindowRect.Contains(Event.current.mousePosition) || toolbarRect.Contains(rawMousePosition); + mouseOverPopup = (GUI.GetNameOfFocusedControl() == searchFieldName && popupRect.Contains(rawMousePosition)); + mouseOverVariables = variableWindowRect.Contains(Event.current.mousePosition) || + toolbarRect.Contains(rawMousePosition) || mouseOverPopup; } GUILayout.EndScrollView(); @@ -406,6 +502,75 @@ namespace Fungus.EditorUtils GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); + + // Draw block search popup on top of other controls + if (GUI.GetNameOfFocusedControl() == searchFieldName && filteredBlocks.Length > 0) + { + DrawBlockPopup(flowchart); + } + } + + protected virtual void DrawBlockPopup(Flowchart flowchart) + { + blockPopupSelection = Mathf.Clamp(blockPopupSelection, 0, filteredBlocks.Length - 1); + + GUI.Box(popupRect, "", GUI.skin.FindStyle("sv_iconselector_back")); + + if (Event.current.type == EventType.MouseMove) + { + if (popupRect.Contains(Event.current.mousePosition)) + { + var relativeY = Event.current.mousePosition.y - popupRect.yMin + popupScroll.y; + blockPopupSelection = (int) (relativeY / 16); + } + + Event.current.Use(); + } + + GUILayout.BeginArea(popupRect); + popupScroll = EditorGUILayout.BeginScrollView(popupScroll, GUIStyle.none, GUI.skin.verticalScrollbar); + + var normalStyle = new GUIStyle(GUI.skin.FindStyle("MenuItem")); + normalStyle.padding = new RectOffset(8, 0, 0, 0); + normalStyle.imagePosition = ImagePosition.ImageLeft; + var selectedStyle = new GUIStyle(normalStyle); + selectedStyle.normal = selectedStyle.hover; + normalStyle.hover = normalStyle.normal; + + for (int i = 0; i < filteredBlocks.Length; ++i) + { + EditorGUILayout.BeginHorizontal(GUILayout.Height(16)); + + var block = filteredBlocks[i]; + var style = i == blockPopupSelection ? selectedStyle : normalStyle; + + GUI.contentColor = GetBlockGraphics(block).tint; + + var buttonPressed = false; + if (GUILayout.Button(FungusEditorResources.BulletPoint, style, GUILayout.Width(16))) + { + buttonPressed = true; + } + + GUI.contentColor = Color.white; + + if (GUILayout.Button(block.BlockName, style)) + { + buttonPressed = true; + } + + if (buttonPressed) + { + CenterBlock(flowchart, block); + SelectBlock(flowchart, block); + CloseBlockPopup(); + } + + EditorGUILayout.EndHorizontal(); + } + + EditorGUILayout.EndScrollView(); + GUILayout.EndArea(); } protected virtual void DrawFlowchartView(Flowchart flowchart) @@ -828,7 +993,7 @@ namespace Fungus.EditorUtils bool zoom = false; // Scroll wheel - if (Event.current.type == EventType.ScrollWheel) + if (Event.current.type == EventType.ScrollWheel && !mouseOverPopup) { zoom = true; } @@ -986,44 +1151,7 @@ namespace Fungus.EditorUtils } GUIStyle nodeStyleCopy = new GUIStyle(nodeStyle); - Texture2D offTex; - Texture2D onTex; - Color defaultColor; - - if (block._EventHandler != null) - { - offTex = FungusEditorResources.EventNodeOff; - onTex = FungusEditorResources.EventNodeOn; - defaultColor = FungusConstants.DefaultEventBlockTint; - } - else - { - // Count the number of unique connections (excluding self references) - var uniqueList = new List(); - var connectedBlocks = block.GetConnectedBlocks(); - foreach (var connectedBlock in connectedBlocks) - { - if (connectedBlock == block || - uniqueList.Contains(connectedBlock)) - { - continue; - } - uniqueList.Add(connectedBlock); - } - - if (uniqueList.Count > 1) - { - offTex = FungusEditorResources.ChoiceNodeOff; - onTex = FungusEditorResources.ChoiceNodeOn; - defaultColor = FungusConstants.DefaultChoiceBlockTint; - } - else - { - offTex = FungusEditorResources.ProcessNodeOff; - onTex = FungusEditorResources.ProcessNodeOn; - defaultColor = FungusConstants.DefaultProcessBlockTint; - } - } + var graphics = GetBlockGraphics(block); // Make sure node is wide enough to fit the node name text var n = block as Node; @@ -1033,27 +1161,26 @@ namespace Fungus.EditorUtils n._NodeRect = tempRect; Rect boxRect = GUILayoutUtility.GetRect(n._NodeRect.width, n._NodeRect.height); - var tintColor = n.UseCustomTint ? n.Tint : defaultColor; // Draw untinted highlight if (selected) { GUI.backgroundColor = Color.white; - nodeStyleCopy.normal.background = onTex; + nodeStyleCopy.normal.background = graphics.onTexture; GUI.Box(boxRect, "", nodeStyleCopy); } // Draw tinted block; ensure text is readable - var brightness = tintColor.r * 0.3 + tintColor.g * 0.59 + tintColor.b * 0.11; + var brightness = graphics.tint.r * 0.3 + graphics.tint.g * 0.59 + graphics.tint.b * 0.11; nodeStyleCopy.normal.textColor = brightness >= 0.5 ? Color.black : Color.white; - if (searchString != string.Empty && !block.BlockName.ToLower().Contains(searchString.ToLower())) + if (GUI.GetNameOfFocusedControl() == searchFieldName && !filteredBlocks.Contains(block)) { - tintColor.a *= 0.2f; + graphics.tint.a *= 0.2f; } - nodeStyleCopy.normal.background = offTex; - GUI.backgroundColor = tintColor; + nodeStyleCopy.normal.background = graphics.offTexture; + GUI.backgroundColor = graphics.tint; GUI.Box(boxRect, block.BlockName, nodeStyleCopy); GUI.backgroundColor = Color.white; @@ -1376,12 +1503,75 @@ namespace Fungus.EditorUtils } Event.current.Use(); break; + case "Find": + blockPopupSelection = 0; EditorGUI.FocusTextInControl(searchFieldName); Event.current.Use(); break; } } } + + protected virtual void CenterBlock(Flowchart flowchart, Block block) + { + if (flowchart.Zoom < 1) + { + DoZoom(flowchart, 1 - flowchart.Zoom, Vector2.one * 0.5f); + } + + flowchart.ScrollPos = -block._NodeRect.center + position.size * 0.5f / flowchart.Zoom; + } + + protected virtual void CloseBlockPopup() + { + GUIUtility.keyboardControl = 0; + searchString = string.Empty; + } + + protected virtual BlockGraphics GetBlockGraphics(Block block) + { + var graphics = new BlockGraphics(); + + Color defaultTint; + if (block._EventHandler != null) + { + graphics.offTexture = FungusEditorResources.EventNodeOff; + graphics.onTexture = FungusEditorResources.EventNodeOn; + defaultTint = FungusConstants.DefaultEventBlockTint; + } + else + { + // Count the number of unique connections (excluding self references) + var uniqueList = new List(); + var connectedBlocks = block.GetConnectedBlocks(); + foreach (var connectedBlock in connectedBlocks) + { + if (connectedBlock == block || + uniqueList.Contains(connectedBlock)) + { + continue; + } + uniqueList.Add(connectedBlock); + } + + if (uniqueList.Count > 1) + { + graphics.offTexture = FungusEditorResources.ChoiceNodeOff; + graphics.onTexture = FungusEditorResources.ChoiceNodeOn; + defaultTint = FungusConstants.DefaultChoiceBlockTint; + } + else + { + graphics.offTexture = FungusEditorResources.ProcessNodeOff; + graphics.onTexture = FungusEditorResources.ProcessNodeOn; + defaultTint = FungusConstants.DefaultProcessBlockTint; + } + } + + graphics.tint = block.UseCustomTint ? block.Tint : defaultTint; + + return graphics; + } } } \ No newline at end of file diff --git a/Assets/Fungus/Scripts/Editor/FungusEditorResourcesGenerated.cs b/Assets/Fungus/Scripts/Editor/FungusEditorResourcesGenerated.cs index 7ea1ea0c..f7a0641b 100644 --- a/Assets/Fungus/Scripts/Editor/FungusEditorResourcesGenerated.cs +++ b/Assets/Fungus/Scripts/Editor/FungusEditorResourcesGenerated.cs @@ -13,6 +13,7 @@ namespace Fungus.EditorUtils [SerializeField] private EditorTexture down; [SerializeField] private EditorTexture duplicate; [SerializeField] private EditorTexture up; + [SerializeField] private EditorTexture bullet_point; [SerializeField] private EditorTexture choice_node_off; [SerializeField] private EditorTexture choice_node_on; [SerializeField] private EditorTexture command_background; @@ -30,6 +31,7 @@ namespace Fungus.EditorUtils public static Texture2D Down { get { return Instance.down.Texture2D; } } public static Texture2D Duplicate { get { return Instance.duplicate.Texture2D; } } public static Texture2D Up { get { return Instance.up.Texture2D; } } + public static Texture2D BulletPoint { get { return Instance.bullet_point.Texture2D; } } public static Texture2D ChoiceNodeOff { get { return Instance.choice_node_off.Texture2D; } } public static Texture2D ChoiceNodeOn { get { return Instance.choice_node_on.Texture2D; } } public static Texture2D CommandBackground { get { return Instance.command_background.Texture2D; } } From abc4cb0a0732697d25608ba8399ac1ad00462b00 Mon Sep 17 00:00:00 2001 From: zvinless Date: Wed, 23 Nov 2016 22:30:39 -0800 Subject: [PATCH 3/3] Added newlines to switch for consistency --- Assets/Fungus/Scripts/Editor/FlowchartWindow.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Assets/Fungus/Scripts/Editor/FlowchartWindow.cs b/Assets/Fungus/Scripts/Editor/FlowchartWindow.cs index 5efdbdfa..11050ce3 100644 --- a/Assets/Fungus/Scripts/Editor/FlowchartWindow.cs +++ b/Assets/Fungus/Scripts/Editor/FlowchartWindow.cs @@ -371,17 +371,20 @@ namespace Fungus.EditorUtils centerBlock = true; useEvent = true; break; + case KeyCode.UpArrow: --blockPopupSelection; centerBlock = true; useEvent = true; break; + case KeyCode.Return: centerBlock = true; selectBlock = true; closePopup = true; useEvent = true; break; + case KeyCode.Escape: closePopup = true; useEvent = true;