1 QuestHelper_File
["dodads.lua"] = "Development Version"
3 local ofs
= 0.000723339 * (GetScreenHeight()/GetScreenWidth() + 1/3) * 70.4;
4 local radius
= ofs
/ 1.166666666666667;
6 local function convertLocation(p
)
7 local c
, x
, y
= p
[1].c
, p
[3], p
[4]
8 x
, y
= x
/QuestHelper
.continent_scales_x
[c
], y
/QuestHelper
.continent_scales_y
[c
]
12 local function convertLocationToScreen(p
, c
, z
)
13 return QuestHelper
.Astrolabe
:TranslateWorldMapPosition(p
[1].c
, 0, p
[3]/QuestHelper
.continent_scales_x
[p
[1].c
], p
[4]/QuestHelper
.continent_scales_y
[p
[1].c
], c
, z
)
16 local function convertNodeToScreen(n
, c
, z
)
17 return QuestHelper
.Astrolabe
:TranslateWorldMapPosition(n
.c
, 0, n
.x
/QuestHelper
.continent_scales_x
[n
.c
], n
.y
/QuestHelper
.continent_scales_y
[n
.c
], c
, z
)
20 QuestHelper
.map_overlay
= CreateFrame("FRAME", nil, WorldMapDetailFrame
)
21 QuestHelper
.map_overlay
:SetFrameLevel(WorldMapDetailFrame
:GetFrameLevel()+1)
22 QuestHelper
.map_overlay
:SetAllPoints()
23 QuestHelper
.map_overlay
:SetFrameStrata("FULLSCREEN")
25 local function ClampLine(x1
, y1
, x2
, y2
)
26 if x1
and y1
and x2
and y2
then
27 local x_div
, y_div
= (x2
-x1
), (y2
-y1
)
28 local x_0
= y1
-x1
/x_div
*y_div
29 local x_1
= y1
+(1-x1
)/x_div
*y_div
30 local y_0
= x1
-y1
/y_div
*x_div
31 local y_1
= x1
+(1-y1
)/y_div
*x_div
73 if x1
>= 0 and x2
>= 0 and y1
>= 0 and y2
>= 0 and x1
<= 1 and x2
<= 1 and y1
<= 1 and y2
<= 1 then
79 local function pushPath(list
, path
, c
, z
)
81 pushPath(list
, path
.p
, c
, z
)
82 local t
= QuestHelper
:CreateTable()
83 t
[1], t
[2] = QuestHelper
.Astrolabe
:TranslateWorldMapPosition(path
.c
, 0, path
.x
/QuestHelper
.continent_scales_x
[path
.c
], path
.y
/QuestHelper
.continent_scales_y
[path
.c
], c
, z
)
88 function QuestHelper
:CreateWorldMapWalker()
89 local walker
= CreateFrame("Button", nil, QuestHelper
.map_overlay
)
92 walker
:SetPoint("CENTER", QuestHelper
.map_overlay
, "TOPLEFT", 0, 0)
100 walker
.map_dodads
= {}
101 walker
.used_map_dodads
= 0
103 function walker
:OnUpdate(elapsed
)
106 if QuestHelper_Pref
.show_ants
then
107 local points
= self
.points
109 self
.phase
= self
.phase
+ elapsed
* 0.66
110 while self
.phase
> 1 do self
.phase
= self
.phase
- 1 end
112 local w
, h
= QuestHelper
.map_overlay
:GetWidth(), -QuestHelper
.map_overlay
:GetHeight()
114 local c
, z
= GetCurrentMapContinent(), GetCurrentMapZone()
116 local last_x
, last_y
= self
.frame
.Astrolabe
:TranslateWorldMapPosition(self
.frame
.c
, self
.frame
.z
, self
.frame
.x
, self
.frame
.y
, c
, z
) local remainder
= self
.phase
118 for i
, pos
in ipairs(points
) do
119 local new_x
, new_y
= unpack(pos
)
120 local x1
, y1
, x2
, y2
= ClampLine(last_x
, last_y
, new_x
, new_y
)
121 last_x
, last_y
= new_x
, new_y
124 local len
= math
.sqrt((x1
-x2
)*(x1
-x2
)*16/9+(y1
-y2
)*(y1
-y2
))
127 local interval
= .025/len
128 local p
= remainder
*interval
132 local dot
= self
.dots
[out
]
134 dot
= QuestHelper
:CreateDotTexture(self
)
135 dot
:SetDrawLayer("BACKGROUND")
140 dot
:SetPoint("CENTER", QuestHelper
.map_overlay
, "TOPLEFT", x1
*w
*(1-p
)+x2
*w
*p
, y1
*h
*(1-p
)+y2
*h
*p
)
145 remainder
= (p
-1)/interval
151 while #self
.dots
> out
do
152 QuestHelper
:ReleaseTexture(table.remove(self
.dots
))
156 function walker
:RouteChanged()
157 if self
.frame
.Astrolabe
.WorldMapVisible
then
158 local points
= self
.points
159 local cur
= self
.frame
.pos
161 while #points
> 0 do self
.frame
:ReleaseTable(table.remove(points
)) end
163 local travel_time
= 0.0
165 local c
, z
= GetCurrentMapContinent(), GetCurrentMapZone()
167 if self
.frame
.target
then
168 cur
= self
.frame
.target
169 local t
= self
.frame
:CreateTable()
170 t
[1], t
[2] = convertLocationToScreen(cur
, c
, z
)
171 table.insert(points
, t
)
174 for i
, obj
in pairs(self
.frame
.route
) do
175 local path
, d
= self
.frame
:ComputeRoute(cur
, obj
.pos
)
177 pushPath(points
, path
, c
, z
)
179 travel_time
= travel_time
+ d
180 obj
.travel_time
= travel_time
184 local t
= self
.frame
:CreateTable()
185 t
[1], t
[2] = convertLocationToScreen(cur
, c
, z
)
187 table.insert(points
, t
)
190 for i
= 1, #self
.frame
.route
do
191 local dodad
= self
.map_dodads
[i
]
193 self
.map_dodads
[i
] = self
.frame
:CreateWorldMapDodad(self
.frame
.route
[i
], i
)
195 self
.map_dodads
[i
]:SetObjective(self
.frame
.route
[i
], i
)
199 for i
= #self
.frame
.route
+1,self
.used_map_dodads
do
200 self
.map_dodads
[i
]:SetObjective(nil, 0)
203 self
.used_map_dodads
= #self
.frame
.route
207 walker
:SetScript("OnEvent", walker
.RouteChanged
)
208 walker
:RegisterEvent("WORLD_MAP_UPDATE")
210 walker
:SetScript("OnUpdate", walker
.OnUpdate
)
215 function QuestHelper
:GetOverlapObjectives(obj
)
216 local w
, h
= self
.map_overlay
:GetWidth(), self
.map_overlay
:GetHeight()
217 local c
, z
= GetCurrentMapContinent(), GetCurrentMapZone()
219 local list
= self
.overlap_list
223 self
.overlap_list
= list
225 while table.remove(list
) do end
228 local cx
, cy
= GetCursorPosition()
230 local es
= QuestHelper
.map_overlay
:GetEffectiveScale()
233 cx
, cy
= (cx
-self
.map_overlay
:GetLeft()*es
)*ies
, (self
.map_overlay
:GetTop()*es
-cy
)*ies
235 local s
= 10*QuestHelper_Pref
.scale
237 for i
, o
in ipairs(self
.route
) do
239 table.insert(list
, o
)
241 local x
, y
= o
.pos
[3], o
.pos
[4]
242 x
, y
= x
/ self
.continent_scales_x
[o
.pos
[1].c
], y
/ self
.continent_scales_y
[o
.pos
[1].c
]
243 x
, y
= self
.Astrolabe
:TranslateWorldMapPosition(o
.pos
[1].c
, 0, x
, y
, c
, z
)
245 if x
and y
and x
> 0 and y
> 0 and x
< 1 and y
< 1 then
248 if cx
>= x
-s
and cy
>= y
-s
and cx
<= x
+s
and cy
<= y
+s
then
249 table.insert(list
, o
)
255 table.sort(list
, function(a
, b
) return (a
.travel_time
or 0) < (b
.travel_time
or 0) end)
260 local prog_sort_table
= {}
262 function QuestHelper
:AppendObjectiveProgressToTooltip(o
, tooltip
, font
)
264 local theme
= self
:GetColourTheme()
266 for user
, progress
in pairs(o
.progress
) do
267 table.insert(prog_sort_table
, user
)
270 table.sort(prog_sort_table
, function(a
, b
)
271 if o
.progress
[a
][3] < o
.progress
[b
][3] then
273 elseif o
.progress
[a
][3] == o
.progress
[b
][3] then
279 for i
, u
in ipairs(prog_sort_table
) do
280 tooltip
:AddDoubleLine(QHFormat("PEER_PROGRESS", u
),
281 self
:ProgressString(o
.progress
[u
][1].."/"..o
.progress
[u
][2],
282 o
.progress
[u
][3]), unpack(theme
.tooltip
))
285 local last
, name
= tooltip
:NumLines(), tooltip
:GetName()
286 local left
, right
= _G
[name
.."TextLeft"..last
], _G
[name
.."TextRight"..last
]
288 left
:SetFont(font
, 13)
289 right
:SetFont(font
, 13)
293 while table.remove(prog_sort_table
) do end
297 function QuestHelper
:AppendObjectiveToTooltip(o
)
298 local theme
= self
:GetColourTheme()
300 self
.tooltip
:AddLine(o
:Reason(), unpack(theme
.tooltip
))
301 self
.tooltip
:GetPrevLines():SetFont(self
.font
.serif
, 14)
303 self
:AppendObjectiveProgressToTooltip(o
, self
.tooltip
, QuestHelper
.font
.sans
)
305 self
.tooltip
:AddDoubleLine(QHText("TRAVEL_ESTIMATE"), QHFormat("TRAVEL_ESTIMATE_VALUE", o
.travel_time
or 0), unpack(theme
.tooltip
))
306 self
.tooltip
:GetPrevLines():SetFont(self
.font
.sans
, 11)
307 select(2, self
.tooltip
:GetPrevLines()):SetFont(self
.font
.sans
, 11)
310 function QuestHelper
:CreateWorldMapDodad(objective
, index
)
311 local icon
= CreateFrame("Button", nil, QuestHelper
.map_overlay
)
312 icon
:SetFrameStrata("FULLSCREEN")
314 function icon
:SetTooltip(list
)
315 QuestHelper
.tooltip
:SetOwner(self
, "ANCHOR_CURSOR")
316 QuestHelper
.tooltip
:ClearLines()
320 for i
, o
in ipairs(list
) do
324 QuestHelper
.tooltip
:AddLine("|c80ff0000 . . . . . .|r")
325 QuestHelper
.tooltip
:GetPrevLines():SetFont(QuestHelper
.font
.sans
, 8)
328 QuestHelper
:AppendObjectiveToTooltip(o
)
331 QuestHelper
.tooltip
:Show()
334 function icon
:SetObjective(objective
, i
)
335 self
:SetHeight(20*QuestHelper_Pref
.scale
)
336 self
:SetWidth(20*QuestHelper_Pref
.scale
)
339 QuestHelper
:ReleaseTexture(self
.dot
)
344 QuestHelper
:ReleaseTexture(self
.bg
)
349 self
.objective
= objective
353 -- if it's the very next objective, give it the green background
354 self
.bg
= QuestHelper
:CreateIconTexture(self
, 13)
355 elseif objective
.filter_blocked
then
356 -- if there are still prerequisites, make it grey
357 -- We checked status of pre-requisites last time we scanned the quest log, so just check the flag.
358 self
.bg
= QuestHelper
:CreateIconTexture(self
, 16)
360 -- otherwise give it the background selected by the objective
361 self
.bg
= QuestHelper
:CreateIconTexture(self
, objective
.icon_bg
)
364 self
.dot
= QuestHelper
:CreateIconTexture(self
, objective
.icon_id
)
366 self
.bg
:SetDrawLayer("BACKGROUND")
367 self
.bg
:SetAllPoints()
368 self
.dot
:SetPoint("TOPLEFT", self
, "TOPLEFT", 3*QuestHelper_Pref
.scale
, -3*QuestHelper_Pref
.scale
)
369 self
.dot
:SetPoint("BOTTOMRIGHT", self
, "BOTTOMRIGHT", -3*QuestHelper_Pref
.scale
, 3*QuestHelper_Pref
.scale
)
371 QuestHelper
.Astrolabe
:PlaceIconOnWorldMap(QuestHelper
.map_overlay
, self
, convertLocation(objective
.pos
))
378 function icon
:SetGlow(list
)
379 local w
, h
= QuestHelper
.map_overlay
:GetWidth(), QuestHelper
.map_overlay
:GetHeight()
380 local c
, z
= GetCurrentMapContinent(), GetCurrentMapZone()
381 local _
, x_size
, y_size
= QuestHelper
.Astrolabe
:ComputeDistance(c
, z
, 0.25, 0.25, c
, z
, 0.75, 0.75)
383 x_size
= math
.max(25, 200 / x_size
* w
)
384 y_size
= math
.max(25, 200 / y_size
* h
)
387 for _
, objective
in ipairs(list
) do
388 if objective
.p
then for _
, list
in pairs(objective
.p
) do
389 for _
, p
in ipairs(list
) do
390 local x
, y
= p
[3], p
[4]
391 x
, y
= x
/ QuestHelper
.continent_scales_x
[p
[1].c
], y
/ QuestHelper
.continent_scales_y
[p
[1].c
]
392 x
, y
= QuestHelper
.Astrolabe
:TranslateWorldMapPosition(p
[1].c
, 0, x
, y
, c
, z
)
393 if x
and y
and x
> 0 and y
> 0 and x
< 1 and y
< 1 then
394 if not self
.glow_list
then
395 self
.glow_list
= QuestHelper
:CreateTable()
398 tex
= self
.glow_list
[out
]
400 tex
= QuestHelper
:CreateGlowTexture(self
)
401 table.insert(self
.glow_list
, tex
)
405 tex
:SetPoint("CENTER", QuestHelper
.map_overlay
, "TOPLEFT", x
*w
, -y
*h
)
406 tex
:SetVertexColor(1,1,1,0)
408 tex
:SetHeight(y_size
)
410 tex
.max_alpha
= 1/p
[5]
416 if self
.glow_list
then
417 for i
= out
,#self
.glow_list
do
418 QuestHelper
:ReleaseTexture(table.remove(self
.glow_list
))
421 if #self
.glow_list
== 0 then
422 QuestHelper
:ReleaseTable(self
.glow_list
)
428 icon
.show_glow
= false
433 function icon
:OnUpdate(elapsed
)
434 self
.phase
= (self
.phase
+ elapsed
)%6.283185307179586476925286766559005768394338798750211641949889185
436 if self
.old_count
> 0 then
437 local list
= QuestHelper
:GetOverlapObjectives(self
.objective
)
438 if #list
~= self
.old_count
then
439 self
:SetTooltip(list
)
440 self
.old_count
= #list
445 if self
.show_glow
then
446 self
.glow_pct
= math
.min(1, self
.glow_pct
+elapsed
*1.5)
448 self
.glow_pct
= math
.max(0, self
.glow_pct
-elapsed
*0.5)
450 if self
.glow_pct
== 0 then
451 if self
.glow_list
then
452 while #self
.glow_list
> 0 do
453 QuestHelper
:ReleaseTexture(table.remove(self
.glow_list
))
455 QuestHelper
:ReleaseTable(self
.glow_list
)
459 self
:SetScript("OnUpdate", nil)
464 if self
.glow_list
then
465 -- You know, these numbers are harmonics of pi. Would SETI detected them, or would they just be seen as noise?
466 -- I'd vote for the later.
468 -- Pi - circumference over diameter - when was the last time you actually cared about diameters in math?
470 -- Pretty much everything in computer geometry depends on the pythagorean theorem, which you can use for
471 -- circles, spheres, and hyper-spheres, if you use radius.
473 -- It's even the basis of special relativity, with time being multiplied by c so that you get a distance
474 -- that you can use with the spatial dimensions. We're all in agreement that space traveling aliens are
475 -- going to know about relativity, right?
477 -- And if you ever do trig, a full circle would be exactly (circumference over radius) radians instead of
478 -- (circumference over diameter)*2 radians.
480 -- Obviously aliens are much more likely to prefer 6.283185307179586... as constant than our pi.
481 local r
, g
, b
= math
.sin(self
.phase
)*0.25+0.75,
482 math
.sin(self
.phase
+2.094395102393195492308428922186335256131446266250070547316629728)*0.25+0.75,
483 math
.sin(self
.phase
+4.188790204786390984616857844372670512262892532500141094633259456)*0.25+0.75
485 for i
, tex
in ipairs(self
.glow_list
) do
486 tex
:SetVertexColor(r
, g
, b
, self
.glow_pct
*tex
.max_alpha
)
491 function icon
:OnEnter()
492 local list
= QuestHelper
:GetOverlapObjectives(self
.objective
)
493 self
:SetTooltip(list
)
494 self
.old_count
= #list
496 icon
.show_glow
= true
500 self
:SetScript("OnUpdate", self
.OnUpdate
)
503 function icon
:OnLeave()
504 QuestHelper
.tooltip
:Hide()
505 self
.show_glow
= false
509 function icon
:OnEvent(event
)
510 if self
.objective
and self
.objective
.pos
then
511 QuestHelper
.Astrolabe
:PlaceIconOnWorldMap(QuestHelper
.map_overlay
, self
, convertLocation(self
.objective
.pos
))
518 function icon
:OnClick()
519 if self
.objective
then
520 local menu
= QuestHelper
:CreateMenu()
521 local list
= QuestHelper
:GetOverlapObjectives(self
.objective
)
525 QuestHelper
:CreateMenuTitle(menu
, "Objectives")
527 for i
, o
in ipairs(list
) do
528 local submenu
= QuestHelper
:CreateMenu()
529 item
= QuestHelper
:CreateMenuItem(menu
, o
:Reason(true))
530 item
:SetSubmenu(submenu
)
531 item
:AddTexture(QuestHelper
:CreateIconTexture(item
, o
.icon_id
), true)
532 QuestHelper
:AddObjectiveOptionsToMenu(o
, submenu
)
535 QuestHelper
:CreateMenuTitle(menu
, self
.objective
:Reason(true))
536 QuestHelper
:AddObjectiveOptionsToMenu(self
.objective
, menu
)
543 icon
:SetScript("OnClick", icon
.OnClick
)
544 icon
:SetScript("OnEnter", icon
.OnEnter
)
545 icon
:SetScript("OnLeave", icon
.OnLeave
)
546 icon
:SetScript("OnEvent", icon
.OnEvent
)
548 icon
:RegisterForClicks("RightButtonUp")
550 icon
:RegisterEvent("WORLD_MAP_UPDATE")
552 icon
:SetObjective(objective
, index
)
557 local last_c
, last_z
, last_x
, last_y
, last_desc
559 function QuestHelper
:AddWaypointCallback(func
, ...)
560 local cb
= self
:CreateTable()
562 local len
= select("#", ...)
565 for i
= 1,len
do cb
[i
] = select(i
, ...) end
570 cb
[len
+5] = last_desc
571 func(unpack(cb
, 1, len
+5))
575 function QuestHelper
:RemoveWaypointCallback(cb
)
577 self
:ReleaseTable(cb
)
580 function QuestHelper
:InvokeWaypointCallbacks(c
, z
, x
, y
, desc
)
581 if c
~= last_c
or z
~= last_z
or x
~= last_x
or y
~= last_y
or desc
~= last_desc
then
582 last_c
, last_z
, last_x
, last_y
, last_desc
= c
, z
, x
, y
, desc
583 for cb
in pairs(callbacks
) do
590 cb
.func(unpack(cb
, 1, len
+5))
595 function QuestHelper
:CreateMipmapDodad()
596 local icon
= CreateFrame("Button", nil, Minimap
)
598 icon
.recalc_timeout
= 0
600 icon
.arrow
= CreateFrame("Model", nil, icon
)
601 icon
.arrow
:SetHeight(140.8)
602 icon
.arrow
:SetWidth(140.8)
603 icon
.arrow
:SetPoint("CENTER", Minimap
, "CENTER", 0, 0)
604 icon
.arrow
:SetModel("Interface\\Minimap\\Rotating-MinimapArrow.mdx")
608 icon
.target
= {0, 0, 0, 0}
611 icon
.bg
= QuestHelper
:CreateIconTexture(icon
, 16)
612 icon
.bg
:SetDrawLayer("BACKGROUND")
613 icon
.bg
:SetAllPoints()
615 function icon
:NextObjective()
616 for i
, o
in ipairs(QuestHelper
.route
) do
617 if not QuestHelper
.to_remove
[o
] and o
.pos
then
625 function icon
:OnUpdate(elapsed
)
626 if self
.objective
then
627 if not self
.objective
.pos
then
628 self
.objective
= self
:NextObjective()
629 if not self
.objective
then
637 if self
.recalc_timeout
== 0 then
638 self
.recalc_timeout
= 50
640 self
.objective
= self
:NextObjective()
642 if not self
.objective
then
647 local path
, travel_time
= QuestHelper
:ComputeRoute(QuestHelper
.pos
, self
.objective
.pos
)
648 local t
= self
.target
649 local id
= self
.objective
.icon_id
650 t
[1], t
[2], t
[3], t
[4] = convertLocation(self
.objective
.pos
)
653 self
.objective
.travel_time
= travel_time
656 if path
.g
> 10.0 then
660 t
[3] = path
.x
/ QuestHelper
.continent_scales_x
[path
.c
]
661 t
[4] = path
.y
/ QuestHelper
.continent_scales_y
[path
.c
]
662 t
[5] = path
.name
or "waypoint"
667 if not self
.dot
or id
~= self
.icon_id
then
669 if self
.dot
then QuestHelper
:ReleaseTexture(self
.dot
) end
670 self
.dot
= QuestHelper
:CreateIconTexture(self
, self
.icon_id
)
671 self
.dot
:SetPoint("TOPLEFT", icon
, "TOPLEFT", 2, -2)
672 self
.dot
:SetPoint("BOTTOMRIGHT", icon
, "BOTTOMRIGHT", -2, 2)
675 if UnitIsDeadOrGhost("player") then
676 QuestHelper
:InvokeWaypointCallbacks()
678 local reason
= (t
[5] and (QHFormat("WAYPOINT_REASON", t
[5]).."\n"..self
.objective
:Reason(true)))
679 or self
.objective
:Reason(true)
681 if QuestHelper
.c
== t
[1] then
682 -- Translate the position to the zone the player is standing in.
683 local c
, z
= QuestHelper
.c
, QuestHelper
.z
684 local x
, y
= QuestHelper
.Astrolabe
:TranslateWorldMapPosition(t
[1], t
[2], t
[3], t
[4], c
, z
)
685 QuestHelper
:InvokeWaypointCallbacks(c
, z
, x
, y
, reason
)
687 -- Try to find the nearest zone on the continent the objective is in.
688 local index
, distsqr
, x
, y
689 for z
, i
in pairs(QuestHelper_IndexLookup
[t
[1]]
) do
690 local _x
, _y
= QuestHelper
.Astrolabe
:TranslateWorldMapPosition(t
[1], t
[2], t
[3], t
[4], t
[1], z
)
691 local d
= (_x
-0.5)*(_x
-0.5)+(_y
-0.5)*(_y
-0.5)
692 if not index
or d
< distsqr
then
693 index
, distsqr
, x
, y
= i
, d
, _x
, _y
696 local c
, z
= QuestHelper_IndexLookup
[index
]
697 QuestHelper
:InvokeWaypointCallbacks(c
, z
, x
, y
, reason
)
701 QuestHelper
.Astrolabe
:PlaceIconOnMinimap(self
, unpack(self
.target
))
703 self
.recalc_timeout
= self
.recalc_timeout
- 1
706 local edge
= QuestHelper
.Astrolabe
:IsIconOnEdge(self
)
719 local angle
= QuestHelper
.Astrolabe
:GetDirectionToIcon(self
)
720 if GetCVar("rotateMinimap") == "1" then
721 angle
= angle
+ MiniMapCompassRing
:GetFacing()
724 self
.arrow
:SetFacing(angle
)
725 self
.arrow
:SetPosition(ofs
* (137 / 140) - radius
* math
.sin(angle
),
726 ofs
+ radius
* math
.cos(angle
), 0);
728 if self
.phase
> 6.283185307179586476925 then
729 self
.phase
= self
.phase
-6.283185307179586476925+elapsed
*3.5
731 self
.phase
= self
.phase
+elapsed
*3.5
733 self
.arrow
:SetModelScale(0.600000023841879+0.1*math
.sin(self
.phase
))
740 function icon
:SetObjective(objective
)
741 self
:SetHeight(20*QuestHelper_Pref
.scale
)
742 self
:SetWidth(20*QuestHelper_Pref
.scale
)
744 if objective
~= self
.objective
then
745 if objective
and not QuestHelper_Pref
.hide
then
748 QuestHelper
:InvokeWaypointCallbacks()
752 self
.objective
= objective
753 self
.recalc_timeout
= 0
757 function icon
:OnEnter()
758 if self
.objective
then
759 QuestHelper
.tooltip
:SetOwner(self
, "ANCHOR_CURSOR")
760 QuestHelper
.tooltip
:ClearLines()
762 if self
.target
[5] then
763 QuestHelper
.tooltip
:AddLine(QHFormat("WAYPOINT_REASON", self
.target
[5]), unpack(QuestHelper
:GetColourTheme().tooltip
))
764 QuestHelper
.tooltip
:GetPrevLines():SetFont(QuestHelper
.font
.serif
, 14)
767 QuestHelper
:AppendObjectiveToTooltip(self
.objective
)
768 QuestHelper
.tooltip
:Show()
772 function icon
:OnLeave()
773 QuestHelper
.tooltip
:Hide()
776 function icon
:OnClick()
777 if self
.objective
then
778 local menu
= QuestHelper
:CreateMenu()
779 QuestHelper
:CreateMenuTitle(menu
, self
.objective
:Reason(true))
780 QuestHelper
:AddObjectiveOptionsToMenu(self
.objective
, menu
)
785 function icon
:OnEvent()
786 if self
.objective
and self
.objective
.pos
then
793 icon
:SetScript("OnUpdate", icon
.OnUpdate
)
794 icon
:SetScript("OnEnter", icon
.OnEnter
)
795 icon
:SetScript("OnLeave", icon
.OnLeave
)
796 icon
:SetScript("OnEvent", icon
.OnEvent
)
797 icon
:SetScript("OnClick", icon
.OnClick
)
799 icon
:RegisterForClicks("RightButtonUp")
800 icon
:RegisterEvent("PLAYER_ENTERING_WORLD")