source: show all files in navigator
[?]
Sep 18, 2022, 6:53 AM
NYRESFK6T6NNVQRPVQEJP37Z4XUOUDBQWWU7DMQ23Y3GX7U2A4XQCDependencies
- [2]
O2PYNFUBuse existing local - [3]
LZYLOTP3rename - [4]
IOCATA27bugfix: never skip files in file navigator - [5]
GQKUD7QXdelete some logs - [6]
ZQZX364Vuse a helper - [7]
KKMFQDR4editing source code from within the app - [8]
QZ2SXLHFsome debug prints
Change contents
- edit in commands.lua at line 56
if File_navigation.num_lines == nil thenFile_navigation.num_lines = source.num_lines_for_file_navigator()endApp.color(Menu_background_color)love.graphics.rectangle('fill', 0,Menu_status_bar_height, App.screen.width, File_navigation.num_lines * Editor_state.line_height)local x,y = 5, Menu_status_bar_height - replacement in commands.lua at line 67
add_file_to_menu(filename, i == File_navigation.index)x,y = add_file_to_menu(x,y, filename, i == File_navigation.index) - replacement in commands.lua at line 74
function add_file_to_menu(s, cursor_highlight)function source.num_lines_for_file_navigator()local result = 1local x = 5for i,filename in ipairs(File_navigation.candidates) dolocal width = App.width(to_text(filename))if x + width > App.screen.width - 5 thenresult = result+1x = 5 + widthelsex = x + width + 30endendreturn resultendfunction add_file_to_menu(x,y, s, cursor_highlight) - edit in commands.lua at line 92
if x + width > App.screen.width - 5 theny = y + Editor_state.line_heightx = 5end - replacement in commands.lua at line 98
love.graphics.rectangle('fill', Menu_cursor-5,5-2, width+5*2,Editor_state.line_height+2*2)love.graphics.rectangle('fill', x-5,y-2, width+5*2,Editor_state.line_height+2*2) - replacement in commands.lua at line 101
App.screen.draw(s_text, Menu_cursor,5)Menu_cursor = Menu_cursor + width + 30App.screen.draw(s_text, x,y)x = x + width + 30return x,y