Adding HP text to default Tooltip??
Hello everyone,
I have a simple little addon thing that adds class colors to the default tooltip and I was wondering if I could get some help adding HP text also?
Here is what I have so far:
GameTooltip:HookScript("OnTooltipSetUnit", function(GameTooltip)
--print("OnTooltipSetUnit")
local _, unit = GameTooltip:GetUnit()
--print(unit)
if UnitIsPlayer(unit) then
--print("UnitIsPlayer")
local _, class = UnitClass(unit)
--print(class)
local color = class and (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[class]
if color then
local text = GameTooltipTextLeft1:GetText()
--print(text)
GameTooltipTextLeft1:SetFormattedText("|cff%02x%02x%02x%s|r", color.r * 255, color.g * 255, color.b * 255, text:match("|cff\x\x\x\x\x\x(.+)|r") or text)
end
end
end)
EDIT****
Also wondering if it is possible to add rare tag?
Last edited by missycnr : 08-21-17 at 07:50 AM.
|