Skip to content

Commit

Permalink
Fix Blizzard tooltip issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Anonomit committed Jun 21, 2023
1 parent f01f3bd commit 53086e5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions ItemConditions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ local function IsItemUsable(itemID, playerClass, isMe)
-- If item is class-locked then make sure this class is listed
-- Also make sure the item is not unique if I already own one
if not LootReserve.TooltipScanner then
LootReserve.TooltipScanner = CreateFrame("GameTooltip", "LootReserveTooltipScanner", UIParent, "GameTooltipTemplate");
LootReserve.TooltipScanner = CreateFrame("GameTooltip", "LootReserveTooltipScanner", nil, "GameTooltipTemplate");
LootReserve.TooltipScanner:Hide();
end
if not LootReserve.TooltipScanner.Unique then
Expand All @@ -226,7 +226,7 @@ local function IsItemUsable(itemID, playerClass, isMe)
LootReserve.TooltipScanner.ProfessionAllowed = format("^%s$", ITEM_MIN_SKILL:gsub("%d+%$",""):gsub("%%s ", "([%%u%%l%%s]+) "):gsub("%(%%d%)", "%%((%%d+)%%)"));
end

LootReserve.TooltipScanner:SetOwner(UIParent, "ANCHOR_NONE");
LootReserve.TooltipScanner:SetOwner(WorldFrame, "ANCHOR_NONE");
LootReserve.TooltipScanner:SetHyperlink("item:" .. itemID);
for i = 1, LootReserve.TooltipScanner:NumLines() do
local line = _G[LootReserve.TooltipScanner:GetName() .. "TextLeft" .. i];
Expand Down
8 changes: 4 additions & 4 deletions LootReserve.lua
Original file line number Diff line number Diff line change
Expand Up @@ -881,11 +881,11 @@ end

function LootReserve:IsItemSoulbound(bag, slot)
if not self.TooltipScanner then
self.TooltipScanner = CreateFrame("GameTooltip", "LootReserveTooltipScanner", UIParent, "GameTooltipTemplate");
self.TooltipScanner = CreateFrame("GameTooltip", "LootReserveTooltipScanner", nil, "GameTooltipTemplate");
self.TooltipScanner:Hide();
end

self.TooltipScanner:SetOwner(UIParent, "ANCHOR_NONE");
self.TooltipScanner:SetOwner(WorldFrame, "ANCHOR_NONE");
self.TooltipScanner:SetBagItem(bag, slot);
for i = LootReserve.TooltipScanner:NumLines(), 1, -1 do
local line = _G[self.TooltipScanner:GetName() .. "TextLeft" .. i];
Expand All @@ -900,15 +900,15 @@ end

function LootReserve:IsItemSoulboundTradeable(bag, slot)
if not self.TooltipScanner then
self.TooltipScanner = CreateFrame("GameTooltip", "LootReserveTooltipScanner", UIParent, "GameTooltipTemplate");
self.TooltipScanner = CreateFrame("GameTooltip", "LootReserveTooltipScanner", nil, "GameTooltipTemplate");
self.TooltipScanner:Hide();
end

if not self.TooltipScanner.SoulboundTradeable then
self.TooltipScanner.SoulboundTradeable = BIND_TRADE_TIME_REMAINING:gsub("%.", "%%."):gsub("%%s", "(.+)");
end

self.TooltipScanner:SetOwner(UIParent, "ANCHOR_NONE");
self.TooltipScanner:SetOwner(WorldFrame, "ANCHOR_NONE");
self.TooltipScanner:SetBagItem(bag, slot);
for i = LootReserve.TooltipScanner:NumLines(), 1, -1 do
local line = _G[self.TooltipScanner:GetName() .. "TextLeft" .. i];
Expand Down
4 changes: 2 additions & 2 deletions Server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -977,10 +977,10 @@ function LootReserve.Server:AddRecentLoot(item, acceptAllQualities)

-- try to get the tooltip to cache
if not LootReserve.TooltipScanner then
LootReserve.TooltipScanner = CreateFrame("GameTooltip", "LootReserveTooltipScanner", UIParent, "GameTooltipTemplate");
LootReserve.TooltipScanner = CreateFrame("GameTooltip", "LootReserveTooltipScanner", nil, "GameTooltipTemplate");
LootReserve.TooltipScanner:Hide();
end
LootReserve.TooltipScanner:SetOwner(UIParent, "ANCHOR_NONE");
LootReserve.TooltipScanner:SetOwner(WorldFrame, "ANCHOR_NONE");
LootReserve.TooltipScanner:SetHyperlink(item:GetString());
LootReserve.TooltipScanner:Hide();
end
Expand Down

0 comments on commit 53086e5

Please sign in to comment.