summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPiotr Dobrowolski <admin@tastycode.pl>2017-02-24 01:50:40 +0100
committerPiotr Dobrowolski <admin@tastycode.pl>2017-02-24 01:50:40 +0100
commitbf68bc224de36f65a32fc214f7a3b74e02592c55 (patch)
tree56c7b43f087e311a30653f0ebd844babad82c40b
parent9c8d2432e799760a8b59881f27f4e72db96a95a0 (diff)
downloadlove2d-signage-bf68bc224de36f65a32fc214f7a3b74e02592c55.tar.gz
love2d-signage-bf68bc224de36f65a32fc214f7a3b74e02592c55.tar.bz2
love2d-signage-bf68bc224de36f65a32fc214f7a3b74e02592c55.zip
Add ThreadNode update handler
-rw-r--r--core/thread-node.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/core/thread-node.lua b/core/thread-node.lua
index 56e4e6d..e8498dd 100644
--- a/core/thread-node.lua
+++ b/core/thread-node.lua
@@ -21,7 +21,10 @@ function ThreadNode:checkUpdate()
updateThread:start()
end
- self.state = love.thread.getChannel(self.threadChannel):pop() or self.state
+ local v = love.thread.getChannel(self.threadChannel):pop()
+ if v then
+ self:onUpdate(v)
+ end
end
end
@@ -30,4 +33,8 @@ function ThreadNode:afterExit()
self:checkUpdate()
end
+function ThreadNode:onUpdate(v)
+ self.state = v
+end
+
return ThreadNode