From 3be1b80a44c82df675ab0db796ba680289333a10 Mon Sep 17 00:00:00 2001 From: Salikh Gurgenidze Date: Sat, 22 Nov 2025 00:21:54 +0400 Subject: [PATCH] money frame fixe --- Core/Tooltip.lua | 31 ++++++++++++++++++++++++++++++- UI/ItemButton.lua | 1 - 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/Core/Tooltip.lua b/Core/Tooltip.lua index dacd4ec..deedb98 100644 --- a/Core/Tooltip.lua +++ b/Core/Tooltip.lua @@ -275,6 +275,32 @@ function Tooltip:Initialize() -- Helper function to defer vendor money so we can insert our Inventory block above it local Orig_SetTooltipMoney = SetTooltipMoney + -- Move the tooltip money frame(s) vertically to fine-tune their position under our custom block + local function AdjustMoneyFrames(tooltip, yOffset) + if not tooltip or not tooltip.GetName then return end + local baseName = tooltip:GetName() + if not baseName then return end + + -- Collect potential money frame names used by WoW tooltips + local candidates = {} + -- Primary money frame + tinsert(candidates, baseName .. "MoneyFrame") + -- Sometimes multiple money frames are created with numeric suffixes + for i = 1, 8 do + tinsert(candidates, baseName .. "MoneyFrame" .. i) + tinsert(candidates, baseName .. "SmallMoneyFrame" .. i) + end + + for i = 1, getn(candidates) do + local f = getglobal(candidates[i]) + if f and f:IsShown() and f.GetPoint then + local point, relTo, relPoint, xOfs, yOfs = f:GetPoint(1) + if point then + f:SetPoint(point, relTo, relPoint, xOfs or 0, (yOfs or 0) + (yOffset or 0)) + end + end + end + end local function WithDeferredMoney(tooltip, buildFunc) local queue = {} -- Temporarily override global SetTooltipMoney @@ -295,6 +321,10 @@ function Tooltip:Initialize() local q = queue[i] Orig_SetTooltipMoney(q[1], q[2], q[3], q[4], q[5], q[6], q[7]) end + + -- Nudge the vendor price upward a bit so it's visually closer to the item info + -- In WoW UI coordinates, positive Y moves up; increase by 15px (adjust if you prefer) + AdjustMoneyFrames(tooltip, 15) return ret end @@ -307,7 +337,6 @@ function Tooltip:Initialize() local bankFrame = getglobal("BankFrame") if bag == -1 and bankFrame and bankFrame:IsVisible() then - addon:Print('BANK FRAME:') local invSlot = BankButtonIDToInvSlotID(slot) if invSlot then -- Use the inventory item method for bank main bag diff --git a/UI/ItemButton.lua b/UI/ItemButton.lua index 283470f..f906a62 100644 --- a/UI/ItemButton.lua +++ b/UI/ItemButton.lua @@ -575,7 +575,6 @@ function Guda_ItemButton_OnEnter(self) -- For other characters or read-only mode, use cached item link if self.otherChar or self.isReadOnly then - addon:Print('ATLAS_LOOT_ERROR') GameTooltip:SetBagItem(self.bagID, self.slotID) -- Special handling for bank main bag when bank might be closed elseif self.isBank and self.bagID == -1 then