1 local real_GameTooltipOnShow
= GameTooltip
:GetScript("OnShow") or QuestHelper
.nop
3 local function addObjectiveObjTip(objective
, gap
)
4 if objective
.watched
or objective
.progress
then
6 GameTooltip
:AddLine(" ") -- Add a gap between what we're adding and what's already there.
9 if objective
.quest
then
10 GameTooltip
:AddLine(QHFormat("TOOLTIP_QUEST", string.match(objective
.quest
.obj
or "", "^%d*/%d*/(.*)$") or "???"), 1, 1, 1)
13 if objective
.progress
then
14 QuestHelper
:AppendObjectiveProgressToTooltip(objective
, GameTooltip
)
16 GameTooltip
:AddLine(QHText("TOOLTIP_WATCHED"), unpack(QuestHelper
:GetColourTheme().tooltip
))
19 -- Calling Show again to cause the tooltip's dimensions to be recalculated.
20 -- Since the frame should already be shown, the OnShow event shouldn't be called again.
24 if objective
.used
then
25 for obj
, text
in pairs(objective
.used
) do
26 GameTooltip
:AddLine(" ")
27 GameTooltip
:AddLine(QHFormat(text
, obj
.obj
), 1, 1, 1)
28 addObjectiveObjTip(obj
, false)
33 local function addObjectiveTip(cat
, obj
)
34 local list
= QuestHelper
.objective_objects
[cat
]
36 local objective
= list
[obj
]
38 addObjectiveObjTip(objective
, true)
43 GameTooltip
:SetScript("OnShow", function(self
, ...)
45 -- Some other AddOns hook this function, but don't bother to pass the values they were called with.
49 if QuestHelper_Pref
.tooltip
then
50 local monster
, item
= self
:GetUnit(), self
:GetItem()
53 addObjectiveTip("monster", monster
)
57 addObjectiveTip("item", item
)
61 return real_GameTooltipOnShow(self
, ...)