From 716e883ef25cc3c466d9da630e9b2cdb31d48ff1 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Wed, 3 Sep 2014 11:40:50 +0100 Subject: [PATCH] Added command button colours --- Assets/Fungus/Audio/Commands/PlayMusic.cs | 2 +- Assets/Fungus/Audio/Commands/PlaySound.cs | 2 +- .../Fungus/Audio/Commands/SetMusicVolume.cs | 2 +- Assets/Fungus/Audio/Commands/StopMusic.cs | 2 +- Assets/Fungus/Camera/Commands/FadeToView.cs | 2 +- Assets/Fungus/Camera/Commands/MoveToView.cs | 2 +- Assets/Fungus/Dialog/Commands/AddOption.cs | 2 +- Assets/Fungus/Dialog/Commands/Choose.cs | 2 +- Assets/Fungus/Dialog/Commands/Say.cs | 2 +- Assets/Fungus/FungusScript/Commands/Call.cs | 2 +- Assets/Fungus/FungusScript/Commands/If.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 +++++++++++------- .../FungusScript/Scripts/FungusCommand.cs | 4 ++-- Assets/Fungus/Sprite/Commands/FadeSprite.cs | 2 +- Assets/Shuttle/ShuttleGame.unity | Bin 118492 -> 122140 bytes 20 files changed, 30 insertions(+), 26 deletions(-) diff --git a/Assets/Fungus/Audio/Commands/PlayMusic.cs b/Assets/Fungus/Audio/Commands/PlayMusic.cs index 12851f56..84cb30e3 100644 --- a/Assets/Fungus/Audio/Commands/PlayMusic.cs +++ b/Assets/Fungus/Audio/Commands/PlayMusic.cs @@ -6,7 +6,7 @@ namespace Fungus.Script [CommandInfo("Audio", "Play Music", "Plays game music. If any game music is already playing, it is stopped. Music continues playing across scene loads.", - 1,1,1)] + 242, 209, 176)] public class PlayMusic : FungusCommand { public AudioClip musicClip; diff --git a/Assets/Fungus/Audio/Commands/PlaySound.cs b/Assets/Fungus/Audio/Commands/PlaySound.cs index 033e4496..590fe0e1 100644 --- a/Assets/Fungus/Audio/Commands/PlaySound.cs +++ b/Assets/Fungus/Audio/Commands/PlaySound.cs @@ -6,7 +6,7 @@ namespace Fungus.Script [CommandInfo("Audio", "Play Sound", "Plays a sound effect. Multiple sound effects can play at the same time.", - 1,1,1)] + 242, 209, 176)] public class PlaySound : FungusCommand { public AudioClip soundClip; diff --git a/Assets/Fungus/Audio/Commands/SetMusicVolume.cs b/Assets/Fungus/Audio/Commands/SetMusicVolume.cs index be4a01b3..6bdbed76 100644 --- a/Assets/Fungus/Audio/Commands/SetMusicVolume.cs +++ b/Assets/Fungus/Audio/Commands/SetMusicVolume.cs @@ -6,7 +6,7 @@ namespace Fungus.Script [CommandInfo("Audio", "Set Music Volume", "Sets the game music volume level.", - 1,1,1)] + 242, 209, 176)] public class SetMusicVolume : FungusCommand { [Range(0,1)] diff --git a/Assets/Fungus/Audio/Commands/StopMusic.cs b/Assets/Fungus/Audio/Commands/StopMusic.cs index c9257f62..dc967042 100644 --- a/Assets/Fungus/Audio/Commands/StopMusic.cs +++ b/Assets/Fungus/Audio/Commands/StopMusic.cs @@ -6,7 +6,7 @@ namespace Fungus.Script [CommandInfo("Audio", "Stop Music", "Stops the currently playing game music.", - 1,1,1)] + 242, 209, 176)] public class StopMusic : FungusCommand { public override void OnEnter() diff --git a/Assets/Fungus/Camera/Commands/FadeToView.cs b/Assets/Fungus/Camera/Commands/FadeToView.cs index 7ce041f5..4339fd09 100644 --- a/Assets/Fungus/Camera/Commands/FadeToView.cs +++ b/Assets/Fungus/Camera/Commands/FadeToView.cs @@ -7,7 +7,7 @@ namespace Fungus.Script [CommandInfo("Camera", "Fade To View", "Fades the camera out and in again at a location specified by a View object.", - 1,1,1)] + 216, 228, 170)] public class FadeToView : FungusCommand { public float duration; diff --git a/Assets/Fungus/Camera/Commands/MoveToView.cs b/Assets/Fungus/Camera/Commands/MoveToView.cs index f0957778..738b00cb 100644 --- a/Assets/Fungus/Camera/Commands/MoveToView.cs +++ b/Assets/Fungus/Camera/Commands/MoveToView.cs @@ -7,7 +7,7 @@ namespace Fungus.Script [CommandInfo("Camera", "Move To View", "Moves the camera to a location specified by a View object.", - 1,1,1)] + 216, 228, 170)] public class MoveToView : FungusCommand { public float duration; diff --git a/Assets/Fungus/Dialog/Commands/AddOption.cs b/Assets/Fungus/Dialog/Commands/AddOption.cs index 5e26e745..75f78c13 100644 --- a/Assets/Fungus/Dialog/Commands/AddOption.cs +++ b/Assets/Fungus/Dialog/Commands/AddOption.cs @@ -8,7 +8,7 @@ namespace Fungus.Script [CommandInfo("Dialog", "Add Option", "Adds an option for the player to select, displayed by the next Say command.", - 1,1,1)] + 184, 210, 235)] public class AddOption : FungusCommand { public string optionText; diff --git a/Assets/Fungus/Dialog/Commands/Choose.cs b/Assets/Fungus/Dialog/Commands/Choose.cs index 5dd50029..a4488e10 100644 --- a/Assets/Fungus/Dialog/Commands/Choose.cs +++ b/Assets/Fungus/Dialog/Commands/Choose.cs @@ -8,7 +8,7 @@ namespace Fungus.Script [CommandInfo("Dialog", "Choose", "Presents a list of options for the player to choose from, with an optional timeout. Add options using preceding AddOption commands.", - 1,1,1)] + 184, 210, 235)] public class Choose : FungusCommand { public ChooseDialog dialog; diff --git a/Assets/Fungus/Dialog/Commands/Say.cs b/Assets/Fungus/Dialog/Commands/Say.cs index e3ff846b..0cf85fba 100644 --- a/Assets/Fungus/Dialog/Commands/Say.cs +++ b/Assets/Fungus/Dialog/Commands/Say.cs @@ -8,7 +8,7 @@ namespace Fungus.Script [CommandInfo("Dialog", "Say", "Writes a line of story text to the dialog. A list of options can be specified for the player to choose from. Use a non-zero timeout to give the player a limited time to choose.", - 1,1,1)] + 184, 210, 235)] public class Say : FungusCommand { public SayDialog dialog; diff --git a/Assets/Fungus/FungusScript/Commands/Call.cs b/Assets/Fungus/FungusScript/Commands/Call.cs index e62a83af..981bd3c6 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.", - 1,1,1)] + 253, 253, 150)] public class Call : FungusCommand { public Sequence targetSequence; diff --git a/Assets/Fungus/FungusScript/Commands/If.cs b/Assets/Fungus/FungusScript/Commands/If.cs index 8d07b23e..224444ec 100644 --- a/Assets/Fungus/FungusScript/Commands/If.cs +++ b/Assets/Fungus/FungusScript/Commands/If.cs @@ -17,7 +17,7 @@ namespace Fungus.Script [CommandInfo("Scripting", "If", "Execute another sequence IF a condition is true. Sequences can be specified for both true (THEN) and false (ELSE) conditions.", - 1,1,1)] + 253, 253, 150)] public class If : FungusCommand { public FungusVariable variable; diff --git a/Assets/Fungus/FungusScript/Commands/LoadGlobals.cs b/Assets/Fungus/FungusScript/Commands/LoadGlobals.cs index d12af87d..2d08c9ca 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.", - 1,1,1)] + 253, 253, 150)] public class LoadGlobals : FungusCommand { public string saveName = ""; diff --git a/Assets/Fungus/FungusScript/Commands/LoadScene.cs b/Assets/Fungus/FungusScript/Commands/LoadScene.cs index 9cd5c758..a2691a32 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.", - 1,1,1)] + 204, 204, 204)] public class LoadScene : FungusCommand { public string sceneName = ""; diff --git a/Assets/Fungus/FungusScript/Commands/SaveGlobals.cs b/Assets/Fungus/FungusScript/Commands/SaveGlobals.cs index 810e22b8..39e28027 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.", - 1,1,1)] + 253, 253, 150)] public class SaveGlobals : FungusCommand { public string saveName = ""; diff --git a/Assets/Fungus/FungusScript/Commands/Set.cs b/Assets/Fungus/FungusScript/Commands/Set.cs index 657d37ed..7cd55875 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.", - 1,1,1)] + 253, 253, 150)] public class Set : FungusCommand { public enum SetOperator diff --git a/Assets/Fungus/FungusScript/Commands/Wait.cs b/Assets/Fungus/FungusScript/Commands/Wait.cs index e96ac26c..40722832 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.", - 1,1,1)] + 253, 253, 150)] 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 f164fcfa..681e4e66 100644 --- a/Assets/Fungus/FungusScript/Editor/FungusCommandListAdaptor.cs +++ b/Assets/Fungus/FungusScript/Editor/FungusCommandListAdaptor.cs @@ -89,6 +89,12 @@ namespace Fungus.Script { FungusCommand command = this[index].objectReferenceValue as FungusCommand; + CommandInfoAttribute commandInfoAttr = FungusCommandEditor.GetCommandInfo(command.GetType()); + if (commandInfoAttr == null) + { + return; + } + FungusScript fungusScript = command.GetFungusScript(); bool error = false; @@ -101,7 +107,7 @@ namespace Fungus.Script { error = true; } - + if (!command.enabled) { GUI.backgroundColor = Color.grey; @@ -114,6 +120,10 @@ namespace Fungus.Script { GUI.backgroundColor = Color.yellow; } + else + { + GUI.backgroundColor = commandInfoAttr.ButtonColor; + } Rect buttonRect = position; buttonRect.width = 80; @@ -124,12 +134,6 @@ namespace Fungus.Script summaryRect.x += 85; summaryRect.width -= 85; - CommandInfoAttribute commandInfoAttr = FungusCommandEditor.GetCommandInfo(command.GetType()); - if (commandInfoAttr == null) - { - return; - } - string commandName = commandInfoAttr.CommandName; GUIStyle commandStyle = new GUIStyle(GUI.skin.box); if (GUI.Button(buttonRect, commandName, commandStyle)) diff --git a/Assets/Fungus/FungusScript/Scripts/FungusCommand.cs b/Assets/Fungus/FungusScript/Scripts/FungusCommand.cs index 925c295e..1422083a 100644 --- a/Assets/Fungus/FungusScript/Scripts/FungusCommand.cs +++ b/Assets/Fungus/FungusScript/Scripts/FungusCommand.cs @@ -11,12 +11,12 @@ namespace Fungus.Script public class CommandInfoAttribute : Attribute { - public CommandInfoAttribute(string category, string commandName, string helpText, float red, float green, float blue) + public CommandInfoAttribute(string category, string commandName, string helpText, byte red, byte green, byte blue) { this.Category = category; this.CommandName = commandName; this.HelpText = helpText; - this.ButtonColor = new Color(red, green, blue); + this.ButtonColor = new Color32(red, green, blue, 255); } public string Category { get; set; } diff --git a/Assets/Fungus/Sprite/Commands/FadeSprite.cs b/Assets/Fungus/Sprite/Commands/FadeSprite.cs index 5a0bca68..7cdf9153 100644 --- a/Assets/Fungus/Sprite/Commands/FadeSprite.cs +++ b/Assets/Fungus/Sprite/Commands/FadeSprite.cs @@ -7,7 +7,7 @@ namespace Fungus.Script [CommandInfo("Sprite", "Fade Sprite", "Fades a sprite to a target color over a period of time.", - 1,1,1)] + 212, 178, 211)] public class FadeSprite : FungusCommand { public SpriteRenderer spriteRenderer; diff --git a/Assets/Shuttle/ShuttleGame.unity b/Assets/Shuttle/ShuttleGame.unity index 95bedfde114bc22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