You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
1.1 KiB

local AuraPoints = setmetatable({
isComboPoints = true,
spells = {
--["MAGE"] = {max = 4, name = GetSpellInfo(36032), filter = "HARMFUL"},
}
}, {__index = ShadowUF.ComboPoints})
local trackSpell = AuraPoints.spells[select(2, UnitClass("player"))]
if( not trackSpell or not trackSpell.name ) then return end
ShadowUF:RegisterModule(AuraPoints, "auraPoints", ShadowUF.L["Aura Combo Points"])
local auraConfig = {max = trackSpell.max, key = "auraPoints", colorKey = "AURAPOINTS", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"}
function AuraPoints:OnEnable(frame)
frame.auraPoints = frame.auraPoints or CreateFrame("Frame", nil, frame)
frame.auraPoints.cpConfig = auraConfig
frame.comboPointType = auraConfig.key
frame:RegisterUnitEvent("UNIT_AURA", self, "Update")
frame:RegisterUpdateFunc(self, "Update")
end
function AuraPoints:GetComboPointType()
return "auraPoints"
end
function AuraPoints:GetPoints(unit)
return select(3, ShadowUF.UnitAuraBySpell("player", trackSpell.name, trackSpell.filter)) or 0
end