pass remaining love handlers through

Now I have touchpressed and touchreleased working!

The stack of these handlers is quite deep at this point:
  car.* -> on.* -> App.* -> love.*

But I feel like I have a good rationale for each of these:
  love.* - OS
  App.* - testable
  on.* - live-editable
  car.* - the shell
This commit is contained in:
Kartik K. Agaram 2023-11-22 16:11:05 -08:00
parent b7345d85fc
commit 77eb05b50b
2 changed files with 13 additions and 0 deletions

View File

@ -1,4 +1,5 @@
on.initialize = function()
populate_missing_handlers()
love.graphics.setFont(love.graphics.newFont(Font_height))
Line_height = math.floor(Font_height*1.3)
Line_number_padding = Line_number_width*App.width('m')

View File

@ -0,0 +1,12 @@
populate_missing_handlers = function()
for handler_name in pairs(love.handlers) do
if on[handler_name] == nil then
-- make it available to scripts
on[handler_name] = function(...)
if car[handler_name] then
car[handler_name](...)
end
end
end
end
end