Skip to content

Commit

Permalink
Currency tooltip issue with PTR
Browse files Browse the repository at this point in the history
Fixes Cidan#325
  • Loading branch information
zeptognome committed Apr 22, 2024
1 parent 72877d9 commit d900028
Showing 1 changed file with 21 additions and 29 deletions.
50 changes: 21 additions & 29 deletions frames/currency.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,35 +73,27 @@ function CurrencyFrame:GetCurrencyItem(index, info)
if not item then
item = self:CreateCurrencyItem(index, info.isHeader)
item.frame:SetSize(232, 30)
item.frame:SetScript('OnEnter', function()
GameTooltip:SetOwner(item.frame, "ANCHOR_RIGHT")
GameTooltip:SetCurrencyToken(item.index)
GameTooltip:AddLine(" ")
GameTooltip:AddLine("Click to add or remove this currency to and from your backpack.", 1, 1, 1, true)
GameTooltip:Show()
end)
item.frame:SetScript('OnEnter', function()
GameTooltip:SetOwner(item.frame, "ANCHOR_RIGHT")
GameTooltip:SetCurrencyToken(item.index)
GameTooltip:AddLine(" ")
GameTooltip:AddLine("Click to add or remove this currency to and from your backpack.", 1, 1, 1, true)
GameTooltip:Show()
end)
item.frame:SetScript('OnLeave', function()
GameTooltip:Hide()
end)
item.frame:SetScript('OnMouseDown', function()
local refinfo = C_CurrencyInfo.GetCurrencyListInfo(item.index)
if refinfo.isHeader then
return
end
if refinfo.isShowInBackpack then
C_CurrencyInfo.SetCurrencyBackpack(item.index, false)
else
C_CurrencyInfo.SetCurrencyBackpack(item.index, true)
end
self:Update()
end)
if not info.isHeader then
item.frame:SetScript('OnEnter', function()
GameTooltip:SetOwner(item.frame, "ANCHOR_RIGHT")
GameTooltip:SetCurrencyToken(item.index)
GameTooltip:AddLine(" ")
GameTooltip:AddLine("Click to add or remove this currency to and from your backpack.", 1, 1, 1, true)
GameTooltip:Show()
end)
item.frame:SetScript('OnLeave', function()
GameTooltip:Hide()
end)
item.frame:SetScript('OnMouseDown', function()
local refinfo = C_CurrencyInfo.GetCurrencyListInfo(item.index)
if refinfo.isShowInBackpack then
C_CurrencyInfo.SetCurrencyBackpack(item.index, false)
else
C_CurrencyInfo.SetCurrencyBackpack(item.index, true)
end
self:Update()
end)
end
item.frame:Show()
self.currencyItems[info.name] = item
self.content:AddCell(info.name, item)
Expand Down

0 comments on commit d900028

Please sign in to comment.