Browse Source

Improved descriptions of commands

master
chrisgregan 11 years ago
parent
commit
62a8535614
  1. 12
      Assets/Fungus/VisualScripting/BooleanVariable.cs
  2. 12
      Assets/Fungus/VisualScripting/FloatVariable.cs
  3. 12
      Assets/Fungus/VisualScripting/IntegerVariable.cs
  4. 52
      Assets/Fungus/VisualScripting/Set.cs
  5. 12
      Assets/Fungus/VisualScripting/StringVariable.cs
  6. 26
      Assets/Fungus/VisualScripting/View.cs
  7. BIN
      Assets/Shuttle/ShuttleGame.unity

12
Assets/Fungus/VisualScripting/BooleanVariable.cs

@ -30,6 +30,18 @@ namespace Fungus.Script
get { return (booleanReference == null) ? booleanValue : booleanReference.Value; }
set { if (booleanReference == null) { booleanValue = value; } else { booleanReference.Value = value; } }
}
public string GetDescription()
{
if (booleanReference == null)
{
return booleanValue.ToString();
}
else
{
return booleanReference.key;
}
}
}
}

12
Assets/Fungus/VisualScripting/FloatVariable.cs

@ -29,6 +29,18 @@ namespace Fungus.Script
get { return (floatReference == null) ? floatValue : floatReference.Value; }
set { if (floatReference == null) { floatValue = value; } else { floatReference.Value = value; } }
}
public string GetDescription()
{
if (floatReference == null)
{
return floatValue.ToString();
}
else
{
return floatReference.key;
}
}
}
}

12
Assets/Fungus/VisualScripting/IntegerVariable.cs

@ -29,6 +29,18 @@ namespace Fungus.Script
get { return (integerReference == null) ? integerValue : integerReference.Value; }
set { if (integerReference == null) { integerValue = value; } else { integerReference.Value = value; } }
}
public string GetDescription()
{
if (integerReference == null)
{
return integerValue.ToString();
}
else
{
return integerReference.key;
}
}
}
}

52
Assets/Fungus/VisualScripting/Set.cs

@ -118,6 +118,58 @@ namespace Fungus.Script
Continue();
}
public override string GetDescription()
{
if (variable == null)
{
return "<Variable not selected>";
}
string description = variable.key;
switch (setOperator)
{
default:
case SetOperator.Assign:
description += " = ";
break;
case SetOperator.Negate:
description += " != ";
break;
case SetOperator.Add:
description += " += ";
break;
case SetOperator.Subtract:
description += " -= ";
break;
case SetOperator.Multiply:
description += " *= ";
break;
case SetOperator.Divide:
description += " /= ";
break;
}
if (variable.GetType() == typeof(BooleanVariable))
{
description += booleanData.GetDescription();
}
else if (variable.GetType() == typeof(IntegerVariable))
{
description += integerData.GetDescription();
}
else if (variable.GetType() == typeof(FloatVariable))
{
description += floatData.GetDescription();
}
else if (variable.GetType() == typeof(StringVariable))
{
description += stringData.GetDescription();
}
return description;
}
}
}

12
Assets/Fungus/VisualScripting/StringVariable.cs

@ -29,6 +29,18 @@ namespace Fungus.Script
get { return (stringReference == null) ? stringValue : stringReference.Value; }
set { if (stringReference == null) { stringValue = value; } else { stringReference.Value = value; } }
}
public string GetDescription()
{
if (stringReference == null)
{
return stringValue;
}
else
{
return stringReference.key;
}
}
}
}

26
Assets/Fungus/VisualScripting/View.cs

@ -57,6 +57,32 @@ namespace Fungus.Script
Continue();
}
}
public override string GetDescription()
{
string description = "";
switch (transition)
{
case Transition.Move:
description = "Move to ";
break;
case Transition.Fade:
description = "Fade to ";
break;
}
if (targetView == null)
{
description = "<no view selected>";
}
else
{
description += targetView.name;
}
return description;
}
}
}

BIN
Assets/Shuttle/ShuttleGame.unity

Binary file not shown.
Loading…
Cancel
Save