From 6d1f691557035f740b9048d1121199548ae6d50c Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Tue, 19 Aug 2014 14:42:43 +0100 Subject: [PATCH] Improved summary for If command --- Assets/Fungus/VisualScripting/If.cs | 54 ++++++++++++++++++++++++---- Assets/Shuttle/ShuttleGame.unity | Bin 93756 -> 93772 bytes 2 files changed, 47 insertions(+), 7 deletions(-) diff --git a/Assets/Fungus/VisualScripting/If.cs b/Assets/Fungus/VisualScripting/If.cs index de3f0c52..5f1486c7 100644 --- a/Assets/Fungus/VisualScripting/If.cs +++ b/Assets/Fungus/VisualScripting/If.cs @@ -169,27 +169,67 @@ namespace Fungus.Script return "No variable selected"; } - string description = "IF " + variable.key + " THEN "; + string summary = variable.key; + switch (compareOperator) + { + case CompareOperator.Equals: + summary += " == "; + break; + case CompareOperator.NotEquals: + summary += " != "; + break; + case CompareOperator.LessThan: + summary += " < "; + break; + case CompareOperator.GreaterThan: + summary += " > "; + break; + case CompareOperator.LessThanOrEquals: + summary += " <= "; + break; + case CompareOperator.GreaterThanOrEquals: + summary += " >= "; + break; + } + + if (variable.GetType() == typeof(BooleanVariable)) + { + summary += booleanValue.GetDescription(); + } + else if (variable.GetType() == typeof(IntegerVariable)) + { + summary += integerValue.GetDescription(); + } + else if (variable.GetType() == typeof(FloatVariable)) + { + summary += floatValue.GetDescription(); + } + else if (variable.GetType() == typeof(StringVariable)) + { + summary += stringValue.GetDescription(); + } + + summary += " THEN "; if (thenSequence == null) { - description += ""; + summary += ""; } else { - description += thenSequence.name; + summary += thenSequence.name; } - description += " ELSE "; + summary += " ELSE "; if (elseSequence == null) { - description += ""; + summary += ""; } else { - description += elseSequence.name; + summary += elseSequence.name; } - return description; + return summary; } public override bool HasReference(FungusVariable variable) diff --git a/Assets/Shuttle/ShuttleGame.unity b/Assets/Shuttle/ShuttleGame.unity index 59d6e7f959349c3534c1e9afde283847fcc95a94..3c9f60694ac3473680ac094f3dbd41b1283733a3 100644 GIT binary patch delta 3439 zcmZA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