on error, switch to a whole other event loop
Dependencies
- [2]
NVEA3SMUreorg - [3]
EZZWF7WPdefine App.run_frame at the top level - [4]
TBWAE64Aapp is now live, can communicate with driver - [5]
5WHW3IDOfix initialization errors using driver.love - [6]
DMS3N5YDundo an ancient hack; be an idiomatic LÖVE app - [7]
3QNOKBFMbeginnings of a test harness - [8]
AVTNUQYRbasic test-enabled framework - [9]
DJSIRUMDa more radical attempt at ignoring nil y's - [10]
AGJXIDOFhardcode some assumptions about how this app uses love - [11]
36Z442IVback to commit 8123959e52f without code editing - [*]
LRDM35CEapp running again - [*]
T7QIIGQ6attempt at better error recovery
Change contents
- edit in live.lua at line 382
local main_run_frame = App.run_frame-- one iteration of the event loop when showing an error-- return nil to continue the event loop, non-nil to quitlocal error_frame_keys_down = {}function error_run_frame()if love.event thenlove.event.pump()for name, a,b,c,d,e,f in love.event.poll() doif name == 'quit' thenreturn a or 0elseif name == 'keypressed' thenerror_frame_keys_down[a] = true-- C-cif a == 'c' and (error_frame_keys_down.lctrl or error_frame_keys_down.rctrl) thenlove.system.setClipboardText(Error_message)endelseif name == 'keyreleased' thenerror_frame_keys_down[a] = nilApp.run_frame = main_run_frameendendend - edit in live.lua at line 407
local dt = love.timer.step()Current_time = Current_time + dtlive.update(dt)love.graphics.origin()love.graphics.clear(love.graphics.getBackgroundColor())love.graphics.setColor(0,0,1)love.graphics.rectangle('fill', 0,0, App.screen.width, App.screen.height)love.graphics.setColor(1,1,1)love.graphics.printf(Error_message, 40,40, 600)love.graphics.present()love.timer.sleep(0.001)-- returning nil continues the loopend - edit in live.lua at line 441[14.2212][13.10774]
App.run_frame = error_run_frame - edit in app.lua at line 158
local dt = 0 - replacement in app.lua at line 170
App.run_frame = function()function App.run_frame() - replacement in app.lua at line 183
dt = love.timer.step()local dt = love.timer.step()