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, WorldMapButton
)
21 QuestHelper
.map_overlay
:SetFrameLevel(WorldMapButton
: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
, depth
)
264 local theme
= self
:GetColourTheme()
266 local indent
= (" "):rep(depth
or 0)
268 for user
, progress
in pairs(o
.progress
) do
269 table.insert(prog_sort_table
, user
)
272 table.sort(prog_sort_table
, function(a
, b
)
273 if o
.progress
[a
][3] < o
.progress
[b
][3] then
275 elseif o
.progress
[a
][3] == o
.progress
[b
][3] then
281 for i
, u
in ipairs(prog_sort_table
) do
282 tooltip
:AddDoubleLine(indent
..QHFormat("PEER_PROGRESS", u
),
283 self
:ProgressString(o
.progress
[u
][1].."/"..o
.progress
[u
][2],
284 o
.progress
[u
][3]), unpack(theme
.tooltip
))
287 local last
, name
= tooltip
:NumLines(), tooltip
:GetName()
288 local left
, right
= _G
[name
.."TextLeft"..last
], _G
[name
.."TextRight"..last
]
290 left
:SetFont(font
, 13)
291 right
:SetFont(font
, 13)
295 while table.remove(prog_sort_table
) do end
299 function QuestHelper
:AppendObjectiveToTooltip(o
)
300 local theme
= self
:GetColourTheme()
302 self
.tooltip
:AddLine(o
:Reason(), unpack(theme
.tooltip
))
303 self
.tooltip
:GetPrevLines():SetFont(self
.font
.serif
, 14)
305 self
:AppendObjectiveProgressToTooltip(o
, self
.tooltip
, QuestHelper
.font
.sans
)
307 self
.tooltip
:AddDoubleLine(QHText("TRAVEL_ESTIMATE"), QHFormat("TRAVEL_ESTIMATE_VALUE", o
.travel_time
or 0), unpack(theme
.tooltip
))
308 self
.tooltip
:GetPrevLines():SetFont(self
.font
.sans
, 11)
309 select(2, self
.tooltip
:GetPrevLines()):SetFont(self
.font
.sans
, 11)
312 function QuestHelper
:CreateWorldMapDodad(objective
, index
)
313 local icon
= CreateFrame("Button", nil, QuestHelper
.map_overlay
)
314 icon
:SetFrameStrata("FULLSCREEN")
316 function icon
:SetTooltip(list
)
317 QuestHelper
.tooltip
:SetOwner(self
, "ANCHOR_CURSOR")
318 QuestHelper
.tooltip
:ClearLines()
322 for i
, o
in ipairs(list
) do
326 QuestHelper
.tooltip
:AddLine("|c80ff0000 . . . . . .|r")
327 QuestHelper
.tooltip
:GetPrevLines():SetFont(QuestHelper
.font
.sans
, 8)
330 QuestHelper
:AppendObjectiveToTooltip(o
)
333 QuestHelper
.tooltip
:Show()
336 function icon
:SetObjective(objective
, i
)
337 self
:SetHeight(20*QuestHelper_Pref
.scale
)
338 self
:SetWidth(20*QuestHelper_Pref
.scale
)
341 QuestHelper
:ReleaseTexture(self
.dot
)
346 QuestHelper
:ReleaseTexture(self
.bg
)
351 self
.objective
= objective
355 -- if it's the very next objective, give it the green background
356 self
.bg
= QuestHelper
:CreateIconTexture(self
, 13)
357 elseif objective
.filter_blocked
then
358 -- if there are still prerequisites, make it grey
359 -- filter_blocked is updated by [Add|Remove]ObjectiveWatch and ObjectiveObjectDependsOn,
360 -- and will be true if there are other objectives that need to be completed before this one.
361 self
.bg
= QuestHelper
:CreateIconTexture(self
, 16)
363 -- otherwise give it the background selected by the objective
364 self
.bg
= QuestHelper
:CreateIconTexture(self
, objective
.icon_bg
)
367 self
.dot
= QuestHelper
:CreateIconTexture(self
, objective
.icon_id
)
369 self
.bg
:SetDrawLayer("BACKGROUND")
370 self
.bg
:SetAllPoints()
371 self
.dot
:SetPoint("TOPLEFT", self
, "TOPLEFT", 3*QuestHelper_Pref
.scale
, -3*QuestHelper_Pref
.scale
)
372 self
.dot
:SetPoint("BOTTOMRIGHT", self
, "BOTTOMRIGHT", -3*QuestHelper_Pref
.scale
, 3*QuestHelper_Pref
.scale
)
374 QuestHelper
.Astrolabe
:PlaceIconOnWorldMap(QuestHelper
.map_overlay
, self
, convertLocation(objective
.pos
))
381 function icon
:SetGlow(list
)
382 local w
, h
= QuestHelper
.map_overlay
:GetWidth(), QuestHelper
.map_overlay
:GetHeight()
383 local c
, z
= GetCurrentMapContinent(), GetCurrentMapZone()
384 local _
, x_size
, y_size
= QuestHelper
.Astrolabe
:ComputeDistance(c
, z
, 0.25, 0.25, c
, z
, 0.75, 0.75)
386 x_size
= math
.max(25, 200 / x_size
* w
)
387 y_size
= math
.max(25, 200 / y_size
* h
)
390 for _
, objective
in ipairs(list
) do
391 if objective
.p
then for _
, list
in pairs(objective
.p
) do
392 for _
, p
in ipairs(list
) do
393 local x
, y
= p
[3], p
[4]
394 x
, y
= x
/ QuestHelper
.continent_scales_x
[p
[1].c
], y
/ QuestHelper
.continent_scales_y
[p
[1].c
]
395 x
, y
= QuestHelper
.Astrolabe
:TranslateWorldMapPosition(p
[1].c
, 0, x
, y
, c
, z
)
396 if x
and y
and x
> 0 and y
> 0 and x
< 1 and y
< 1 then
397 if not self
.glow_list
then
398 self
.glow_list
= QuestHelper
:CreateTable()
401 tex
= self
.glow_list
[out
]
403 tex
= QuestHelper
:CreateGlowTexture(self
)
404 table.insert(self
.glow_list
, tex
)
408 tex
:SetPoint("CENTER", QuestHelper
.map_overlay
, "TOPLEFT", x
*w
, -y
*h
)
409 tex
:SetVertexColor(1,1,1,0)
411 tex
:SetHeight(y_size
)
413 tex
.max_alpha
= 1/p
[5]
419 if self
.glow_list
then
420 for i
= out
,#self
.glow_list
do
421 QuestHelper
:ReleaseTexture(table.remove(self
.glow_list
))
424 if #self
.glow_list
== 0 then
425 QuestHelper
:ReleaseTable(self
.glow_list
)
431 icon
.show_glow
= false
436 function icon
:OnUpdate(elapsed
)
437 self
.phase
= (self
.phase
+ elapsed
)%6.283185307179586476925286766559005768394338798750211641949889185
439 if self
.old_count
> 0 then
440 local list
= QuestHelper
:GetOverlapObjectives(self
.objective
)
441 if #list
~= self
.old_count
then
442 self
:SetTooltip(list
)
443 self
.old_count
= #list
448 if self
.show_glow
then
449 self
.glow_pct
= math
.min(1, self
.glow_pct
+elapsed
*1.5)
451 self
.glow_pct
= math
.max(0, self
.glow_pct
-elapsed
*0.5)
453 if self
.glow_pct
== 0 then
454 if self
.glow_list
then
455 while #self
.glow_list
> 0 do
456 QuestHelper
:ReleaseTexture(table.remove(self
.glow_list
))
458 QuestHelper
:ReleaseTable(self
.glow_list
)
462 self
:SetScript("OnUpdate", nil)
467 if self
.glow_list
then
468 -- You know, these numbers are harmonics of pi. Would SETI detected them, or would they just be seen as noise?
469 -- I'd vote for the later.
471 -- Pi - circumference over diameter - when was the last time you actually cared about diameters in math?
473 -- Pretty much everything in computer geometry depends on the pythagorean theorem, which you can use for
474 -- circles, spheres, and hyper-spheres, if you use radius.
476 -- It's even the basis of special relativity, with time being multiplied by c so that you get a distance
477 -- that you can use with the spatial dimensions. We're all in agreement that space traveling aliens are
478 -- going to know about relativity, right?
480 -- And if you ever do trig, a full circle would be exactly (circumference over radius) radians instead of
481 -- (circumference over diameter)*2 radians.
483 -- Obviously aliens are much more likely to prefer 6.283185307179586... as constant than our pi.
485 -- Important update: I just noticed that large factorials can be approximated using (2*pi*n)^.5*(n/e)^n
486 -- There's that 2 times pi thing again.
487 local r
, g
, b
= math
.sin(self
.phase
)*0.25+0.75,
488 math
.sin(self
.phase
+2.094395102393195492308428922186335256131446266250070547316629728)*0.25+0.75,
489 math
.sin(self
.phase
+4.188790204786390984616857844372670512262892532500141094633259456)*0.25+0.75
491 for i
, tex
in ipairs(self
.glow_list
) do
492 tex
:SetVertexColor(r
, g
, b
, self
.glow_pct
*tex
.max_alpha
)
497 function icon
:OnEnter()
498 local list
= QuestHelper
:GetOverlapObjectives(self
.objective
)
499 self
:SetTooltip(list
)
500 self
.old_count
= #list
502 icon
.show_glow
= true
506 self
:SetScript("OnUpdate", self
.OnUpdate
)
509 function icon
:OnLeave()
510 QuestHelper
.tooltip
:Hide()
511 self
.show_glow
= false
515 function icon
:OnEvent(event
)
516 if self
.objective
and self
.objective
.pos
then
517 QuestHelper
.Astrolabe
:PlaceIconOnWorldMap(QuestHelper
.map_overlay
, self
, convertLocation(self
.objective
.pos
))
524 function icon
:OnClick()
525 if self
.objective
then
526 local menu
= QuestHelper
:CreateMenu()
527 local list
= QuestHelper
:GetOverlapObjectives(self
.objective
)
531 QuestHelper
:CreateMenuTitle(menu
, "Objectives")
533 for i
, o
in ipairs(list
) do
534 local submenu
= QuestHelper
:CreateMenu()
535 item
= QuestHelper
:CreateMenuItem(menu
, o
:Reason(true))
536 item
:SetSubmenu(submenu
)
537 item
:AddTexture(QuestHelper
:CreateIconTexture(item
, o
.icon_id
), true)
538 QuestHelper
:AddObjectiveOptionsToMenu(o
, submenu
)
541 QuestHelper
:CreateMenuTitle(menu
, self
.objective
:Reason(true))
542 QuestHelper
:AddObjectiveOptionsToMenu(self
.objective
, menu
)
549 icon
:SetScript("OnClick", icon
.OnClick
)
550 icon
:SetScript("OnEnter", icon
.OnEnter
)
551 icon
:SetScript("OnLeave", icon
.OnLeave
)
552 icon
:SetScript("OnEvent", icon
.OnEvent
)
554 icon
:RegisterForClicks("RightButtonUp")
556 icon
:RegisterEvent("WORLD_MAP_UPDATE")
558 icon
:SetObjective(objective
, index
)
563 local last_c
, last_z
, last_x
, last_y
, last_desc
565 function QuestHelper
:AddWaypointCallback(func
, ...)
566 local cb
= self
:CreateTable()
568 local len
= select("#", ...)
571 for i
= 1,len
do cb
[i
] = select(i
, ...) end
576 cb
[len
+5] = last_desc
577 func(unpack(cb
, 1, len
+5))
581 function QuestHelper
:RemoveWaypointCallback(cb
)
583 self
:ReleaseTable(cb
)
586 function QuestHelper
:InvokeWaypointCallbacks(c
, z
, x
, y
, desc
)
587 if c
~= last_c
or z
~= last_z
or x
~= last_x
or y
~= last_y
or desc
~= last_desc
then
588 last_c
, last_z
, last_x
, last_y
, last_desc
= c
, z
, x
, y
, desc
589 for cb
in pairs(callbacks
) do
596 cb
.func(unpack(cb
, 1, len
+5))
601 function QuestHelper
:CreateMipmapDodad()
602 local icon
= CreateFrame("Button", nil, Minimap
)
604 icon
.recalc_timeout
= 0
606 icon
.arrow
= CreateFrame("Model", nil, icon
)
607 icon
.arrow
:SetHeight(140.8)
608 icon
.arrow
:SetWidth(140.8)
609 icon
.arrow
:SetPoint("CENTER", Minimap
, "CENTER", 0, 0)
610 icon
.arrow
:SetModel("Interface\\Minimap\\Rotating-MinimapArrow.mdx")
614 icon
.target
= {0, 0, 0, 0}
617 icon
.bg
= QuestHelper
:CreateIconTexture(icon
, 16)
618 icon
.bg
:SetDrawLayer("BACKGROUND")
619 icon
.bg
:SetAllPoints()
621 function icon
:NextObjective()
622 for i
, o
in ipairs(QuestHelper
.route
) do
623 if not QuestHelper
.to_remove
[o
] and o
.pos
then
631 function icon
:OnUpdate(elapsed
)
632 if self
.objective
then
633 if not self
.objective
.pos
then
634 self
.objective
= self
:NextObjective()
635 if not self
.objective
then
643 if self
.recalc_timeout
== 0 and not QuestHelper
.graph_in_limbo
then
644 self
.recalc_timeout
= 50
646 self
.objective
= self
:NextObjective()
648 if not self
.objective
then
653 local path
, travel_time
= QuestHelper
:ComputeRoute(QuestHelper
.pos
, self
.objective
.pos
)
654 local t
= self
.target
655 local id
= self
.objective
.icon_id
656 t
[1], t
[2], t
[3], t
[4] = convertLocation(self
.objective
.pos
)
659 self
.objective
.travel_time
= travel_time
662 if path
.g
> 10.0 then
666 t
[3] = path
.x
/ QuestHelper
.continent_scales_x
[path
.c
]
667 t
[4] = path
.y
/ QuestHelper
.continent_scales_y
[path
.c
]
668 t
[5] = path
.name
or "waypoint"
673 if not self
.dot
or id
~= self
.icon_id
then
675 if self
.dot
then QuestHelper
:ReleaseTexture(self
.dot
) end
676 self
.dot
= QuestHelper
:CreateIconTexture(self
, self
.icon_id
)
677 self
.dot
:SetPoint("TOPLEFT", icon
, "TOPLEFT", 2, -2)
678 self
.dot
:SetPoint("BOTTOMRIGHT", icon
, "BOTTOMRIGHT", -2, 2)
681 if UnitIsDeadOrGhost("player") then
682 QuestHelper
:InvokeWaypointCallbacks()
684 local reason
= (t
[5] and (QHFormat("WAYPOINT_REASON", t
[5]).."\n"..self
.objective
:Reason(true)))
685 or self
.objective
:Reason(true)
687 if QuestHelper
.c
== t
[1] then
688 -- Translate the position to the zone the player is standing in.
689 local c
, z
= QuestHelper
.c
, QuestHelper
.z
690 local x
, y
= QuestHelper
.Astrolabe
:TranslateWorldMapPosition(t
[1], t
[2], t
[3], t
[4], c
, z
)
691 QuestHelper
:InvokeWaypointCallbacks(c
, z
, x
, y
, reason
)
693 -- Try to find the nearest zone on the continent the objective is in.
694 local index
, distsqr
, x
, y
695 for z
, i
in pairs(QuestHelper_IndexLookup
[t
[1]]
) do
696 local _x
, _y
= QuestHelper
.Astrolabe
:TranslateWorldMapPosition(t
[1], t
[2], t
[3], t
[4], t
[1], z
)
697 local d
= (_x
-0.5)*(_x
-0.5)+(_y
-0.5)*(_y
-0.5)
698 if not index
or d
< distsqr
then
699 index
, distsqr
, x
, y
= i
, d
, _x
, _y
702 local c
, z
= QuestHelper_IndexLookup
[index
]
703 QuestHelper
:InvokeWaypointCallbacks(c
, z
, x
, y
, reason
)
707 QuestHelper
.Astrolabe
:PlaceIconOnMinimap(self
, unpack(self
.target
))
709 self
.recalc_timeout
= self
.recalc_timeout
- 1
712 local edge
= QuestHelper
.Astrolabe
:IsIconOnEdge(self
)
725 local angle
= QuestHelper
.Astrolabe
:GetDirectionToIcon(self
)
726 if GetCVar("rotateMinimap") == "1" then
727 angle
= angle
+ MiniMapCompassRing
:GetFacing()
730 self
.arrow
:SetFacing(angle
)
731 self
.arrow
:SetPosition(ofs
* (137 / 140) - radius
* math
.sin(angle
),
732 ofs
+ radius
* math
.cos(angle
), 0);
734 if self
.phase
> 6.283185307179586476925 then
735 self
.phase
= self
.phase
-6.283185307179586476925+elapsed
*3.5
737 self
.phase
= self
.phase
+elapsed
*3.5
739 self
.arrow
:SetModelScale(0.600000023841879+0.1*math
.sin(self
.phase
))
746 function icon
:SetObjective(objective
)
747 self
:SetHeight(20*QuestHelper_Pref
.scale
)
748 self
:SetWidth(20*QuestHelper_Pref
.scale
)
750 if objective
~= self
.objective
then
751 if objective
and not QuestHelper_Pref
.hide
then
754 QuestHelper
:InvokeWaypointCallbacks()
758 self
.objective
= objective
759 self
.recalc_timeout
= 0
763 function icon
:OnEnter()
764 if self
.objective
then
765 QuestHelper
.tooltip
:SetOwner(self
, "ANCHOR_CURSOR")
766 QuestHelper
.tooltip
:ClearLines()
768 if self
.target
[5] then
769 QuestHelper
.tooltip
:AddLine(QHFormat("WAYPOINT_REASON", self
.target
[5]), unpack(QuestHelper
:GetColourTheme().tooltip
))
770 QuestHelper
.tooltip
:GetPrevLines():SetFont(QuestHelper
.font
.serif
, 14)
773 QuestHelper
:AppendObjectiveToTooltip(self
.objective
)
774 QuestHelper
.tooltip
:Show()
778 function icon
:OnLeave()
779 QuestHelper
.tooltip
:Hide()
782 function icon
:OnClick()
783 if self
.objective
then
784 local menu
= QuestHelper
:CreateMenu()
785 QuestHelper
:CreateMenuTitle(menu
, self
.objective
:Reason(true))
786 QuestHelper
:AddObjectiveOptionsToMenu(self
.objective
, menu
)
791 function icon
:OnEvent()
792 if self
.objective
and self
.objective
.pos
then
799 icon
:SetScript("OnUpdate", icon
.OnUpdate
)
800 icon
:SetScript("OnEnter", icon
.OnEnter
)
801 icon
:SetScript("OnLeave", icon
.OnLeave
)
802 icon
:SetScript("OnEvent", icon
.OnEvent
)
803 icon
:SetScript("OnClick", icon
.OnClick
)
805 icon
:RegisterForClicks("RightButtonUp")
806 icon
:RegisterEvent("PLAYER_ENTERING_WORLD")