API:CooldownDisplaySetCooldown
From RoR Wiki
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
totaland the time at which the cooldown ends (now +remaining), rebuilds the display's shape and schedules it for update. - The stock UI passes
0, 0to 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)
