diff --git a/ShiftOS.Modding.VirtualMachine/Form1.cs b/ShiftOS.Modding.VirtualMachine/Form1.cs index 78722a9..3baabcf 100644 --- a/ShiftOS.Modding.VirtualMachine/Form1.cs +++ b/ShiftOS.Modding.VirtualMachine/Form1.cs @@ -12,7 +12,7 @@ using ShiftOS.Objects.ShiftFS; namespace ShiftOS.Modding.VirtualMachine { - [Launcher("ShiftOS Virtual Machine", false)] + [Launcher("ShiftOS Virtual Machine", false, null, "Programming")] public partial class Form1 : UserControl, IShiftOSWindow { private byte[] memory = null; //program binary diff --git a/ShiftOS.WinForms/WinformsDesktop.cs b/ShiftOS.WinForms/WinformsDesktop.cs index e2b89fb..528839d 100644 --- a/ShiftOS.WinForms/WinformsDesktop.cs +++ b/ShiftOS.WinForms/WinformsDesktop.cs @@ -263,7 +263,16 @@ namespace ShiftOS.WinForms item.Text = kv.DisplayData.Name; item.Click += (o, a) => { - Engine.AppearanceManager.SetupWindow(Activator.CreateInstance(kv.LaunchType) as IShiftOSWindow); + if (kv is LuaLauncherItem) + { + var interpreter = new Engine.Scripting.LuaInterpreter(); + interpreter.ExecuteFile((kv as LuaLauncherItem).LaunchPath); + } + else + { + Engine.AppearanceManager.SetupWindow(Activator.CreateInstance(kv.LaunchType) as IShiftOSWindow); + } + }; if (sortedItems.ContainsKey(kv.DisplayData.Category)) { diff --git a/ShiftOS_TheReturn/AppLauncherDaemon.cs b/ShiftOS_TheReturn/AppLauncherDaemon.cs index 9a0754b..7ef34c1 100644 --- a/ShiftOS_TheReturn/AppLauncherDaemon.cs +++ b/ShiftOS_TheReturn/AppLauncherDaemon.cs @@ -30,6 +30,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using Newtonsoft.Json; +using ShiftOS.Objects.ShiftFS; namespace ShiftOS.Engine { @@ -84,6 +85,15 @@ namespace ShiftOS.Engine } } } + + foreach(var file in Utils.GetFiles(Paths.GetPath("applauncher"))) + { + if (file.EndsWith(".al")) + { + var item = JsonConvert.DeserializeObject(Utils.ReadAllText(file)); + win.Add(item); + } + } return win; } @@ -95,4 +105,14 @@ namespace ShiftOS.Engine public Type LaunchType { get; internal set; } } + + public class LuaLauncherItem : LauncherItem + { + public LuaLauncherItem(string file) + { + LaunchPath = file; + } + + public string LaunchPath { get; private set; } + } } diff --git a/ShiftOS_TheReturn/Paths.cs b/ShiftOS_TheReturn/Paths.cs index e773d1d..aeca13d 100644 --- a/ShiftOS_TheReturn/Paths.cs +++ b/ShiftOS_TheReturn/Paths.cs @@ -56,6 +56,7 @@ namespace ShiftOS.Engine AddPath("local", "deutsch.local"); AddPath("local", "verbose.local"); AddPath("system", "data"); + AddPath("system", "applauncher"); AddPath("data", "save.json"); AddPath("data", "user.dat"); AddPath("data", "skin");