pass in files on the commandline
This commit is contained in:
parent
674b04af40
commit
7a6f93bdf6
|
@ -1,6 +1,11 @@
|
|||
on.initialize = function()
|
||||
if love.filesystem.getInfo('graph') then
|
||||
Nodes = json.decode(love.filesystem.read('graph'))
|
||||
on.initialize = function(arg)
|
||||
if #arg > 0 then
|
||||
Filename = arg[1]
|
||||
end
|
||||
if file_exists(Filename) then
|
||||
local f = App.open_for_reading(Filename)
|
||||
Nodes = json.decode(f:read('*a'))
|
||||
f:close()
|
||||
end
|
||||
A()
|
||||
end
|
||||
end
|
|
@ -1,7 +1,9 @@
|
|||
on.update = function(dt)
|
||||
if Global_next_save and Global_next_save < Current_time then
|
||||
print('saving')
|
||||
love.filesystem.write('graph', json.encode(Nodes))
|
||||
local f = App.open_for_writing(Filename)
|
||||
f:write(json.encode(Nodes))
|
||||
f:close()
|
||||
Global_next_save = nil
|
||||
end
|
||||
if Pan then
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Filename = love.filesystem.getSourceBaseDirectory()..'/graph'
|
Loading…
Reference in New Issue