36
36
-- initial view, doesn't work
38
38
love.errhand = function (message)
39
if debugger._crashed then
40
debugger._originalErrhand(message)
44
if the.console and the.keys then
45
debugger._crashed = true
46
print(string.rep('=', 40))
47
print('\nCrash, ' .. message .. '\n')
48
print(debug.traceback())
49
print('\n' .. string.rep('=', 40) .. '\n')
53
-- enter a mini event loop, just updating the
62
for e, a, b, c, d in love.event.poll() do
64
if not love.quit or not love.quit() then return end
67
love.handlers[e](a, b, c, d)
73
elapsed = love.timer.getDelta()
76
the.keys:startFrame(elapsed)
77
the.console:startFrame(elapsed)
78
the.keys:update(elapsed)
79
the.console:update(elapsed)
80
the.keys:endFrame(elapsed)
81
the.console:endFrame(elapsed)
83
if the.keys:pressed('escape') then
84
if not love.quit or not love.quit() then return end
94
if love.timer then love.timer.sleep(0.02) end
95
if love.graphics then love.graphics.present() end
98
debugger._originalErrhand(message)
39
if debugger._handleCrash then debugger._handleCrash(message) end
106
46
setmetatable(_G, {
107
47
__index = function (table, key)
108
48
local info = debug.getinfo(2, 'Sl')
49
local print = debugger.unsourcedPrint or print
109
50
print('Warning: accessing undefined global ' .. key .. ', ' ..
110
51
info.short_src .. ' line ' .. info.currentline)
140
81
require 'zoetrope.ui.cursor'
141
82
require 'zoetrope.ui.textinput'
143
require 'zoetrope.utils.debug'
144
84
require 'zoetrope.utils.factory'
145
85
require 'zoetrope.utils.recorder'
146
86
require 'zoetrope.utils.storage'
147
87
require 'zoetrope.utils.subview'
90
require 'zoetrope.debug.instrument'
91
require 'zoetrope.debug.console'
92
require 'zoetrope.debug.locals'
93
require 'zoetrope.debug.performance'
94
require 'zoetrope.debug.shortcuts'
95
require 'zoetrope.debug.stack'
96
require 'zoetrope.debug.stepper'
97
require 'zoetrope.debug.watch'
98
require 'zoetrope.debug.debugger'
149
101
-- simple load function to bootstrap the app if love.load() hasn't already been defined;
150
102
-- defining it again after this works fine as well