mirror of
https://github.com/Ale32bit/Capy64.git
synced 2025-01-18 18:46:43 +00:00
Remove os.shutdown, superseded by machine lib
This commit is contained in:
parent
c6858f6bc0
commit
732311a730
1 changed files with 0 additions and 26 deletions
|
@ -15,31 +15,5 @@ public class OS : IPlugin
|
|||
public void LuaInit(Lua state)
|
||||
{
|
||||
state.GetGlobal("os");
|
||||
|
||||
state.PushString("shutdown");
|
||||
state.PushCFunction(L_Shutdown);
|
||||
state.SetTable(-3);
|
||||
}
|
||||
|
||||
private static int L_Shutdown(IntPtr state)
|
||||
{
|
||||
var L = Lua.FromIntPtr(state);
|
||||
|
||||
var doReboot = false;
|
||||
if (L.IsBoolean(1))
|
||||
{
|
||||
doReboot = L.ToBoolean(1);
|
||||
}
|
||||
|
||||
if (doReboot)
|
||||
{
|
||||
RuntimeManager.Reboot();
|
||||
}
|
||||
else
|
||||
{
|
||||
RuntimeManager.Shutdown();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue