mirror of
https://github.com/Reuh/ubiquitousse.git
synced 2025-10-27 09:09:30 +00:00
uqt.signal
This commit is contained in:
parent
82bc7268e6
commit
f6fb8ad649
11 changed files with 331 additions and 80 deletions
|
|
@ -1,5 +1,9 @@
|
|||
--- ubiquitousse.timer
|
||||
-- Depends on a backend.
|
||||
-- Optional dependencies: ubiquitousse.signal (to bind to update signal in signal.event)
|
||||
local loaded, signal = pcall(require, (...):match("^(.-)timer").."signal")
|
||||
if not loaded then signal = nil end
|
||||
|
||||
local ease = require((...):match("^.-timer")..".easing")
|
||||
local timer
|
||||
|
||||
|
|
@ -332,7 +336,7 @@ timer = {
|
|||
-- @impl ubiquitousse
|
||||
delayed = {},
|
||||
lastTime = 0,
|
||||
update = function(...)
|
||||
update = function(...) -- If ubiquitousse.signal is available, will be bound to the "update" signal in signal.event.
|
||||
return registry_mt.update(timer, ...)
|
||||
end,
|
||||
run = function(...)
|
||||
|
|
@ -346,4 +350,9 @@ timer = {
|
|||
end
|
||||
}
|
||||
|
||||
-- Bind signals
|
||||
if signal then
|
||||
signal.event:bind("update", timer.update)
|
||||
end
|
||||
|
||||
return timer
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue