Merge branch 'tooltip-ascensiondb-precedence' into questie-learner-comms-improvements
This commit is contained in:
@@ -237,7 +237,8 @@ end
|
||||
---@param questLogIndex number
|
||||
---@param questId number
|
||||
function _QuestEventHandler:QuestAccepted(questLogIndex, questId)
|
||||
questId = questId or select(8, GetQuestLogTitle(questLogIndex))
|
||||
local _, _, _, _, _, _, _, questLogQuestId = GetQuestLogTitle(questLogIndex)
|
||||
questId = questId or questLogQuestId
|
||||
Questie:Debug(Questie.DEBUG_DEVELOP, "[Quest Event] QUEST_ACCEPTED", questLogIndex, questId)
|
||||
|
||||
if questLog[questId] and questLog[questId].timer then
|
||||
|
||||
@@ -40,6 +40,10 @@ local function IsAscensionProtected(dbType, id, key)
|
||||
return protected and protected[key] == true
|
||||
end
|
||||
|
||||
local function HasAscensionQuestObjectiveData(questId)
|
||||
return IsAscensionProtected("QUEST", questId, 10)
|
||||
end
|
||||
|
||||
local function NormalizeSpawnZoneKey(zoneKey)
|
||||
-- Convert raw area IDs (e.g. 3431 from GetAreaID()) to the canonical map IDs
|
||||
-- used by AscensionDB and the rendering system (e.g. 1241 for Sunstrider Isle).
|
||||
@@ -1721,7 +1725,7 @@ function QuestieLearner:LearnQuestObjectiveNPC(questId, npcId, objText, objectiv
|
||||
-- 3. Register with tooltip system immediately. Preserve the objective icon so
|
||||
-- nameplates can render the correct learned slay/loot/talk marker.
|
||||
local QuestieTooltips = QuestieLoader:ImportModule("QuestieTooltips")
|
||||
if QuestieTooltips and QuestieTooltips.RegisterObjectiveTooltip then
|
||||
if QuestieTooltips and QuestieTooltips.RegisterObjectiveTooltip and not HasAscensionQuestObjectiveData(questId) then
|
||||
local objectiveIcon
|
||||
local QuestLogCache = QuestieLoader:ImportModule("QuestLogCache")
|
||||
local objectives = QuestLogCache and QuestLogCache.GetQuestObjectives and QuestLogCache.GetQuestObjectives(questId)
|
||||
|
||||
@@ -120,7 +120,8 @@ function QuestiePlayer:GetCurrentZoneId()
|
||||
return uiMapId
|
||||
end
|
||||
|
||||
return ZoneDB.instanceIdToUiMapId[select(8, GetInstanceInfo())]
|
||||
local _, _, _, _, _, _, _, instanceMapID = GetInstanceInfo()
|
||||
return ZoneDB.instanceIdToUiMapId[instanceMapID]
|
||||
end
|
||||
|
||||
function QuestiePlayer:GetCurrentUiMapId()
|
||||
@@ -129,7 +130,8 @@ function QuestiePlayer:GetCurrentUiMapId()
|
||||
if uiMapId then
|
||||
return uiMapId
|
||||
end
|
||||
return ZoneDB.instanceIdToUiMapId[select(8, GetInstanceInfo())]
|
||||
local _, _, _, _, _, _, _, instanceMapID = GetInstanceInfo()
|
||||
return ZoneDB.instanceIdToUiMapId[instanceMapID]
|
||||
end
|
||||
|
||||
---@return number
|
||||
|
||||
@@ -43,6 +43,31 @@ local _tooltipLastText = ""
|
||||
|
||||
local _InitObjectiveTexts
|
||||
|
||||
local function _GetQuestObjectiveSummary(questId)
|
||||
if not QuestieDB or not QuestieDB.GetQuest then
|
||||
return nil
|
||||
end
|
||||
|
||||
local quest = QuestieDB:GetQuest(questId)
|
||||
if not quest or not quest.ObjectiveData then
|
||||
return nil
|
||||
end
|
||||
|
||||
local summary = {}
|
||||
for _, objective in ipairs(quest.ObjectiveData) do
|
||||
local text = objective and (objective.Text or objective.Description)
|
||||
if type(text) == "string" and text ~= "" then
|
||||
tinsert(summary, text)
|
||||
end
|
||||
end
|
||||
|
||||
if table.getn(summary) == 0 then
|
||||
return nil
|
||||
end
|
||||
|
||||
return summary
|
||||
end
|
||||
|
||||
---@param questId number
|
||||
---@param key string monster: m_, items: i_, objects: o_ + string name of the objective
|
||||
---@param objective table
|
||||
@@ -205,7 +230,7 @@ function QuestieTooltips:GetTooltip(key)
|
||||
return nil
|
||||
end
|
||||
|
||||
if QuestiePlayer.numberOfGroupMembers > MAX_GROUP_MEMBER_COUNT then
|
||||
if (QuestiePlayer.numberOfGroupMembers or 0) > MAX_GROUP_MEMBER_COUNT then
|
||||
return nil -- temporary disable tooltips in raids, we should make a proper fix
|
||||
end
|
||||
|
||||
@@ -345,11 +370,27 @@ elseif key:sub(1,2) == "o_" then
|
||||
|
||||
if QuestieTooltips.lookupByKey[key] then
|
||||
local playerName = UnitName("player")
|
||||
local hasObjectiveEntries = false
|
||||
for _, tooltip in next, QuestieTooltips.lookupByKey[key] do
|
||||
if not tooltip.name then
|
||||
hasObjectiveEntries = true
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
for k, tooltip in next, QuestieTooltips.lookupByKey[key] do
|
||||
if tooltip.name then
|
||||
if Questie.db.profile.showQuestsInNpcTooltip then
|
||||
local questString = QuestieLib:GetColoredQuestName(tooltip.questId, Questie.db.profile.enableTooltipsQuestLevel, true, true)
|
||||
tinsert(tooltipLines, questString)
|
||||
if not hasObjectiveEntries then
|
||||
local objectiveSummary = _GetQuestObjectiveSummary(tooltip.questId)
|
||||
if objectiveSummary then
|
||||
for _, objectiveText in ipairs(objectiveSummary) do
|
||||
tinsert(tooltipLines, " |cFFcbcbcb" .. objectiveText .. "|r")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
local objective = tooltip.objective
|
||||
|
||||
@@ -413,7 +413,7 @@ function QuestieTracker.Initialize()
|
||||
for i = 1, questsWatched do
|
||||
local questIndex = GetQuestIndexForWatch(i)
|
||||
if questIndex then
|
||||
local questId = select(8, GetQuestLogTitle(questIndex))
|
||||
local _, _, _, _, _, _, _, questId = GetQuestLogTitle(questIndex)
|
||||
if questId then
|
||||
tempQuestIDs[i] = questId
|
||||
end
|
||||
@@ -2277,7 +2277,7 @@ function QuestieTracker:HookBaseTracker()
|
||||
|
||||
-- Intercept and return a Questie boolean value
|
||||
IsQuestWatched = function(index)
|
||||
local questId = select(8, GetQuestLogTitle(index))
|
||||
local _, _, _, _, _, _, _, questId = GetQuestLogTitle(index)
|
||||
if questId == 0 then
|
||||
-- When an objective progresses in TBC "index" is the questId, but when a quest is manually added to the quest watch
|
||||
-- (e.g. shift clicking it in the quest log) "index" is the questLogIndex.
|
||||
|
||||
Reference in New Issue
Block a user