Added new nodes to DSL for a wider variety of commands and scripts.
This commit is contained in:
@@ -36,7 +36,23 @@ public partial class Robot : Node3D
|
||||
switch (currentNode.Execute(this, delta))
|
||||
{
|
||||
case NodeResult.SUCCESS:
|
||||
currentNode = currentNode.nextNode;
|
||||
if (currentNode.DisplayText == "Until")
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
currentNode = currentNode.previousNode;
|
||||
if (currentNode == null)
|
||||
{
|
||||
isExecuting = false;
|
||||
break;
|
||||
}
|
||||
if (currentNode.DisplayText == "For" || currentNode.DisplayText == "While") break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
currentNode = currentNode.nextNode;
|
||||
}
|
||||
if (currentNode == null)
|
||||
{
|
||||
isExecuting = false;
|
||||
@@ -51,6 +67,36 @@ public partial class Robot : Node3D
|
||||
case NodeResult.RUNNING:
|
||||
currentMessage = "";
|
||||
break;
|
||||
case NodeResult.CONDITIONFALSE:
|
||||
string sourceNode = currentNode.DisplayText;
|
||||
while (true)
|
||||
{
|
||||
currentNode = currentNode.nextNode;
|
||||
if (currentNode == null)
|
||||
{
|
||||
isExecuting = false;
|
||||
break;
|
||||
}
|
||||
if (sourceNode == "If")
|
||||
{
|
||||
if (currentNode.DisplayText == "If" || currentNode.DisplayText == "Else") break;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (currentNode.DisplayText == "While" || currentNode.DisplayText == "For" || currentNode.DisplayText == "Until")
|
||||
{
|
||||
if (currentNode.nextNode == null)
|
||||
{
|
||||
isExecuting = false;
|
||||
break;
|
||||
}
|
||||
currentNode = currentNode.nextNode;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user