first commandline arg: window dimensions
[?]
Jun 7, 2022, 9:11 PM
46ASCE5K5QRO6BZNJPW4CJZCRVVG76S3GENIBGNGB352CP3DLDCQCDependencies
- [2]
NEXUNNCFextract a function - [3]
Z4KNS42Nto open a file without a terminal, drag it on! - [4]
AVQ5MC5Dfinish uppercasing all globals - [5]
73OCE2MCafter much struggle, a brute-force undo - [6]
AVTNUQYRbasic test-enabled framework - [7]
XSLCFVFH. - [8]
AD34IX2Zcouple more tests - [9]
AJB4LFRBtry to maintain a reasonable line width - [10]
OTIBCAUJlove2d scaffold
Change contents
- replacement in main.lua at line 88
initialize_window_geometry()if arg[1] == '-geometry' theninitialize_window_geometry(arg[2])table.remove(arg, 2)table.remove(arg, 1)elseinitialize_window_geometry()end - replacement in main.lua at line 115
function initialize_window_geometry()-- maximize windowlove.window.setMode(0, 0) -- maximizeApp.screen.width, App.screen.height, App.screen.flags = love.window.getMode()-- shrink slightly to account for window decorationApp.screen.width = App.screen.width-100App.screen.height = App.screen.height-100function initialize_window_geometry(geometry_spec)local geometry_initializedif geometry_spec thengeometry_initialized = parse_geometry_spec(geometry_spec)endif not geometry_initialized then-- maximize windowlove.window.setMode(0, 0) -- maximizeApp.screen.width, App.screen.height, App.screen.flags = love.window.getMode()-- shrink slightly to account for window decorationApp.screen.width = App.screen.width-100App.screen.height = App.screen.height-100end - edit in main.lua at line 132
endfunction parse_geometry_spec(geometry_spec)local width, height, x, y = geometry_spec:match('(%d+)x(%d+)%+(%d+)%+(%d+)')if width == nil thenprint('invalid geometry spec: '..geometry_spec)print('expected format: {width}x{height}+{x}+{y}')return falseendApp.screen.width = math.floor(tonumber(width))App.screen.height = math.floor(tonumber(height))App.screen.flags = {x=math.floor(tonumber(x)), y=math.floor(tonumber(y))}return true