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:
parent
0cc8c706ff
commit
72791d9c35
|
@ -55,13 +55,16 @@ function add_hotkey_to_menu(s)
|
||||||
end
|
end
|
||||||
|
|
||||||
function source.draw_file_navigator()
|
function source.draw_file_navigator()
|
||||||
|
log_start('render file navigator')
|
||||||
for i,file in ipairs(File_navigation.candidates) do
|
for i,file in ipairs(File_navigation.candidates) do
|
||||||
if file == 'source' then
|
if file == 'source' then
|
||||||
App.color(Menu_border_color)
|
App.color(Menu_border_color)
|
||||||
love.graphics.line(Menu_cursor-10,2, Menu_cursor-10,Menu_status_bar_height-2)
|
love.graphics.line(Menu_cursor-10,2, Menu_cursor-10,Menu_status_bar_height-2)
|
||||||
end
|
end
|
||||||
|
log(2, file)
|
||||||
add_file_to_menu(file, i == File_navigation.index)
|
add_file_to_menu(file, i == File_navigation.index)
|
||||||
end
|
end
|
||||||
|
log_end('render file navigator')
|
||||||
end
|
end
|
||||||
|
|
||||||
function add_file_to_menu(s, cursor_highlight)
|
function add_file_to_menu(s, cursor_highlight)
|
||||||
|
@ -70,6 +73,7 @@ function add_file_to_menu(s, cursor_highlight)
|
||||||
end
|
end
|
||||||
local width = App.width(Text_cache[s])
|
local width = App.width(Text_cache[s])
|
||||||
if Menu_cursor + width > App.screen.width - 5 then
|
if Menu_cursor + width > App.screen.width - 5 then
|
||||||
|
log(2, 'skipped')
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if cursor_highlight then
|
if cursor_highlight then
|
||||||
|
|
1
main.lua
1
main.lua
|
@ -33,6 +33,7 @@ load_file_from_source_or_save_directory('drawing_tests.lua')
|
||||||
|
|
||||||
-- but some files we want to only load sometimes
|
-- but some files we want to only load sometimes
|
||||||
function App.load()
|
function App.load()
|
||||||
|
log_new('session')
|
||||||
if love.filesystem.getInfo('config') then
|
if love.filesystem.getInfo('config') then
|
||||||
Settings = json.decode(love.filesystem.read('config'))
|
Settings = json.decode(love.filesystem.read('config'))
|
||||||
Current_app = Settings.current_app
|
Current_app = Settings.current_app
|
||||||
|
|
1
run.lua
1
run.lua
|
@ -15,6 +15,7 @@ end
|
||||||
|
|
||||||
-- called only for real run
|
-- called only for real run
|
||||||
function run.initialize(arg)
|
function run.initialize(arg)
|
||||||
|
log_new('run')
|
||||||
love.keyboard.setTextInput(true) -- bring up keyboard on touch screen
|
love.keyboard.setTextInput(true) -- bring up keyboard on touch screen
|
||||||
love.keyboard.setKeyRepeat(true)
|
love.keyboard.setKeyRepeat(true)
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ function source.initialize_globals()
|
||||||
Show_file_navigator = false
|
Show_file_navigator = false
|
||||||
File_navigation = {
|
File_navigation = {
|
||||||
candidates = {
|
candidates = {
|
||||||
|
'main',
|
||||||
'run',
|
'run',
|
||||||
'run_tests',
|
'run_tests',
|
||||||
'log',
|
'log',
|
||||||
|
@ -56,6 +57,7 @@ end
|
||||||
|
|
||||||
-- called only for real run
|
-- called only for real run
|
||||||
function source.initialize()
|
function source.initialize()
|
||||||
|
log_new('source')
|
||||||
love.keyboard.setTextInput(true) -- bring up keyboard on touch screen
|
love.keyboard.setTextInput(true) -- bring up keyboard on touch screen
|
||||||
love.keyboard.setKeyRepeat(true)
|
love.keyboard.setKeyRepeat(true)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue