From 8e109a585a23b9ca085a922477c5a5d27e055b5f Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Wed, 9 Sep 2026 13:23:53 -0500 Subject: [PATCH] eqcompare: place the compare after the tooltip settles when Guda is loaded Guda anchors its item tooltips with ANCHOR_NONE and its own SetPoint, and the tooltip module then relocates every ANCHOR_NONE tooltip to its configured spot. eqcompare picked left or right from GetLeft/GetRight inside the Set* call -- against the position the tooltip was about to leave -- so for an item in the left half of the screen the shopping tooltips anchored to the right edge and rode the relocation off-screen (vatichild/guda#41). Guda's own inventory block also widens the tooltip after our hook has run. With Guda present, resolve the link in the hook but hand the placement to RunNextFrame, skipping it if the tooltip has hidden since. Guda lists pfUI as a dependency, so it loads after us: gate on DoesAddOnExist and flip the flag from ContinueOnAddOnLoaded. Without Guda the hook is unchanged. --- modules/eqcompare.lua | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/modules/eqcompare.lua b/modules/eqcompare.lua index f1f5cf8a..81b5b214 100644 --- a/modules/eqcompare.lua +++ b/modules/eqcompare.lua @@ -130,9 +130,28 @@ pfUI:RegisterModule("eqcompare", function () SetTradeTargetItem = GetTradeTargetItemLink } + -- Guda anchors its item tooltips with ANCHOR_NONE and its own SetPoint, and + -- the tooltip module then moves every ANCHOR_NONE tooltip to its configured + -- spot. Reading the rect inside the Set* call picks the side against the + -- position the tooltip is about to leave, so place the compare a frame later. + local deferred + if C_AddOns.DoesAddOnExist("Guda") then + EventUtil.ContinueOnAddOnLoaded("Guda", function() + deferred = true + end) + end + local function makeHook(getter) return function(tooltip, arg1, arg2, arg3) - ShowCompareItem(tooltip, getter(arg1, arg2, arg3)) + local link = getter(arg1, arg2, arg3) + if not deferred then + return ShowCompareItem(tooltip, link) + end + RunNextFrame(function() + if tooltip:IsShown() then + ShowCompareItem(tooltip, link) + end + end) end end