fix: handle killcredit objective tooltips
This commit is contained in:
@@ -1673,6 +1673,20 @@ _RegisterObjectiveTooltips = function(objective, questId, blockItemTooltips)
|
|||||||
objective.registeredItemTooltips = true
|
objective.registeredItemTooltips = true
|
||||||
end
|
end
|
||||||
return
|
return
|
||||||
|
elseif objective.Type == "killcredit" then
|
||||||
|
local ids = objective.IdList
|
||||||
|
if type(ids) ~= "table" then
|
||||||
|
ids = { objective.Id }
|
||||||
|
end
|
||||||
|
|
||||||
|
for _, id in ipairs(ids) do
|
||||||
|
if id then
|
||||||
|
QuestieTooltips:RegisterObjectiveTooltip(questId, "m_" .. id, objective)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
objective.hasRegisteredTooltips = true
|
||||||
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
Questie:Error("[QuestieQuest]: [Tooltips] " ..
|
Questie:Error("[QuestieQuest]: [Tooltips] " ..
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ describe("QuestieQuest tooltip fallback", function()
|
|||||||
assert.is_true(has(questieQuest, 'tooltipKey = "m_" .. objective.Id'))
|
assert.is_true(has(questieQuest, 'tooltipKey = "m_" .. objective.Id'))
|
||||||
assert.is_true(has(questieQuest, 'tooltipKey = "o_" .. objective.Id'))
|
assert.is_true(has(questieQuest, 'tooltipKey = "o_" .. objective.Id'))
|
||||||
assert.is_true(has(questieQuest, 'tooltipKey = "i_" .. objective.Id'))
|
assert.is_true(has(questieQuest, 'tooltipKey = "i_" .. objective.Id'))
|
||||||
|
assert.is_true(has(questieQuest, 'elseif objective.Type == "killcredit" then'))
|
||||||
|
assert.is_true(has(questieQuest, 'QuestieTooltips:RegisterObjectiveTooltip(questId, "m_" .. id, objective)'))
|
||||||
assert.is_true(has(questieQuest, "objective.registeredItemTooltips = true"))
|
assert.is_true(has(questieQuest, "objective.registeredItemTooltips = true"))
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|||||||
Reference in New Issue
Block a user