Commit 9489f9e9 authored by Tukz's avatar Tukz
Browse files

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

parent 47c445d8
......@@ -216,9 +216,16 @@ function Tooltip:OnTooltipSetUnit()
if (UnitExists(Unit .. "target")) then
local Hex, R, G, B = Tooltip:GetColor(Unit .. "target")
if (not R) and (not G) and (not B) then
local UnitTarget = Unit.."target"
local Class = select(2, UnitClass(UnitTarget))
local Reaction = UnitReaction(UnitTarget, "player")
local R, G, B
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])
R, G, B = 1, 1, 1
......@@ -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)
Tooltip:HookScript("OnShow", self.Skin)
Tooltip:SetScript("OnShow", self.Skin)
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