money frame fixe
This commit is contained in:
+30
-1
@@ -275,6 +275,32 @@ function Tooltip:Initialize()
|
|||||||
|
|
||||||
-- Helper function to defer vendor money so we can insert our Inventory block above it
|
-- Helper function to defer vendor money so we can insert our Inventory block above it
|
||||||
local Orig_SetTooltipMoney = SetTooltipMoney
|
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 function WithDeferredMoney(tooltip, buildFunc)
|
||||||
local queue = {}
|
local queue = {}
|
||||||
-- Temporarily override global SetTooltipMoney
|
-- Temporarily override global SetTooltipMoney
|
||||||
@@ -295,6 +321,10 @@ function Tooltip:Initialize()
|
|||||||
local q = queue[i]
|
local q = queue[i]
|
||||||
Orig_SetTooltipMoney(q[1], q[2], q[3], q[4], q[5], q[6], q[7])
|
Orig_SetTooltipMoney(q[1], q[2], q[3], q[4], q[5], q[6], q[7])
|
||||||
end
|
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
|
return ret
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -307,7 +337,6 @@ function Tooltip:Initialize()
|
|||||||
local bankFrame = getglobal("BankFrame")
|
local bankFrame = getglobal("BankFrame")
|
||||||
|
|
||||||
if bag == -1 and bankFrame and bankFrame:IsVisible() then
|
if bag == -1 and bankFrame and bankFrame:IsVisible() then
|
||||||
addon:Print('BANK FRAME:')
|
|
||||||
local invSlot = BankButtonIDToInvSlotID(slot)
|
local invSlot = BankButtonIDToInvSlotID(slot)
|
||||||
if invSlot then
|
if invSlot then
|
||||||
-- Use the inventory item method for bank main bag
|
-- Use the inventory item method for bank main bag
|
||||||
|
|||||||
@@ -575,7 +575,6 @@ function Guda_ItemButton_OnEnter(self)
|
|||||||
|
|
||||||
-- For other characters or read-only mode, use cached item link
|
-- For other characters or read-only mode, use cached item link
|
||||||
if self.otherChar or self.isReadOnly then
|
if self.otherChar or self.isReadOnly then
|
||||||
addon:Print('ATLAS_LOOT_ERROR')
|
|
||||||
GameTooltip:SetBagItem(self.bagID, self.slotID)
|
GameTooltip:SetBagItem(self.bagID, self.slotID)
|
||||||
-- Special handling for bank main bag when bank might be closed
|
-- Special handling for bank main bag when bank might be closed
|
||||||
elseif self.isBank and self.bagID == -1 then
|
elseif self.isBank and self.bagID == -1 then
|
||||||
|
|||||||
Reference in New Issue
Block a user