I'm writing a love2d starter template for blind accessible games, and I just got my screen reader c library working from within the .love file by copying it to the save directory... However:
I tried to make the template only copy the file(s) if they weren't already there, but that doesn't seem to be working. I do some code like this:
Code: Select all
if love.filesystem.getInfo(love.filesystem.getSaveDirectory() .. "/" ..
libName) == nil then -- The file doesn't exist, we need to copy it
-- Fixme, probably should do sanity checks like size, etc, but this will do for now.
print(love.filesystem.getSaveDirectory() .. "/" .. libName ..
" not found...")
local content = love.filesystem.read(libName)
love.filesystem.write(libName, content)
end
Thanks,
-Michael.
P.S. If you want to see the whole project go here: https://git.2mb.codes/~lilmike/love2d-template