Many thanks Origedit for advocating for this change. It's much better now.
It's a little inefficient; overflow buttons get drawn twice per frame.
GO2QWWUIJZDJXLJ4O4MBYULDGNCQ5SYJP3ORNLZ4VFSY4BSRXWKAC AZMYKWMHE3RTQ7Z7NTBK3H4YTZ46HQE2GHUY7WADMITC7UIVB5RQC R5QXEHUIZLELJGGCZAE7ATNS3CLRJ7JFRENMGH4XXH24C5WABZDQC SIJ5I4NZN5LFATNT5QIWUK75Z5W6P4B4AKNPVYFQ7IVRMOCVWR3AC 5MEJ7XNHNFG2BIX3TFU6PDJHSJOS2Z45L25QAZKFGRW7ZNOFEUKAC PRE6XPRNICDCHMF7C45A6DRPVT47IPAIWW6Q7AHNGW3D2PBGOPNAC 5RUFNRJOK3PXQKJTPDEN5K5PI67MGB25QUA44WOCCH2O5KHXT45QC JV27LDDKKY57IEBWGBFPSHEARMOEGLBYGBJD27PDPTNWWYXA4T6AC find_overflow_button = function()if Overflow_button == nil then return endfor i,button in ipairs(Global_state.button_handlers) doif button == Overflow_button thenlocal max_width = 0for j=i+1, #Global_state.button_handlers dolocal b = Global_state.button_handlers[j]max_width = math.max(max_width, b.w)endreturn i, max_widthendendend
redraw_overflow_buttons = function(y)if Show_menu ~= 'overflow' then return endlocal bottom = y + 10App.color(Menu_background)local overflow_button_index, overflow_width = find_overflow_button()if overflow_button_index == nil thenerror('overflow button not found')endlove.graphics.rectangle('fill', Overflow_button.x-5, Menu_bottom, overflow_width+10, bottom - Menu_bottom)for j=overflow_button_index+1, #Global_state.button_handlers dolocal b = Global_state.button_handlers[j]b.icon(b)endend