always have a filename

When a filename is provided, we write to it. When it isn't we always
open the same file, and it persists between loads.
This commit is contained in:
Kartik K. Agaram 2022-05-16 18:47:26 -07:00
parent 753318f664
commit 735ad25226
1 changed files with 2 additions and 4 deletions

View File

@ -45,7 +45,7 @@ function coord(n) -- pixels to parts
return math.floor(n*256/drawingw)
end
filename = nil
filename = 'lines.txt'
function love.load(arg)
-- maximize window
@ -60,10 +60,8 @@ function love.load(arg)
love.keyboard.setTextInput(true) -- bring up keyboard on touch screen
if #arg > 0 then
filename = arg[1]
lines = load_from_disk(filename)
else
table.insert(lines, '')
end
lines = load_from_disk(filename)
end
function love.filedropped(file)