View Single Post
04-09-13, 03:04 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
You should avoid doing a GetSpellInfo lookup on every UNIT_AURA event. You can also avoid the cost of the string concatenation by including the color codes directly in your format pattern.

Code:
local DANCING_STEEL = GetSpellInfo(120032)
oUF.Tags.Events["GhostSDTime"] = "UNIT_AURA"
oUF.Tags.Methods["GhostDSTime"] = function(u)
    local _, _, _, _, _, _, expirationTime = UnitAura(u, DANCING_STEEL)
    if expirationTime then
        return format("|cff6670ff%.0f|r", expirationTime - GetTime())
    end
end
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote