some debug prints

I'm starting to edit the sources from within the app in ernest. First
question: why does the file navigation menu skip some files? These
prints answer the question.
This commit is contained in:
Kartik K. Agaram 2022-09-17 20:37:40 -07:00
parent 0cc8c706ff
commit 72791d9c35
4 changed files with 8 additions and 0 deletions

View File

@ -55,13 +55,16 @@ function add_hotkey_to_menu(s)
end
function source.draw_file_navigator()
log_start('render file navigator')
for i,file in ipairs(File_navigation.candidates) do
if file == 'source' then
App.color(Menu_border_color)
love.graphics.line(Menu_cursor-10,2, Menu_cursor-10,Menu_status_bar_height-2)
end
log(2, file)
add_file_to_menu(file, i == File_navigation.index)
end
log_end('render file navigator')
end
function add_file_to_menu(s, cursor_highlight)
@ -70,6 +73,7 @@ function add_file_to_menu(s, cursor_highlight)
end
local width = App.width(Text_cache[s])
if Menu_cursor + width > App.screen.width - 5 then
log(2, 'skipped')
return
end
if cursor_highlight then

View File

@ -33,6 +33,7 @@ load_file_from_source_or_save_directory('drawing_tests.lua')
-- but some files we want to only load sometimes
function App.load()
log_new('session')
if love.filesystem.getInfo('config') then
Settings = json.decode(love.filesystem.read('config'))
Current_app = Settings.current_app

View File

@ -15,6 +15,7 @@ end
-- called only for real run
function run.initialize(arg)
log_new('run')
love.keyboard.setTextInput(true) -- bring up keyboard on touch screen
love.keyboard.setKeyRepeat(true)

View File

@ -11,6 +11,7 @@ function source.initialize_globals()
Show_file_navigator = false
File_navigation = {
candidates = {
'main',
'run',
'run_tests',
'log',
@ -56,6 +57,7 @@ end
-- called only for real run
function source.initialize()
log_new('source')
love.keyboard.setTextInput(true) -- bring up keyboard on touch screen
love.keyboard.setKeyRepeat(true)