persist window geometry to disk across restart
[?]
Jan 2, 2023, 2:19 AM
DSDKFEUKSAWZGMJ4PISC64WVYVSEHWAOJ5WE7K7PJAY5G3UGV36QCDependencies
- [2]
MPETAKZ2insert space for loading settings - [3]
LF3FPBGAmove - [4]
36Z442IVback to commit 8123959e52f without code editing - [5]
YT5P6TO6bugfix: save previous file when dropping a new one on - [*]
OTIBCAUJlove2d scaffold
Change contents
- replacement in main.lua at line 57
-- TODO: save settingslove.filesystem.write('config', json.encode(settings()))endfunction settings()local x, y, displayindex = App.screen.position()return {x=x, y=y, displayindex=displayindex,width=App.screen.width, height=App.screen.height,} - edit in main.lua at line 70
local settings = json.decode(love.filesystem.read('config'))local width, height, flags = love.window.getMode()flags.resizable = trueflags.minwidth = math.min(width, 200)flags.minheight = math.min(height, 200)App.screen.flags = flagsApp.screen.width = settings.widthApp.screen.height = settings.heightlove.window.setMode(App.screen.width, App.screen.height, App.screen.flags)love.window.setPosition(settings.x, settings.y, settings.displayindex)