Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:CooldownDisplaySetCooldown

From RoR Wiki
Revision as of 19:41, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UI Lua API · CooldownDisplay functions
Version: WAR 1.4.8

Starts the cooldown shown by a CooldownDisplay window.

CooldownDisplaySetCooldown(displayName, remaining, total)

Arguments

displayName
string – Name of a CooldownDisplay window.
remaining
number – Seconds of cooldown left.
total
number – Full length of the cooldown in seconds.

Returns

Nothing.

Details

  • The client stores total and the time at which the cooldown ends (now + remaining), rebuilds the display's shape and schedules it for update.
  • The stock UI passes 0, 0 to clear a cooldown.
  • If the window exists but is not a CooldownDisplay, the call does nothing and raises no error.
  • The error message is built from a format string, so its text is the same as the other does not exist errors.

Errors

  • Error in function call 'CooldownDisplaySetCooldown': Window %s does not exist

Example

From ea_actionbars/source/actionbutton.lua:

self.m_Cooldown, self.m_MaxCooldown = GetHotbarCooldown (self:GetSlot ())
...
cooldownFrame:Show (true)
CooldownDisplaySetCooldown (cooldownFrame:GetName (), self.m_Cooldown, self.m_MaxCooldown)

Clearing it, from ea_moralewindow/source/moralewindow.lua:

CooldownDisplaySetCooldown (self.m_Windows[COOLDOWN]:GetName (), 0, 0)

See also