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",
"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;

2
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;

2
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)]

2
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()

2
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;

2
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;

2
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;

2
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;

2
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;

2
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;

2
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;

2
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 = "";

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 " +
"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 = "";

2
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 = "";

2
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

2
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;

16
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;
@ -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))

4
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; }

2
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;

BIN
Assets/Shuttle/ShuttleGame.unity

Binary file not shown.
Loading…
Cancel
Save