fix(tracker): show quest item shortcut buttons for custom quests

Item buttons only checked QuestieDB static data (sourceItemId /
requiredSourceItems), which custom server quests never have. Fall back
to GetQuestLogSpecialItemInfo to resolve the item live from the quest
log when the DB has no data for the quest.
This commit is contained in:
2026-07-17 16:13:08 +02:00
parent b4e0894c3f
commit 460718e313
3 changed files with 30 additions and 3 deletions
+21
View File
@@ -46,6 +46,7 @@ local QuestieDebugOffer = QuestieLoader:ImportModule("QuestieDebugOffer")
local C_Timer = QuestieCompat.C_Timer local C_Timer = QuestieCompat.C_Timer
local GetQuestLogTitle = QuestieCompat.GetQuestLogTitle local GetQuestLogTitle = QuestieCompat.GetQuestLogTitle
local GetQuestLogIndexByID = QuestieCompat.GetQuestLogIndexByID local GetQuestLogIndexByID = QuestieCompat.GetQuestLogIndexByID
local GetQuestLogSpecialItemInfo = QuestieCompat.GetQuestLogSpecialItemInfo
local GetItemInfo = QuestieCompat.GetItemInfo local GetItemInfo = QuestieCompat.GetItemInfo
local function GetNumLines(label) local function GetNumLines(label)
if label.GetNumLines then if label.GetNumLines then
@@ -1094,6 +1095,26 @@ function QuestieTracker:Update()
local usableQIB = false local usableQIB = false
local sourceItemId = QuestieDB.QueryQuestSingle(quest.Id, "sourceItemId") local sourceItemId = QuestieDB.QueryQuestSingle(quest.Id, "sourceItemId")
local isLiveSourceItem = false
if not sourceItemId or sourceItemId == 0 then
-- QuestieDB has no data for this quest (e.g. a custom server quest).
-- Ask the client directly which item, if any, it considers this quest's
-- usable "special item" instead of relying on static DB data that
-- simply doesn't exist for quests Questie doesn't know about.
local questLogIndex = GetQuestLogIndexByID and GetQuestLogIndexByID(quest.Id)
if questLogIndex and questLogIndex > 0 and GetQuestLogSpecialItemInfo then
local link = GetQuestLogSpecialItemInfo(questLogIndex)
local liveItemId = link and tonumber(link:match("item:(%d+)"))
if liveItemId then
sourceItemId = liveItemId
isLiveSourceItem = true
quest.sourceItemId = liveItemId
end
end
end
quest._liveSourceItem = isLiveSourceItem
local sourceItem = sourceItemId and TrackerUtils:IsQuestItemUsable(sourceItemId) local sourceItem = sourceItemId and TrackerUtils:IsQuestItemUsable(sourceItemId)
local requiredItems = quest.requiredSourceItems local requiredItems = quest.requiredSourceItems
local requiredItem = requiredItems and TrackerUtils:IsQuestItemUsable(requiredItems[1]) local requiredItem = requiredItems and TrackerUtils:IsQuestItemUsable(requiredItems[1])
+5 -1
View File
@@ -504,7 +504,11 @@ function TrackerLinePool.Initialize(questFrame)
-- Check primary source item -- Check primary source item
if quest.sourceItemId and quest.sourceItemId ~= 0 and buttonType == "primary" then if quest.sourceItemId and quest.sourceItemId ~= 0 and buttonType == "primary" then
if QuestieDB.QueryItemSingle(quest.sourceItemId, "class") == 12 and GetItemCount(quest.sourceItemId, false, false) > 0 then -- For quests QuestieDB has no data on, sourceItemId was resolved live via
-- GetQuestLogSpecialItemInfo -- the client already vetted it as the quest's
-- special item, so the static-DB item class isn't known/needed here.
local isQuestItem = quest._liveSourceItem or QuestieDB.QueryItemSingle(quest.sourceItemId, "class") == 12
if isQuestItem and GetItemCount(quest.sourceItemId, false, false) > 0 then
foundItemId = quest.sourceItemId foundItemId = quest.sourceItemId
end end
end end
+4 -2
View File
@@ -1,13 +1,15 @@
# Questie-X # Questie-X
Fork of [aron-w/Questie-X](https://github.com/aron-w/Questie-X) with bug fixes. Fork of [aron-w/Questie-X](https://github.com/aron-w/Questie-X) with bug fixes for CoA.
## Changes in this fork ## Changes in this fork
- fixed world map icons offset due to CoA's objective frame and zoom addons like Magnify. - fixed world map icons offset due to CoA's objective frame and zoom addons like Magnify.
- fixed tracker objectives not updating correctly. - fixed tracker objectives not updating correctly.
- fixed tracker handle not moving the frame. - fixed tracker handle not moving the frame.
- fixed custom quests having no name. - fixed custom quests having no name in the tracker.
- fixed custom quests not showing (complete) in the tracker.
- fixed custom quest items not showing.
## Credits ## Credits