restart on a remote command from the driver
This should be useful for ensuring that apps work the same after restart.
This commit is contained in:
parent
480d8700e2
commit
f387c40d95
2
live.lua
2
live.lua
|
@ -216,6 +216,8 @@ function live.run(buf)
|
|||
print('command is '..cmd)
|
||||
if cmd == 'QUIT' then
|
||||
love.event.quit(1)
|
||||
elseif cmd == 'RESTART' then
|
||||
restart()
|
||||
elseif cmd == 'MANIFEST' then
|
||||
Live.manifest[APP] = love.filesystem.getIdentity() -- doesn't need to be persisted, but no harm if it does..
|
||||
live.send_to_driver(json.encode(Live.manifest))
|
||||
|
|
7
main.lua
7
main.lua
|
@ -63,6 +63,13 @@ function love.quit()
|
|||
love.filesystem.write('config', json.encode(settings()))
|
||||
end
|
||||
|
||||
function restart()
|
||||
if on.quit then on.quit() end
|
||||
love.filesystem.write('config', json.encode(settings()))
|
||||
load_settings()
|
||||
if on.initialize then on.initialize() end
|
||||
end
|
||||
|
||||
function settings()
|
||||
local x, y, displayindex = App.screen.position()
|
||||
return {
|
||||
|
|
Loading…
Reference in New Issue
Block a user