Commit 9489f9e9 authored by Tukz's avatar Tukz

Fix a tooltip target of target bug being displayed 2 times.

parent 47c445d8
......@@ -216,9 +216,16 @@ function Tooltip:OnTooltipSetUnit()
end
if (UnitExists(Unit .. "target")) then
local Hex, R, G, B = Tooltip:GetColor(Unit .. "target")
local UnitTarget = Unit.."target"
local Class = select(2, UnitClass(UnitTarget))
local Reaction = UnitReaction(UnitTarget, "player")
local R, G, B
if (not R) and (not G) and (not B) then
if (UnitIsPlayer(UnitTarget) and not UnitHasVehicleUI(UnitTarget)) then
R, G, B = unpack(T.Colors.class[Class])
elseif Reaction then
R, G, B = unpack(T.Colors.reaction[Reaction])
else
R, G, B = 1, 1, 1
end
......@@ -369,12 +376,12 @@ function Tooltip:Enable()
for _, Tooltip in pairs(Tooltip.Tooltips) do
if Tooltip == GameTooltip then
Tooltip:HookScript("OnUpdate", self.OnUpdate)
Tooltip:HookScript("OnTooltipSetUnit", self.OnTooltipSetUnit)
Tooltip:HookScript("OnTooltipSetItem", self.OnTooltipSetItem)
Tooltip:SetScript("OnUpdate", self.OnUpdate)
Tooltip:SetScript("OnTooltipSetUnit", self.OnTooltipSetUnit)
Tooltip:SetScript("OnTooltipSetItem", self.OnTooltipSetItem)
end
Tooltip:HookScript("OnShow", self.Skin)
Tooltip:SetScript("OnShow", self.Skin)
end
ItemRefCloseButton:SkinCloseButton()
......
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