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:
parent
753318f664
commit
735ad25226
6
main.lua
6
main.lua
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue