diff options
Diffstat (limited to 'src/lua/embed/boot.lua.h')
-rw-r--r-- | src/lua/embed/boot.lua.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/lua/embed/boot.lua.h b/src/lua/embed/boot.lua.h index f41ba3b..055a653 100644 --- a/src/lua/embed/boot.lua.h +++ b/src/lua/embed/boot.lua.h @@ -138,27 +138,29 @@ jin.nogame = { ------------------------------------------------------------------------- local function onError(msg) - local tab = ' ' print("Error:\n" .. msg) function jin.core.onEvent(e) - if e.type == 'quit' then + if e.type == "Quit" then jin.core.stop() end end - local ww, wh = jin.graphics.getSize() function jin.core.onDraw() - jin.graphics.write("Error: ", 10, 10, 30, 3, 30) - jin.graphics.write(msg, 10, 50) + jin.graphics.unsetFont() + jin.graphics.print("Error:\n" .. msg .. "\n" .. debug.traceback(), 5, 5) end + jin.graphics.setClearColor(100, 100, 100, 255) + jin.core.onLoad = nil + jin.core.run() + jin.core.quit() end local function boot() if jin.filesystem.exist("main.lua") then - -- require main game script + -- Require main game script xpcall(function() require"main" end, onError) - jin.core.run() + xpcall(function() jin.core.run() end, onError) else - -- no game + -- No game jin.core.setHandler(jin.nogame) jin.core.run() end @@ -169,4 +171,4 @@ end xpcall(boot, onError) -)"; +)";
\ No newline at end of file |