diff --git a/0001-on b/0001-on index 9c0d77f..9300386 100644 --- a/0001-on +++ b/0001-on @@ -15,4 +15,6 @@ on = { -- on.keychord_press (see keychord.lua in this repo) -- on.text_input (see love.textinput) -- on.key_release (see love.keyreleased) + -- on.load_settings(settings) -- fan out settings table into any other global state + -- on.save_settings() -- return a settings table which will be persisted to disk across restart } diff --git a/main.lua b/main.lua index e4f266a..b846322 100644 --- a/main.lua +++ b/main.lua @@ -62,6 +62,7 @@ function settings() return { x=x, y=y, displayindex=displayindex, width=App.screen.width, height=App.screen.height, + app = on.save_settings and on.save_settings(), } end @@ -77,6 +78,7 @@ function load_settings() App.screen.height = settings.height love.window.setMode(App.screen.width, App.screen.height, App.screen.flags) love.window.setPosition(settings.x, settings.y, settings.displayindex) + if on.load_settings then on.load_settings(settings.app) end else local font_height = 20 love.graphics.setFont(love.graphics.newFont(font_height))