From 8450caf0b1d74440555b86e8a630febb2345c9a3 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Thu, 14 Aug 2014 11:48:40 +0100 Subject: [PATCH] Highlight executing command --- .../FungusScript/FungusCommandEditor.cs | 31 ++++++++++++------ Assets/Shuttle/ShuttleGame.unity | Bin 81732 -> 81732 bytes 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/Assets/Fungus/Editor/FungusScript/FungusCommandEditor.cs b/Assets/Fungus/Editor/FungusScript/FungusCommandEditor.cs index 162344de..fa12c7bb 100644 --- a/Assets/Fungus/Editor/FungusScript/FungusCommandEditor.cs +++ b/Assets/Fungus/Editor/FungusScript/FungusCommandEditor.cs @@ -25,6 +25,8 @@ namespace Fungus.Script { FungusCommand t = target as FungusCommand; + GUILayout.BeginVertical(); + GUILayout.BeginHorizontal(); t.expanded = EditorGUILayout.Foldout(t.expanded, t.GetType().Name); @@ -38,6 +40,15 @@ namespace Fungus.Script if (!t.expanded) { + GUILayout.EndVertical(); + if (Event.current.type == EventType.Repaint && + t.IsExecuting()) + { + Rect rect = GUILayoutUtility.GetLastRect(); + rect.x -= 10; + rect.width += 10; + GLDraw.DrawBox(rect, Color.green, 1.5f); + } return; } @@ -96,17 +107,17 @@ namespace Fungus.Script style.normal.textColor = new Color(1,0,0); EditorGUILayout.LabelField(new GUIContent("Error: " + t.errorMessage), style); } + } - /* - if (t.IsExecuting()) - { - EditorGUI.DrawRect(rect, new Color(0f, 1f, 0f, 0.25f)); - } - else if (t == selectedCommand) - { - EditorGUI.DrawRect(rect, new Color(1f, 1f, 0f, 0.25f)); - } - */ + GUILayout.EndVertical(); + + if (Event.current.type == EventType.Repaint && + t.IsExecuting()) + { + Rect rect = GUILayoutUtility.GetLastRect(); + rect.x -= 10; + rect.width += 10; + GLDraw.DrawBox(rect, Color.green, 1.5f); } } diff --git a/Assets/Shuttle/ShuttleGame.unity b/Assets/Shuttle/ShuttleGame.unity index a175ec73fa79a97000a7c6494d906df9ca8bebaf..552776acecbe70aba40771b8a2606fa17b37ee86 100644 GIT binary patch delta 22 ecmX@|kLAcemWC~i3zS)c{x5gjzC@XEfiwVr+zI>u delta 22 ecmX@|kLAcemWC~i3zS(H7-l+cU!u&oKpFsZNC=()