nice way to make on.* handlers more discoverable

This commit is contained in:
Kartik K. Agaram 2022-11-27 14:54:48 -08:00
parent fdf4722d2a
commit 8b8e08c4d6
5 changed files with 21 additions and 2 deletions

1
0001-manifest Normal file
View File

@ -0,0 +1 @@
{"parent":0,"on":1}

17
0001-on Normal file
View File

@ -0,0 +1,17 @@
on = {
-- for top-level handlers (see https://love2d.org/wiki/Main_Page for love.* variants)
-- supported handlers:
-- on.initialize (see love.load)
-- on.quit
-- on.draw
-- on.update
-- on.resize
-- on.filedropped
-- on.focus
-- on.mouse_pressed (see love.mousepressed)
-- on.mouse_released (see love.mousereleased)
-- on.keychord_pressed (see keychord.lua in this repo)
-- on.textinput
-- on.key_released (see love.keyreleased)
}

2
head
View File

@ -1 +1 @@
0
1

View File

@ -23,7 +23,6 @@ Live = {}
-- a namespace of frameworky callbacks
-- these will be modified live
-- TODO: how to make them discoverable?
on = {}
-- ========= on startup, load the version at head

View File

@ -44,6 +44,8 @@ function App.initialize(arg)
-- TODO: app-specific stuff goes here
love.window.setTitle('TODO')
if on.initialize then on.initialize(arg) end
if rawget(_G, 'jit') then
jit.off()
jit.flush()