Skip to content

Commit 1d1c415

Browse files
committed
fix tooltip hooking in MoP Classic
1 parent c7b3e22 commit 1d1c415

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

AutoGear.lua

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4461,14 +4461,16 @@ function AutoGearGetEquippedSlotFromItemGUID(guid)
44614461
end
44624462
end
44634463

4464-
function AutoGearTooltipHook(tooltip)
4464+
function AutoGearTooltipHook(tooltip, tooltipData)
44654465
if (not AutoGearDB.ScoreInTooltips) then return end
44664466
local tooltipName = tooltip:GetName()
44674467
if (not (tooltipName=="GameTooltip" or tooltipName=="ShoppingTooltip1" or tooltipName=="ShoppingTooltip2" or tooltipName=="ItemRefTooltip")) or (not tooltip:IsVisible()) then return end
44684468
if (not AutoGearCurrentWeighting) then AutoGearSetStatWeights() end
4469-
local name, link, equipped, guid, tooltipData
4469+
local name, link, equipped, guid
44704470
if tooltip.GetPrimaryTooltipData or tooltip.GetTooltipData then
4471-
tooltipData = tooltip.GetPrimaryTooltipData and tooltip:GetPrimaryTooltipData() or (tooltip.GetTooltipData and tooltip:GetTooltipData())
4471+
if not tooltipData then
4472+
tooltipData = tooltip.GetPrimaryTooltipData and tooltip:GetPrimaryTooltipData() or (tooltip.GetTooltipData and tooltip:GetTooltipData())
4473+
end
44724474
if not tooltipData then tooltip:AddDoubleLine("AutoGear error:", "no tooltip data") return end
44734475
guid = tooltipData.guid
44744476
name = tooltipData.lines[1].leftText
@@ -4701,7 +4703,7 @@ function AutoGearTooltipHook(tooltip)
47014703
-- AutoGearPrint("name: "..tostring(name).."; link: "..tostring(link).."; guid: "..tostring(guid).."; equipped: "..tostring(AutoGearSlotNames and AutoGearSlotNames[equipped] or equipped))
47024704
end
47034705

4704-
if TooltipDataProcessor then
4706+
if TooltipDataProcessor and TooltipDataProcessor.AddTooltipPostCall and C_TooltipInfo then
47054707
TooltipDataProcessor.AddTooltipPostCall(Enum.TooltipDataType.Item, AutoGearTooltipHook)
47064708
else
47074709
GameTooltip:HookScript("OnTooltipSetItem", AutoGearTooltipHook)

0 commit comments

Comments
 (0)