Skip to content

Commit

Permalink
#158 fix start quest tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
Urtgard committed Sep 4, 2024
1 parent e012599 commit 637b16f
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions Tooltip.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,21 @@ function WQA:CreateQTip()
end
end

---@param questID number
local function GetIconTexture(questID)
local texture = select(2, GetQuestLogRewardInfo(1, questID))
if texture then
return texture
end

local currencyInfo = C_QuestLog.GetQuestRewardCurrencyInfo(questID, 1, false)
if currencyInfo then
return currencyInfo.texture
end

return [[Interface\GossipFrame\auctioneerGossipIcon]]
end

function WQA:UpdateQTip(tasks)
local tooltip = self.tooltip
if next(tasks) == nil then
Expand Down Expand Up @@ -200,17 +215,12 @@ function WQA:UpdateQTip(tasks)
zoneID = self:GetQuestZoneID(id)
local x, y = C_TaskQuest.GetQuestLocation(id, zoneID)
widget.questX, widget.questY = x or 0, y or 0
widget.IconTexture =
select(2, GetQuestLogRewardInfo(1, id)) or
select(2, GetQuestLogRewardCurrencyInfo(1, id)) or
[[Interface\GossipFrame\auctioneerGossipIcon]]
widget.IconTexture = GetIconTexture(id)
local function f(widget)
if not widget.IconTexture then
WQA:ScheduleTimer(
function()
widget.IconTexture =
select(2, GetQuestLogRewardInfo(1, id)) or
select(2, GetQuestLogRewardCurrencyInfo(1, id))
widget.IconTexture = GetIconTexture(id)
f(widget)
end,
1.5
Expand Down

0 comments on commit 637b16f

Please sign in to comment.