mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 06:40:13 -05:00
Add Spell ID support for aura tracking (#31)
This commit is contained in:
11
IceHUD.lua
11
IceHUD.lua
@ -36,6 +36,7 @@ else
|
||||
end
|
||||
|
||||
-- compatibility/feature flags
|
||||
IceHUD.GetPlayerAuraBySpellID = _G["C_UnitAuras"] and C_UnitAuras.GetPlayerAuraBySpellID
|
||||
IceHUD.SpellFunctionsReturnRank = IceHUD.WowMain and IceHUD.WowVer < 80000
|
||||
IceHUD.EventExistsPlayerPetChanged = IceHUD.WowMain and IceHUD.WowVer < 80000
|
||||
IceHUD.EventExistsPetBarChanged = IceHUD.WowMain and IceHUD.WowVer < 80000
|
||||
@ -494,6 +495,16 @@ function IceHUD:GetAuraCount(auraType, unit, ability, onlyMine, matchByName)
|
||||
return 0
|
||||
end
|
||||
|
||||
-- Support for Spell IDs
|
||||
if (IceHUD.GetPlayerAuraBySpellID and tonumber(ability) ~= nil) then
|
||||
local aura = C_UnitAuras.GetPlayerAuraBySpellID(ability)
|
||||
if aura ~= nil then
|
||||
return aura.applications
|
||||
else
|
||||
return 0
|
||||
end
|
||||
end
|
||||
|
||||
local i = 1
|
||||
local name, _, texture, applications
|
||||
if IceHUD.SpellFunctionsReturnRank then
|
||||
|
Reference in New Issue
Block a user