Commit d043b5da authored by Robin Schoonover's avatar Robin Schoonover

Add support for pet ability ids.

parent 6b152a93
local addon_name, addon = ...
local tmp = {}
function addon:AddIDLine(tip, ...) -- idname, id
if tip._alltheid then
return
end
local line = self:IDLine(...)
if line then
tip:AddLine(line)
if tip:IsShown() then
-- force redraw
tip:Show()
end
tip._alltheid = true
end
end
local tmp = {}
function addon:IDLine(...)
wipe(tmp)
for i = 1,select("#", ...),2 do
......@@ -17,12 +29,7 @@ function addon:AddIDLine(tip, ...) -- idname, id
end
if #tmp > 0 then
tip:AddLine(table.concat(tmp, " / "))
if tip:IsShown() then
-- force redraw
tip:Show()
end
tip._alltheid = true
return table.concat(tmp, " / ")
end
end
......
......@@ -11,6 +11,22 @@ local function HookPetCard()
end)
end
local origSharedPetBattleAbilityTooltip_SetAbility = SharedPetBattleAbilityTooltip_SetAbility
SharedPetBattleAbilityTooltip_SetAbility = function(tip, abilityInfo, additionalInfo)
local abilityID = abilityInfo:GetAbilityID()
if abilityID then
local line = addon:IDLine("Ability", abilityID)
if additionalInfo then
additionaInfo = additionalInfo.."\n"..line
else
additionalInfo = line
end
end
return origSharedPetBattleAbilityTooltip_SetAbility(tip, abilityInfo, additionalInfo)
end
--
-- hook on addon load
--
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment