Add YesNtWindowStatements for scripting window and UI element creation

This commit is contained in:
Stone_Red
2026-06-12 15:00:44 +02:00
parent a47656320a
commit 9f2aae3ba8
2 changed files with 614 additions and 7 deletions
+13 -7
View File
@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using RemSox.Processing;
using RemSox.Utils;
using YesNt.Interpreter.Runtime;
using YesNt.Interpreter.Utilities;
@@ -14,11 +12,19 @@ namespace RemSox.Processes
internal override void Start(string[] args)
{
// TODO: eventually we want to load these from a file instead of hardcoding them here
args = [
"win_create \"Test\" 320 240",
"global winId = %win_last_id",
"win_flush ${winId}",
"print ${winId}",
"label test:",
"goto test"
];
interpreter = new();
interpreter.AddStatement(new StatementInformation("%test", YesNt.Interpreter.Enums.SearchMode.Contains, YesNt.Interpreter.Enums.SpaceAround.None) { KeepStatementInArgs = true, Priority = YesNt.Interpreter.Enums.Priority.PreProcessing }, (args, context) =>
{
context.CurrentLine = TemplateProcessor.ProcessSimplePlaceholders(args, "%test", "Test successful!");
});
YesNtWindowStatements.Register(interpreter, this);
interpreter.Prepare([.. args]);
}