pothi.love/0012-on.initialize

30 lines
794 B
Plaintext
Raw Normal View History

2023-07-16 22:47:49 +01:00
on.initialize = function(arg)
2023-10-20 08:04:23 +01:00
if #arg == 0 then
if Data_dir == nil then
error('please provide a directory to browse')
end
2023-10-20 08:04:23 +01:00
else
if is_absolute_path(arg[1]) then
Data_dir = arg[1]
else
Data_dir = App.current_dir..arg[1]
end
2023-07-16 22:47:49 +01:00
end
print('reading articles from '..Data_dir)
if not file_exists(Data_dir) then
error('no directory '..Data_dir..' found. Please store articles to browse there before opening this app.')
2023-07-16 22:47:49 +01:00
end
local comment_path = Data_dir..'/comments'
2023-07-16 22:47:49 +01:00
if not file_exists(comment_path) then
2023-10-20 08:13:01 +01:00
App.mkdir(comment_path)
end
reset_viewport()
2023-06-21 06:32:36 +01:00
love.graphics.setFont(love.graphics.newFont(20))
local font = love.graphics.getFont()
font:setLineHeight(1.3)
initialize_file_picker()
A()
Viewport.x, Viewport.y = Viewport_bounds.xmin, Viewport_bounds.ymin
B()
end