diff options
| author | Michael <[email protected]> | 2017-02-19 13:47:51 -0500 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-02-19 13:47:51 -0500 |
| commit | 762bd11cdf023e5340197b1a1438b5212f360a7d (patch) | |
| tree | 32ec50ece5f3279bd6c4672814e5de7a262ebb67 /ShiftOS.WinForms/WinformsDesktop.cs | |
| parent | b5a9b4caf2ae6e9d1712c65cbc1017ecbdad9ce4 (diff) | |
| download | shiftos_thereturn-762bd11cdf023e5340197b1a1438b5212f360a7d.tar.gz shiftos_thereturn-762bd11cdf023e5340197b1a1438b5212f360a7d.tar.bz2 shiftos_thereturn-762bd11cdf023e5340197b1a1438b5212f360a7d.zip | |
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.
Diffstat (limited to 'ShiftOS.WinForms/WinformsDesktop.cs')
| -rw-r--r-- | ShiftOS.WinForms/WinformsDesktop.cs | 36 |
1 files changed, 30 insertions, 6 deletions
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; /// <summary> /// Winforms desktop. @@ -122,7 +123,6 @@ namespace ShiftOS.WinForms time.Start(); this.DoubleBuffered = true; - } /// <summary> @@ -131,6 +131,7 @@ namespace ShiftOS.WinForms /// <returns>The panel buttons.</returns> public void PopulatePanelButtons() { + panelbuttonholder.Controls.Clear(); if (Shiftorium.IsInitiated == true) { @@ -200,6 +201,8 @@ namespace ShiftOS.WinForms } } } + + LuaInterpreter.RaiseEvent("on_panelbutton_populate", this); } /// <summary> @@ -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); + })); + }; } - /// <summary> - /// Shows the window. - /// </summary> - /// <returns>The window.</returns> - /// <param name="border">Border.</param> + /// <summary> + /// Shows the window. + /// </summary> + /// <returns>The window.</returns> + /// <param name="border">Border.</param> 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; + } + } } |
