Merge snap.love
This commit is contained in:
commit
524ef02780
|
@ -6,8 +6,6 @@ on.initialize = function(arg)
|
|||
if Settings[Filename] then
|
||||
Viewport = Settings[Filename].viewport
|
||||
end
|
||||
if file_exists(Filename) then
|
||||
load_graph_from_disk()
|
||||
end
|
||||
load_graph_from_disk()
|
||||
A()
|
||||
end
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
load_graph_from_disk = function()
|
||||
local f = App.open_for_reading(Filename)
|
||||
local data = json.decode(f:read('*a'))
|
||||
if f == nil then return end
|
||||
local contents = f:read('*a')
|
||||
f:close()
|
||||
if contents == '' then return end
|
||||
local data = json.decode(contents)
|
||||
Nodes = data.nodes or {}
|
||||
First_available_id = data.next
|
||||
end
|
||||
|
|
|
@ -5,8 +5,6 @@ on.file_drop = function(file)
|
|||
end
|
||||
Filename = file:getFilename()
|
||||
love.window.setTitle('wardley.love - '..Filename)
|
||||
if file_exists(Filename) then
|
||||
load_graph_from_disk()
|
||||
end
|
||||
load_graph_from_disk()
|
||||
A()
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue