瀏覽代碼

Add CUSTOMDRAWLINE support

StuffedAnon 6 年之前
父節點
當前提交
11b1785da6
共有 1 個文件被更改,包括 14 次插入0 次删除
  1. 14 0
      NTERA.Engine/Runtime/Base/Keywords.cs

+ 14 - 0
NTERA.Engine/Runtime/Base/Keywords.cs

@@ -180,6 +180,20 @@ namespace NTERA.Engine.Runtime.Base
 			runtime.Console.PrintBar();
 		}
 
+		[Keyword("CUSTOMDRAWLINE", true)]
+		public static void CustomDrawLine(EraRuntime runtime, StackFrame context, ExecutionNode node)
+		{
+			if (node.SubNodes.Length == 1)
+			{
+				var value = runtime.ComputeExpression(context, node.Single());
+				runtime.Console.printCustomBar(value.ToString());
+			}
+			else {
+				throw new ArgumentException("Missing argument to CUSTOMDRAWLINE");
+			}
+
+		}
+
 		[Keyword("DRAWLINEFORM", true, true)]
 		public static void DrawLineForm(EraRuntime runtime, StackFrame context, ExecutionNode node)
 		{