From 1e497cd355543428c75c56ad9bfdd6967c57a579 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Thu, 4 Sep 2014 12:30:48 +0100 Subject: [PATCH] Changed colour for If, Else, EndIf commands. --- Assets/Fungus/FungusScript/Commands/Call.cs | 2 +- .../FungusScript/Commands/LoadGlobals.cs | 2 +- .../Fungus/FungusScript/Commands/LoadScene.cs | 2 +- .../FungusScript/Commands/SaveGlobals.cs | 2 +- Assets/Fungus/FungusScript/Commands/Set.cs | 2 +- Assets/Fungus/FungusScript/Commands/Wait.cs | 2 +- .../Editor/FungusCommandListAdaptor.cs | 18 +++++++----------- 7 files changed, 13 insertions(+), 17 deletions(-) diff --git a/Assets/Fungus/FungusScript/Commands/Call.cs b/Assets/Fungus/FungusScript/Commands/Call.cs index 51a8f753..5f486c87 100644 --- a/Assets/Fungus/FungusScript/Commands/Call.cs +++ b/Assets/Fungus/FungusScript/Commands/Call.cs @@ -7,7 +7,7 @@ namespace Fungus.Script [CommandInfo("Scripting", "Call", "Execute another sequence.", - 253, 253, 150)] + 255, 255, 255)] public class Call : FungusCommand { public Sequence targetSequence; diff --git a/Assets/Fungus/FungusScript/Commands/LoadGlobals.cs b/Assets/Fungus/FungusScript/Commands/LoadGlobals.cs index 2d08c9ca..4b3c1bcc 100644 --- a/Assets/Fungus/FungusScript/Commands/LoadGlobals.cs +++ b/Assets/Fungus/FungusScript/Commands/LoadGlobals.cs @@ -7,7 +7,7 @@ namespace Fungus.Script [CommandInfo("Scripting", "Load Globals", "Loads a set of global variables previously saved using the SaveGlobals command.", - 253, 253, 150)] + 255, 255, 255)] public class LoadGlobals : FungusCommand { public string saveName = ""; diff --git a/Assets/Fungus/FungusScript/Commands/LoadScene.cs b/Assets/Fungus/FungusScript/Commands/LoadScene.cs index 29a54196..aba52343 100644 --- a/Assets/Fungus/FungusScript/Commands/LoadScene.cs +++ b/Assets/Fungus/FungusScript/Commands/LoadScene.cs @@ -10,7 +10,7 @@ namespace Fungus.Script "for splitting a large game across multiple scene files to reduce peak memory " + "usage. All previously loaded assets (including textures and audio) will be released." + "The scene to be loaded must be added to the scene list in Build Settings.", - 253, 253, 150)] + 255, 255, 255)] public class LoadScene : FungusCommand { public string sceneName = ""; diff --git a/Assets/Fungus/FungusScript/Commands/SaveGlobals.cs b/Assets/Fungus/FungusScript/Commands/SaveGlobals.cs index 39e28027..84c4782c 100644 --- a/Assets/Fungus/FungusScript/Commands/SaveGlobals.cs +++ b/Assets/Fungus/FungusScript/Commands/SaveGlobals.cs @@ -7,7 +7,7 @@ namespace Fungus.Script [CommandInfo("Scripting", "Save Globals", "Saves all current global variables to be loaded again later using the LoadGlobals command. This provides a basic save game system.", - 253, 253, 150)] + 255, 255, 255)] public class SaveGlobals : FungusCommand { public string saveName = ""; diff --git a/Assets/Fungus/FungusScript/Commands/Set.cs b/Assets/Fungus/FungusScript/Commands/Set.cs index 7cd55875..a8de3821 100644 --- a/Assets/Fungus/FungusScript/Commands/Set.cs +++ b/Assets/Fungus/FungusScript/Commands/Set.cs @@ -6,7 +6,7 @@ namespace Fungus.Script [CommandInfo("Scripting", "Set", "Sets a variable to a new value using simple arithmetic operations. The value can be a constant or another variable.", - 253, 253, 150)] + 255, 255, 255)] public class Set : FungusCommand { public enum SetOperator diff --git a/Assets/Fungus/FungusScript/Commands/Wait.cs b/Assets/Fungus/FungusScript/Commands/Wait.cs index 40722832..e5d340fd 100644 --- a/Assets/Fungus/FungusScript/Commands/Wait.cs +++ b/Assets/Fungus/FungusScript/Commands/Wait.cs @@ -7,7 +7,7 @@ namespace Fungus.Script [CommandInfo("Scripting", "Wait", "Waits for period of time before executing the next command in the sequence.", - 253, 253, 150)] + 255, 255, 255)] public class Wait : FungusCommand { public float duration = 1; diff --git a/Assets/Fungus/FungusScript/Editor/FungusCommandListAdaptor.cs b/Assets/Fungus/FungusScript/Editor/FungusCommandListAdaptor.cs index fa78d5b8..15ee1c83 100644 --- a/Assets/Fungus/FungusScript/Editor/FungusCommandListAdaptor.cs +++ b/Assets/Fungus/FungusScript/Editor/FungusCommandListAdaptor.cs @@ -170,7 +170,7 @@ namespace Fungus.Script buttonRect.x += indentWidth; buttonRect.width = buttonWidth; buttonRect.y -= 2; - buttonRect.height += 5; + buttonRect.height += 6; Rect summaryRect = buttonRect; summaryRect.x += buttonWidth - 1; @@ -193,14 +193,14 @@ namespace Fungus.Script summaryBackgroundColor = Color.green; buttonBackgroundColor = Color.green; } - else if (error) + else if (!command.enabled) { - summaryBackgroundColor = Color.red; + buttonBackgroundColor = Color.grey; + summaryBackgroundColor = Color.grey; } - - if (!command.enabled) + else if (error) { - buttonBackgroundColor = Color.grey; + summaryBackgroundColor = Color.red; } GUI.backgroundColor = buttonBackgroundColor; @@ -208,11 +208,7 @@ namespace Fungus.Script GUIStyle labelStyle = new GUIStyle(EditorStyles.miniButtonRight); labelStyle.alignment = TextAnchor.MiddleLeft; - if (!command.enabled) - { - labelStyle.normal.textColor = Color.grey; - } - else if (error && !selected) + if (error && !selected) { labelStyle.normal.textColor = Color.white; }