pesde goatsoft / lucy

useDelayGroup

Lucy.useDelayGroup returns the app's shared delay group for floating content such as Tooltips. The first tooltip waits its full delay; moving to another tooltip while one is open (or within skip seconds after it closes) opens the next right away, and claiming the group closes the previous open one.

Usage

local group = Lucy.useDelayGroup(app, { skip = 0.3 })
ArgumentTypeDefaultWhat it is
appApprequiredThe app whose delay group to share
options.skipnumber?0.3Seconds after closing during which the next delay is skipped

Returns { wait, claim, release, current, skip }.

Example

local group = Lucy.useDelayGroup(app)
local waitTime = group.wait(0.4) -- 0.4 on cold open, 0 when warm

task.delay(waitTime, function()
    group.claim("shopTip", function()
        open(false)
    end)
    open(true)
end)