Browse Source

Added command button colours

master
chrisgregan 10 years ago
parent
commit
716e883ef2
  1. 2
      Assets/Fungus/Audio/Commands/PlayMusic.cs
  2. 2
      Assets/Fungus/Audio/Commands/PlaySound.cs
  3. 2
      Assets/Fungus/Audio/Commands/SetMusicVolume.cs
  4. 2
      Assets/Fungus/Audio/Commands/StopMusic.cs
  5. 2
      Assets/Fungus/Camera/Commands/FadeToView.cs
  6. 2
      Assets/Fungus/Camera/Commands/MoveToView.cs
  7. 2
      Assets/Fungus/Dialog/Commands/AddOption.cs
  8. 2
      Assets/Fungus/Dialog/Commands/Choose.cs
  9. 2
      Assets/Fungus/Dialog/Commands/Say.cs
  10. 2
      Assets/Fungus/FungusScript/Commands/Call.cs
  11. 2
      Assets/Fungus/FungusScript/Commands/If.cs
  12. 2
      Assets/Fungus/FungusScript/Commands/LoadGlobals.cs
  13. 2
      Assets/Fungus/FungusScript/Commands/LoadScene.cs
  14. 2
      Assets/Fungus/FungusScript/Commands/SaveGlobals.cs
  15. 2
      Assets/Fungus/FungusScript/Commands/Set.cs
  16. 2
      Assets/Fungus/FungusScript/Commands/Wait.cs
  17. 16
      Assets/Fungus/FungusScript/Editor/FungusCommandListAdaptor.cs
  18. 4
      Assets/Fungus/FungusScript/Scripts/FungusCommand.cs
  19. 2
      Assets/Fungus/Sprite/Commands/FadeSprite.cs
  20. BIN
      Assets/Shuttle/ShuttleGame.unity

2
Assets/Fungus/Audio/Commands/PlayMusic.cs

@ -6,7 +6,7 @@ namespace Fungus.Script
[CommandInfo("Audio", [CommandInfo("Audio",
"Play Music", "Play Music",
"Plays game music. If any game music is already playing, it is stopped. Music continues playing across scene loads.", "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 class PlayMusic : FungusCommand
{ {
public AudioClip musicClip; public AudioClip musicClip;

2
Assets/Fungus/Audio/Commands/PlaySound.cs

@ -6,7 +6,7 @@ namespace Fungus.Script
[CommandInfo("Audio", [CommandInfo("Audio",
"Play Sound", "Play Sound",
"Plays a sound effect. Multiple sound effects can play at the same time.", "Plays a sound effect. Multiple sound effects can play at the same time.",
1,1,1)] 242, 209, 176)]
public class PlaySound : FungusCommand public class PlaySound : FungusCommand
{ {
public AudioClip soundClip; public AudioClip soundClip;

2
Assets/Fungus/Audio/Commands/SetMusicVolume.cs

@ -6,7 +6,7 @@ namespace Fungus.Script
[CommandInfo("Audio", [CommandInfo("Audio",
"Set Music Volume", "Set Music Volume",
"Sets the game music volume level.", "Sets the game music volume level.",
1,1,1)] 242, 209, 176)]
public class SetMusicVolume : FungusCommand public class SetMusicVolume : FungusCommand
{ {
[Range(0,1)] [Range(0,1)]

2
Assets/Fungus/Audio/Commands/StopMusic.cs

@ -6,7 +6,7 @@ namespace Fungus.Script
[CommandInfo("Audio", [CommandInfo("Audio",
"Stop Music", "Stop Music",
"Stops the currently playing game music.", "Stops the currently playing game music.",
1,1,1)] 242, 209, 176)]
public class StopMusic : FungusCommand public class StopMusic : FungusCommand
{ {
public override void OnEnter() public override void OnEnter()

2
Assets/Fungus/Camera/Commands/FadeToView.cs

@ -7,7 +7,7 @@ namespace Fungus.Script
[CommandInfo("Camera", [CommandInfo("Camera",
"Fade To View", "Fade To View",
"Fades the camera out and in again at a location specified by a View object.", "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 class FadeToView : FungusCommand
{ {
public float duration; public float duration;

2
Assets/Fungus/Camera/Commands/MoveToView.cs

@ -7,7 +7,7 @@ namespace Fungus.Script
[CommandInfo("Camera", [CommandInfo("Camera",
"Move To View", "Move To View",
"Moves the camera to a location specified by a View object.", "Moves the camera to a location specified by a View object.",
1,1,1)] 216, 228, 170)]
public class MoveToView : FungusCommand public class MoveToView : FungusCommand
{ {
public float duration; public float duration;

2
Assets/Fungus/Dialog/Commands/AddOption.cs

@ -8,7 +8,7 @@ namespace Fungus.Script
[CommandInfo("Dialog", [CommandInfo("Dialog",
"Add Option", "Add Option",
"Adds an option for the player to select, displayed by the next Say command.", "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 class AddOption : FungusCommand
{ {
public string optionText; public string optionText;

2
Assets/Fungus/Dialog/Commands/Choose.cs

@ -8,7 +8,7 @@ namespace Fungus.Script
[CommandInfo("Dialog", [CommandInfo("Dialog",
"Choose", "Choose",
"Presents a list of options for the player to choose from, with an optional timeout. Add options using preceding AddOption commands.", "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 class Choose : FungusCommand
{ {
public ChooseDialog dialog; public ChooseDialog dialog;

2
Assets/Fungus/Dialog/Commands/Say.cs

@ -8,7 +8,7 @@ namespace Fungus.Script
[CommandInfo("Dialog", [CommandInfo("Dialog",
"Say", "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.", "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 class Say : FungusCommand
{ {
public SayDialog dialog; public SayDialog dialog;

2
Assets/Fungus/FungusScript/Commands/Call.cs

@ -7,7 +7,7 @@ namespace Fungus.Script
[CommandInfo("Scripting", [CommandInfo("Scripting",
"Call", "Call",
"Execute another sequence.", "Execute another sequence.",
1,1,1)] 253, 253, 150)]
public class Call : FungusCommand public class Call : FungusCommand
{ {
public Sequence targetSequence; public Sequence targetSequence;

2
Assets/Fungus/FungusScript/Commands/If.cs

@ -17,7 +17,7 @@ namespace Fungus.Script
[CommandInfo("Scripting", [CommandInfo("Scripting",
"If", "If",
"Execute another sequence IF a condition is true. Sequences can be specified for both true (THEN) and false (ELSE) conditions.", "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 class If : FungusCommand
{ {
public FungusVariable variable; public FungusVariable variable;

2
Assets/Fungus/FungusScript/Commands/LoadGlobals.cs

@ -7,7 +7,7 @@ namespace Fungus.Script
[CommandInfo("Scripting", [CommandInfo("Scripting",
"Load Globals", "Load Globals",
"Loads a set of global variables previously saved using the SaveGlobals command.", "Loads a set of global variables previously saved using the SaveGlobals command.",
1,1,1)] 253, 253, 150)]
public class LoadGlobals : FungusCommand public class LoadGlobals : FungusCommand
{ {
public string saveName = ""; public string saveName = "";

2
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 " + "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." + "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.", "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 class LoadScene : FungusCommand
{ {
public string sceneName = ""; public string sceneName = "";

2
Assets/Fungus/FungusScript/Commands/SaveGlobals.cs

@ -7,7 +7,7 @@ namespace Fungus.Script
[CommandInfo("Scripting", [CommandInfo("Scripting",
"Save Globals", "Save Globals",
"Saves all current global variables to be loaded again later using the LoadGlobals command. This provides a basic save game system.", "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 class SaveGlobals : FungusCommand
{ {
public string saveName = ""; public string saveName = "";

2
Assets/Fungus/FungusScript/Commands/Set.cs

@ -6,7 +6,7 @@ namespace Fungus.Script
[CommandInfo("Scripting", [CommandInfo("Scripting",
"Set", "Set",
"Sets a variable to a new value using simple arithmetic operations. The value can be a constant or another variable.", "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 class Set : FungusCommand
{ {
public enum SetOperator public enum SetOperator

2
Assets/Fungus/FungusScript/Commands/Wait.cs

@ -7,7 +7,7 @@ namespace Fungus.Script
[CommandInfo("Scripting", [CommandInfo("Scripting",
"Wait", "Wait",
"Waits for period of time before executing the next command in the sequence.", "Waits for period of time before executing the next command in the sequence.",
1,1,1)] 253, 253, 150)]
public class Wait : FungusCommand public class Wait : FungusCommand
{ {
public float duration = 1; public float duration = 1;

16
Assets/Fungus/FungusScript/Editor/FungusCommandListAdaptor.cs

@ -89,6 +89,12 @@ namespace Fungus.Script
{ {
FungusCommand command = this[index].objectReferenceValue as FungusCommand; FungusCommand command = this[index].objectReferenceValue as FungusCommand;
CommandInfoAttribute commandInfoAttr = FungusCommandEditor.GetCommandInfo(command.GetType());
if (commandInfoAttr == null)
{
return;
}
FungusScript fungusScript = command.GetFungusScript(); FungusScript fungusScript = command.GetFungusScript();
bool error = false; bool error = false;
@ -114,6 +120,10 @@ namespace Fungus.Script
{ {
GUI.backgroundColor = Color.yellow; GUI.backgroundColor = Color.yellow;
} }
else
{
GUI.backgroundColor = commandInfoAttr.ButtonColor;
}
Rect buttonRect = position; Rect buttonRect = position;
buttonRect.width = 80; buttonRect.width = 80;
@ -124,12 +134,6 @@ namespace Fungus.Script
summaryRect.x += 85; summaryRect.x += 85;
summaryRect.width -= 85; summaryRect.width -= 85;
CommandInfoAttribute commandInfoAttr = FungusCommandEditor.GetCommandInfo(command.GetType());
if (commandInfoAttr == null)
{
return;
}
string commandName = commandInfoAttr.CommandName; string commandName = commandInfoAttr.CommandName;
GUIStyle commandStyle = new GUIStyle(GUI.skin.box); GUIStyle commandStyle = new GUIStyle(GUI.skin.box);
if (GUI.Button(buttonRect, commandName, commandStyle)) if (GUI.Button(buttonRect, commandName, commandStyle))

4
Assets/Fungus/FungusScript/Scripts/FungusCommand.cs

@ -11,12 +11,12 @@ namespace Fungus.Script
public class CommandInfoAttribute : Attribute 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.Category = category;
this.CommandName = commandName; this.CommandName = commandName;
this.HelpText = helpText; this.HelpText = helpText;
this.ButtonColor = new Color(red, green, blue); this.ButtonColor = new Color32(red, green, blue, 255);
} }
public string Category { get; set; } public string Category { get; set; }

2
Assets/Fungus/Sprite/Commands/FadeSprite.cs

@ -7,7 +7,7 @@ namespace Fungus.Script
[CommandInfo("Sprite", [CommandInfo("Sprite",
"Fade Sprite", "Fade Sprite",
"Fades a sprite to a target color over a period of time.", "Fades a sprite to a target color over a period of time.",
1,1,1)] 212, 178, 211)]
public class FadeSprite : FungusCommand public class FadeSprite : FungusCommand
{ {
public SpriteRenderer spriteRenderer; public SpriteRenderer spriteRenderer;

BIN
Assets/Shuttle/ShuttleGame.unity

Binary file not shown.
Loading…
Cancel
Save