From abfd774638d509a0d5fe5a61fe69b890fa3e0fc6 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 29 Jan 2017 11:59:18 -0500 Subject: Scripting changes and background music! --- ShiftOS_TheReturn/Scripting.cs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'ShiftOS_TheReturn/Scripting.cs') diff --git a/ShiftOS_TheReturn/Scripting.cs b/ShiftOS_TheReturn/Scripting.cs index bea2568..4d5c1a7 100644 --- a/ShiftOS_TheReturn/Scripting.cs +++ b/ShiftOS_TheReturn/Scripting.cs @@ -148,6 +148,37 @@ namespace ShiftOS.Engine.Scripting } } + [Exposed("console")] + public class ConsoleFunctions + { + public void write(dynamic text) + { + Console.Write(text.ToString()); + } + + public void writeLine(dynamic text) + { + Console.WriteLine(text.ToString()); + } + } + + [Exposed("sos")] + public class SystemFunctions + { + public int getCodepoints() { return SaveSystem.CurrentSave.Codepoints; } + + + public bool runCommand(string cmd) + { + var args = TerminalBackend.GetArgs(ref cmd); + + return TerminalBackend.RunClient(cmd, args); + } + + + } + + public class ExposedAttribute : Attribute { /// -- cgit v1.2.3