Skip to content

Commit

Permalink
database: eliminate itemref tooltip flickering
Browse files Browse the repository at this point in the history
  • Loading branch information
shagu committed Apr 5, 2023
1 parent ef58554 commit f6fc695
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions database.lua
Original file line number Diff line number Diff line change
Expand Up @@ -241,16 +241,22 @@ CreateFrame("Frame", "pfQuestLocaleCheck", UIParent):SetScript("OnUpdate", funct
-- throttle to to one item per second
if ( this.tick or 0) > GetTime() then return else this.tick = GetTime() + .1 end

this.iteration = this.iteration or 0
if this.iteration < 2 then
if not this.dryrun then
-- give the server one iteration to return the itemname.
-- this is required for clients that use a clean wdb folder.
ItemRefTooltip:Hide()
ItemRefTooltip:SetOwner(UIParent, "ANCHOR_PRESERVE")
ItemRefTooltip:SetHyperlink("item:6948:0:0:0")
this.iteration = this.iteration + 1
ItemRefTooltip:Hide()
this.dryrun = true
return
elseif ItemRefTooltip:IsShown() and ItemRefTooltipTextLeft1 and ItemRefTooltipTextLeft1:IsVisible() then
end

-- try to load hearthstone into tooltip
ItemRefTooltip:SetOwner(UIParent, "ANCHOR_PRESERVE")
ItemRefTooltip:SetHyperlink("item:6948:0:0:0")

-- check tooltip for results
if ItemRefTooltip:IsShown() and ItemRefTooltipTextLeft1 and ItemRefTooltipTextLeft1:IsVisible() then
-- once the tooltip shows up, read the name and hide it
local name = ItemRefTooltipTextLeft1:GetText()
ItemRefTooltip:Hide()
Expand Down

0 comments on commit f6fc695

Please sign in to comment.