mirror of
https://github.com/TangentFoxy/lurker.git
synced 2025-07-27 18:42:18 +00:00
Added "escape" hotkey to error state
This commit is contained in:
20
lurker.lua
20
lurker.lua
@@ -90,15 +90,25 @@ end
|
||||
function lurker.onerror(e, nostacktrace)
|
||||
lurker.print("An error occurred; switching to error state")
|
||||
lurker.state = "error"
|
||||
for _, v in pairs(lovecallbacknames) do
|
||||
love[v] = function() end
|
||||
end
|
||||
love.update = lurker.update
|
||||
|
||||
|
||||
-- Release mouse
|
||||
local setgrab = love.mouse.setGrab or love.mouse.setGrabbed
|
||||
setgrab(false)
|
||||
|
||||
-- Set up callbacks
|
||||
for _, v in pairs(lovecallbacknames) do
|
||||
love[v] = function() end
|
||||
end
|
||||
|
||||
love.update = lurker.update
|
||||
|
||||
love.keypressed = function(k)
|
||||
if k == "escape" then
|
||||
lurker.print("Exiting...")
|
||||
love.event.quit()
|
||||
end
|
||||
end
|
||||
|
||||
local stacktrace = nostacktrace and "" or
|
||||
lume.trim((debug.traceback("", 2):gsub("\t", "")))
|
||||
local msg = lume.format("{1}\n\n{2}", {e, stacktrace})
|
||||
|
Reference in New Issue
Block a user