From 762bd11cdf023e5340197b1a1438b5212f360a7d Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 19 Feb 2017 13:47:51 -0500 Subject: Kill experience shifter. Now all we need is a Lua->SFT compiler (not that hard) and then we can generate 0:/system/kernel.sft and have whatever's in there run at startup. --- ShiftOS.WinForms/WinformsDesktop.cs | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) (limited to 'ShiftOS.WinForms/WinformsDesktop.cs') diff --git a/ShiftOS.WinForms/WinformsDesktop.cs b/ShiftOS.WinForms/WinformsDesktop.cs index ab04bc8..83de1fb 100644 --- a/ShiftOS.WinForms/WinformsDesktop.cs +++ b/ShiftOS.WinForms/WinformsDesktop.cs @@ -36,6 +36,7 @@ using static ShiftOS.Engine.SkinEngine; using ShiftOS.WinForms.Tools; using ShiftOS.WinForms.Applications; using Newtonsoft.Json; +using ShiftOS.Engine.Scripting; /// /// Winforms desktop. @@ -122,7 +123,6 @@ namespace ShiftOS.WinForms time.Start(); this.DoubleBuffered = true; - } /// @@ -131,6 +131,7 @@ namespace ShiftOS.WinForms /// The panel buttons. public void PopulatePanelButtons() { + panelbuttonholder.Controls.Clear(); if (Shiftorium.IsInitiated == true) { @@ -200,6 +201,8 @@ namespace ShiftOS.WinForms } } } + + LuaInterpreter.RaiseEvent("on_panelbutton_populate", this); } /// @@ -273,6 +276,8 @@ namespace ShiftOS.WinForms } } + LuaInterpreter.RaiseEvent("on_desktop_skin", this); + PopulatePanelButtons(); } @@ -370,6 +375,8 @@ namespace ShiftOS.WinForms } } + + LuaInterpreter.RaiseEvent("on_al_populate", items); } @@ -385,13 +392,21 @@ namespace ShiftOS.WinForms SaveSystem.Begin(); SetupDesktop(); + + SaveSystem.GameReady += () => + { + this.Invoke(new Action(() => + { + LuaInterpreter.RaiseEvent("on_desktop_load", this); + })); + }; } - /// - /// Shows the window. - /// - /// The window. - /// Border. + /// + /// Shows the window. + /// + /// The window. + /// Border. public void ShowWindow(IWindowBorder border) { var brdr = border as Form; @@ -495,4 +510,13 @@ namespace ShiftOS.WinForms return this.Size; } } + + [ShiftOS.Engine.Scripting.Exposed("desktop")] + public class DesktopFunctions + { + public dynamic getWindow() + { + return Desktop.CurrentDesktop; + } + } } -- cgit v1.2.3