Revert Tooltip.lua to v1.6.1 (3f8563c) - fixing nameplate icon regression

This commit is contained in:
Xurkon
2026-05-10 10:19:30 -05:00
parent a885faa364
commit b6f4e08880
+87 -107
View File
@@ -232,113 +232,93 @@ function QuestieTooltips:GetTooltip(key)
-- Try to find in learned NPCs or objects -- Try to find in learned NPCs or objects
local id = tonumber(key:sub(3)) local id = tonumber(key:sub(3))
if id then if id then
if key:sub(1,2) == "m_" then if key:sub(1,2) == "m_" then
local learnedNpc = QuestieLearner.data.npcs[id] local learnedNpc = QuestieLearner.data.npcs[id]
-- npc[10] from _AddToArray is an array of questIds, not {questId -> objList} if learnedNpc and learnedNpc[10] then -- check questObjectives
if learnedNpc and learnedNpc[10] then for questId, objList in next, learnedNpc[10] do
for _, questId in ipairs(learnedNpc[10]) do local oIndex = 1
local qData = QuestieLearner.data.quests[questId] while objList[oIndex] do
if qData and qData[10] then local objText = objList[oIndex]
for slotIdx = 1, #qData[10] do local needed, collected
local objSlot = qData[10][slotIdx] local objectives = QuestLogCache.GetQuestObjectives(questId)
if objSlot then if objectives then
for oIndex = 1, #objSlot do for _, obj in next, objectives do
local objEntry = objSlot[oIndex] if obj.text and objText and (obj.text == objText or string.find(obj.text, objText, 1, true) or string.find(objText, obj.text, 1, true)) then
if objEntry and objEntry[2] then needed = obj.numRequired
local objText = objEntry[2] collected = obj.numFulfilled
local needed, collected break
local objectives = QuestLogCache.GetQuestObjectives(questId) end
if objectives then end
for _, obj in next, objectives do end
if obj.text and objText and (obj.text == objText or string.find(obj.text, objText, 1, true) or string.find(objText, obj.text, 1, true)) then QuestieTooltips:RegisterObjectiveTooltip(questId, key, {
needed = obj.numRequired Index = 0,
collected = obj.numFulfilled Description = objText,
break Needed = needed,
end Collected = collected,
end Update = function(self)
end local objs = QuestLogCache.GetQuestObjectives(questId)
QuestieTooltips:RegisterObjectiveTooltip(questId, key, { if objs then
Index = 0, for _, o in next, objs do
Description = objText, if o.text and self.Description and (o.text == self.Description or string.find(o.text, self.Description, 1, true) or string.find(self.Description, o.text, 1, true)) then
Needed = needed, self.Needed = o.numRequired
Collected = collected, self.Collected = o.numFulfilled
Update = function(self) break
local objs = QuestLogCache.GetQuestObjectives(questId) end
if objs then end
for _, o in next, objs do end
if o.text and self.Description and (o.text == self.Description or string.find(o.text, self.Description, 1, true) or string.find(self.Description, o.text, 1, true)) then end
self.Needed = o.numRequired })
self.Collected = o.numFulfilled oIndex = oIndex + 1
break end
end end
end if learnedNpc.mc then
end tinsert(tooltipLines, "|cFF5EBAF3(Learned - Confidence: " .. tostring(learnedNpc.mc) .. ")|r")
end end
}) end
end elseif key:sub(1,2) == "o_" then
end local learnedObj = QuestieLearner.data.objects[id]
end if learnedObj and learnedObj[10] then
end for questId, objList in next, learnedObj[10] do
end local oIndex = 1
end while objList[oIndex] do
if learnedNpc.mc then local objText = objList[oIndex]
tinsert(tooltipLines, "|cFF5EBAF3(Learned - Confidence: " .. tostring(learnedNpc.mc) .. ")|r") local needed, collected
end local objectives = QuestLogCache.GetQuestObjectives(questId)
end if objectives then
elseif key:sub(1,2) == "o_" then for _, obj in next, objectives do
local learnedObj = QuestieLearner.data.objects[id] if obj.text and objText and (obj.text == objText or string.find(obj.text, objText, 1, true) or string.find(objText, obj.text, 1, true)) then
-- obj[2] from _AddToArray is an array of questIds (questStarts), not {questId -> objList} needed = obj.numRequired
if learnedObj and learnedObj[2] then collected = obj.numFulfilled
for _, questId in ipairs(learnedObj[2]) do break
local qData = QuestieLearner.data.quests[questId] end
if qData and qData[10] then end
for slotIdx = 1, #qData[10] do end
local objSlot = qData[10][slotIdx] QuestieTooltips:RegisterObjectiveTooltip(questId, key, {
if objSlot then Index = 0,
for oIndex = 1, #objSlot do Description = objText,
local objEntry = objSlot[oIndex] Needed = needed,
if objEntry and objEntry[2] then Collected = collected,
local objText = objEntry[2] Update = function(self)
local needed, collected local objs = QuestLogCache.GetQuestObjectives(questId)
local objectives = QuestLogCache.GetQuestObjectives(questId) if objs then
if objectives then for _, o in next, objs do
for _, obj in next, objectives do if o.text and self.Description and (o.text == self.Description or string.find(o.text, self.Description, 1, true) or string.find(self.Description, o.text, 1, true)) then
if obj.text and objText and (obj.text == objText or string.find(obj.text, objText, 1, true) or string.find(objText, obj.text, 1, true)) then self.Needed = o.numRequired
needed = obj.numRequired self.Collected = o.numFulfilled
collected = obj.numFulfilled break
break end
end end
end end
end end
QuestieTooltips:RegisterObjectiveTooltip(questId, key, { })
Index = 0, oIndex = oIndex + 1
Description = objText, end
Needed = needed, end
Collected = collected, if learnedObj.mc then
Update = function(self) tinsert(tooltipLines, "|cFF5EBAF3(Learned - Confidence: " .. tostring(learnedObj.mc) .. ")|r")
local objs = QuestLogCache.GetQuestObjectives(questId) end
if objs then end
for _, o in next, objs do end
if o.text and self.Description and (o.text == self.Description or string.find(o.text, self.Description, 1, true) or string.find(self.Description, o.text, 1, true)) then
self.Needed = o.numRequired
self.Collected = o.numFulfilled
break
end
end
end
end
})
end
end
end
end
end
end
if learnedObj.mc then
tinsert(tooltipLines, "|cFF5EBAF3(Learned - Confidence: " .. tostring(learnedObj.mc) .. ")|r")
end
end
end
end end
end end
end end