From b40dab67f22e4b9957769367d682a92e4bd981cf Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 30 Jun 2022 22:15:07 -0700 Subject: start saving some settings to disk on quit We're still not reading them anywhere. --- main.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'main.lua') diff --git a/main.lua b/main.lua index 9e0f886..3898bc1 100644 --- a/main.lua +++ b/main.lua @@ -264,11 +264,18 @@ function schedule_save() end end --- make sure to save before quitting function love.quit() + -- make sure to save before quitting if Next_save then save_to_disk(Lines, Filename) end + -- save some important settings + local x,y,displayindex = love.window.getPosition() + local settings = { + x=x, y=y, displayindex=displayindex, + width=App.screen.width, height=App.screen.height, + font_height=Font_height, filename=Filename, screen_top=Screen_top1, cursor=Cursor1} + love.filesystem.write('config', json.encode(settings)) end function App.mousepressed(x,y, mouse_button) -- cgit 1.4.1-2-gfad0