-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathWorldQuestTracker_Tracker.lua
1676 lines (1414 loc) · 62.4 KB
/
WorldQuestTracker_Tracker.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
local addonId, wqtInternal = ...
--world quest tracker object
local WorldQuestTracker = WorldQuestTrackerAddon
if (not WorldQuestTracker) then
return
end
--framework
local DF = _G ["DetailsFramework"]
if (not DF) then
print ("|cFFFFAA00World Quest Tracker: framework not found, if you just installed or updated the addon, please restart your client.|r")
return
end
--localization
local L = DF.Language.GetLanguageTable(addonId)
local ff = WorldQuestTrackerFinderFrame
local _
local p = math.pi/2
local pi = math.pi
local pipi = math.pi*2
local GetPlayerFacing = GetPlayerFacing
local GetNumQuestLogRewardCurrencies = WorldQuestTrackerAddon.GetNumQuestLogRewardCurrencies
local GetQuestLogRewardInfo = GetQuestLogRewardInfo
local GetQuestLogRewardCurrencyInfo = WorldQuestTrackerAddon.GetQuestLogRewardCurrencyInfo
local GetQuestLogRewardMoney = GetQuestLogRewardMoney
local GetNumQuestLogRewards = GetNumQuestLogRewards
local GetQuestInfoByQuestID = C_TaskQuest.GetQuestInfoByQuestID
local MapRangeClamped = DF.MapRangeClamped
local FindLookAtRotation = DF.FindLookAtRotation
local GetDistance_Point = DF.GetDistance_Point
local LibWindow = LibStub ("LibWindow-1.1")
if (not LibWindow) then
print ("|cFFFFAA00World Quest Tracker|r: libwindow not found, did you just updated the addon? try reopening the client.|r")
end
----------------------------------------------------------------------------------------------------------------------------------------------------------------
--> tracker quest --~tracker
local TRACKER_TITLE_TEXT_SIZE_INMAP = 12
local TRACKER_TITLE_TEXT_SIZE_OUTMAP = 10
local TRACKER_TITLE_TEXTWIDTH_MAX = 160
local TRACKER_ARROW_ALPHA_MAX = 1
local TRACKER_ARROW_ALPHA_MIN = .75
local TRACKER_BACKGROUND_ALPHA_MIN = .35
local TRACKER_BACKGROUND_ALPHA_MAX = .75
local TRACKER_FRAME_ALPHA_INMAP = 1
local TRACKER_FRAME_ALPHA_OUTMAP = .75
local worldFramePOIs = WorldQuestTrackerWorldMapPOI
--verifica se a quest ja esta na lista de track
function WorldQuestTracker.IsQuestBeingTracked (questID)
for _, quest in ipairs (WorldQuestTracker.QuestTrackList) do
if (quest.questID == questID) then
return true
end
end
return
end
function WorldQuestTracker.SetTomTomQuestToTrack(questID)
local uid = WorldQuestTracker.TomTomUIDs[questID]
if (uid) then
TomTom:SetCrazyArrow(uid, TomTom.profile.arrow.arrival, uid.title)
TomTom:ShowHideCrazyArrow()
end
end
function WorldQuestTracker.AddQuestTomTom (questID, mapID, noRemove)
local x, y = C_TaskQuest.GetQuestLocation (questID, mapID)
local title, factionID, tagID, tagName, worldQuestType, rarity, isElite, tradeskillLineIndex = WorldQuestTracker.GetQuest_Info (questID)
local alreadyExists = TomTom:WaypointExists (mapID, x, y, title)
if (alreadyExists and WorldQuestTracker.TomTomUIDs [questID]) then
if (noRemove) then
return
end
TomTom:RemoveWaypoint (WorldQuestTracker.TomTomUIDs [questID])
WorldQuestTracker.TomTomUIDs [questID] = nil
return
end
if (not alreadyExists) then
local uid = TomTom:AddWaypoint (mapID, x, y, {title = title, persistent=false})
WorldQuestTracker.TomTomUIDs [questID] = uid
end
return
end
--adiciona uma quest ao tracker
function WorldQuestTracker.AddQuestToTracker(self, questID, mapID)
questID = self.questID or questID
if (not HaveQuestData (questID)) then
WorldQuestTracker:Msg (L["S_ERROR_NOTLOADEDYET"])
return
end
if (WorldQuestTracker.IsQuestBeingTracked (questID)) then
return
end
if (WorldQuestTracker.db.profile.tomtom.enabled and TomTom and C_AddOns.IsAddOnLoaded("TomTom")) then
WorldQuestTracker.AddQuestTomTom (self.questID, self.mapID or mapID)
--return true
end
local timeLeft = WorldQuestTracker.GetQuest_TimeLeft (questID)
if (timeLeft and timeLeft > 0) then
local mapID = self.mapID
local iconTexture = self.IconTexture
local iconText = self.IconText
local questType = self.QuestType
local numObjectives = self.numObjectives
local conduitType, _, conduitBorderColor = WorldQuestTracker.GetConduitQuestData(questID)
if (iconTexture) then
tinsert (WorldQuestTracker.QuestTrackList, {
questID = questID,
mapID = mapID,
mapIDSynthetic = WorldQuestTracker.db.profile.syntheticMapIdList [mapID] or 0,
timeAdded = time(),
timeFraction = GetTime(),
timeLeft = timeLeft,
expireAt = time() + (timeLeft*60),
rewardTexture = iconTexture,
rewardAmount = iconText,
index = #WorldQuestTracker.QuestTrackList,
questType = questType,
numObjectives = numObjectives,
conduitType = conduitType,
conduitBorderColor = conduitBorderColor,
})
WorldQuestTracker.JustAddedToTracker [questID] = true
else
WorldQuestTracker:Msg (L["S_ERROR_NOTLOADEDYET"])
end
--atualiza os widgets para adicionar a quest no frame do tracker
WorldQuestTracker.RefreshTrackerWidgets()
else
WorldQuestTracker:Msg (L["S_ERROR_NOTIMELEFT"])
end
end
--remove uma quest que ja esta no tracker
--quando o addon iniciar e fazer a primeira chacagem de quests desatualizadas, mandar noUpdate = true
function WorldQuestTracker.RemoveQuestFromTracker (questID, noUpdate)
for index, quest in ipairs (WorldQuestTracker.QuestTrackList) do
if (quest.questID == questID) then
--remove da tabela
tremove (WorldQuestTracker.QuestTrackList, index)
--atualiza os widgets para remover a quest do frame do tracker
if (not noUpdate) then
WorldQuestTracker.RefreshTrackerWidgets()
end
return true
end
end
end
--remove todas as quests do tracker
function WorldQuestTracker.RemoveAllQuestsFromTracker()
local isShowingWorld = WorldQuestTrackerAddon.GetCurrentZoneType() == "world"
for i = #WorldQuestTracker.QuestTrackList, 1, -1 do
--get the quest table with info about the quest
local quest = WorldQuestTracker.QuestTrackList [i]
--remove the quest from the tracker
tremove (WorldQuestTracker.QuestTrackList, i)
--remove tracking indicator on the quest icon
local questID = quest.questID
if (isShowingWorld) then
--quest locations
for _, widget in pairs (WorldQuestTracker.WorldMapSmallWidgets) do
if (widget:IsShown() and widget.questID == questID) then
widget.onEndTrackAnimation:Play()
end
end
--quest summary
for _, summarySquare in pairs (WorldQuestTracker.WorldSummaryQuestsSquares) do
if (summarySquare:IsShown() and summarySquare.questID == questID) then
summarySquare.onEndTrackAnimation:Play()
end
end
else
--zone map widgets
for _, widget in pairs (WorldQuestTracker.ZoneWidgetPool) do
if (widget:IsShown() and widget.questID == questID) then
widget.onEndTrackAnimation:Play()
end
end
end
end
WorldQuestTracker.RefreshTrackerWidgets()
end
--o cliente n�o tem o tempo restante da quest na primeira execu��o
function WorldQuestTracker.CheckTimeLeftOnQuestsFromTracker_Load()
for i = #WorldQuestTracker.QuestTrackList, 1, -1 do
local quest = WorldQuestTracker.QuestTrackList [i]
--if (HaveQuestData (quest.questID)) then
local timeLeft = WorldQuestTracker.GetQuest_TimeLeft (quest.questID)
--end
end
end
--verifica o tempo restante de cada quest no tracker e a remove se o tempo estiver terminado
function WorldQuestTracker.CheckTimeLeftOnQuestsFromTracker()
local now = time()
local gotRemoval
for i = #WorldQuestTracker.QuestTrackList, 1, -1 do
local quest = WorldQuestTracker.QuestTrackList [i]
local timeLeft = WorldQuestTracker.GetQuest_TimeLeft (quest.questID)
if (quest.expireAt < now or not timeLeft or timeLeft <= 0) then -- or not allQuests [quest.questID]
WorldQuestTracker.RemoveQuestFromTracker (quest.questID, true)
gotRemoval = true
end
end
if (gotRemoval) then
WorldQuestTracker.RefreshTrackerWidgets()
end
end
--organiza as quest para as quests do mapa atual serem jogadas para cima
local Sort_currentMapID = 0
local Sort_QuestsOnTracker = function(t1, t2)
if (t1.mapID == Sort_currentMapID and t2.mapID == Sort_currentMapID) then
return t1.LastDistance > t2.LastDistance
--return t1.timeFraction > t2.timeFraction
elseif (t1.mapID == Sort_currentMapID) then
return true
elseif (t2.mapID == Sort_currentMapID) then
return false
else
if (t1.mapIDSynthetic == t2.mapIDSynthetic) then
return t1.timeFraction > t2.timeFraction
else
return t1.mapIDSynthetic > t2.mapIDSynthetic
end
end
end
--poe as quests em ordem de acordo com o mapa atual do jogador?
function WorldQuestTracker.ReorderQuestsOnTracker()
--joga as quests do mapa atual pra cima
Sort_currentMapID = WorldQuestTracker.GetCurrentStandingMapAreaID()
-- if (Sort_currentMapID == 1080 or Sort_currentMapID == 1072) then
-- --Thunder Totem or Trueshot Lodge
-- Sort_currentMapID = 1024
-- end
for index, quest in ipairs (WorldQuestTracker.QuestTrackList) do
quest.LastDistance = quest.LastDistance or 0
end
table.sort (WorldQuestTracker.QuestTrackList, Sort_QuestsOnTracker)
end
--~trackerframe
--this is the main frame for the quest tracker, every thing on the tracker is parent of this frame
local WorldQuestTrackerFrame = CreateFrame("frame", "WorldQuestTrackerScreenPanel", UIParent, "BackdropTemplate")
WorldQuestTrackerFrame:SetSize(235, 500)
WorldQuestTrackerFrame:SetFrameStrata("LOW") --thanks @p3lim on curseforge
function WorldQuestTracker.TrackerFrameOnInit()
LibWindow.RegisterConfig(WorldQuestTrackerScreenPanel, WorldQuestTracker.db.profile)
WorldQuestTrackerScreenPanel.RegisteredForLibWindow = true
LibWindow.MakeDraggable(WorldQuestTrackerScreenPanel)
if (not WorldQuestTracker.db.profile.tracker_attach_to_questlog) then
LibWindow.RestorePosition(WorldQuestTrackerScreenPanel)
end
WorldQuestTracker.RefreshTrackerAnchor()
end
local WorldQuestTrackerFrame_QuestHolder = CreateFrame ("frame", "WorldQuestTrackerScreenPanel_QuestHolder", WorldQuestTrackerFrame, "BackdropTemplate")
WorldQuestTrackerFrame_QuestHolder:SetAllPoints()
WorldQuestTrackerFrame_QuestHolder:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16})
WorldQuestTrackerFrame_QuestHolder.MoveMeLabel = WorldQuestTracker:CreateLabel (WorldQuestTrackerFrame_QuestHolder, "== Move Me ==")
local lock_window = function()
WorldQuestTracker.db.profile.tracker_is_locked = true
WorldQuestTracker.RefreshTrackerAnchor()
end
WorldQuestTrackerFrame_QuestHolder.LockButton = WorldQuestTracker:CreateButton (WorldQuestTrackerFrame_QuestHolder, lock_window, 120, 24, "Lock Window", nil, nil, nil, nil, "WorldQuestTrackerLockTrackerButton", nil, WorldQuestTracker:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE"))
WorldQuestTrackerFrame_QuestHolder.MoveMeLabel:SetPoint("center", 0, 3)
WorldQuestTrackerFrame_QuestHolder.LockButton:SetPoint("center", 0, -16)
WorldQuestTrackerFrame_QuestHolder.MoveMeLabel:Hide()
WorldQuestTrackerFrame_QuestHolder.LockButton:Hide()
function WorldQuestTracker.UpdateTrackerScale()
WorldQuestTrackerFrame:SetScale (WorldQuestTracker.db.profile.tracker_scale)
--WorldQuestTrackerFrame_QuestHolder:SetScale (WorldQuestTracker.db.profile.tracker_scale) --aumenta s� as quests sem mexer no cabe�alho
end
--cria o header
local WorldQuestTrackerHeader = CreateFrame ("frame", "WorldQuestTrackerQuestsHeader", WorldQuestTrackerFrame, "ObjectiveTrackerContainerHeaderTemplate") -- "ObjectiveTrackerHeaderTemplate"
WorldQuestTrackerHeader.Text:SetText ("World Quest Tracker")
local minimizeButton = CreateFrame ("button", "WorldQuestTrackerQuestsHeaderMinimizeButton", WorldQuestTrackerFrame, "BackdropTemplate")
local minimizeButtonText = minimizeButton:CreateFontString (nil, "overlay", "GameFontNormal")
--hide the default minimize button from the blizz template
WorldQuestTrackerHeader.MinimizeButton:Hide()
minimizeButtonText:SetText (L["S_WORLDQUESTS"])
minimizeButtonText:SetPoint("right", minimizeButton, "left", -3, 1)
minimizeButtonText:Hide()
WorldQuestTrackerFrame.MinimizeButton = minimizeButton
minimizeButton:SetSize(16, 16)
minimizeButton:SetPoint("topright", WorldQuestTrackerHeader, "topright", 0, -4)
minimizeButton:SetScript("OnClick", function()
if (WorldQuestTrackerFrame.collapsed) then
WorldQuestTrackerFrame.collapsed = false
minimizeButton:GetNormalTexture():SetTexCoord(0, 0.5, 0.5, 1)
minimizeButton:GetPushedTexture():SetTexCoord(0.5, 1, 0.5, 1)
WorldQuestTrackerFrame_QuestHolder:Show()
WorldQuestTrackerHeader:Show()
minimizeButtonText:Hide()
else
WorldQuestTrackerFrame.collapsed = true
minimizeButton:GetNormalTexture():SetTexCoord(0, 0.5, 0, 0.5)
minimizeButton:GetPushedTexture():SetTexCoord(0.5, 1, 0, 0.5)
WorldQuestTrackerFrame_QuestHolder:Hide()
WorldQuestTrackerHeader:Hide()
minimizeButtonText:Show()
minimizeButtonText:SetText ("World Quest Tracker")
end
end)
minimizeButton:SetNormalTexture ([[Interface\Buttons\UI-Panel-QuestHideButton]])
minimizeButton:GetNormalTexture():SetTexCoord(0, 0.5, 0.5, 1)
minimizeButton:SetPushedTexture ([[Interface\Buttons\UI-Panel-QuestHideButton]])
minimizeButton:GetPushedTexture():SetTexCoord(0.5, 1, 0.5, 1)
minimizeButton:SetHighlightTexture ([[Interface\Buttons\UI-Panel-MinimizeButton-Highlight]])
minimizeButton:SetDisabledTexture ([[Interface\Buttons\UI-Panel-QuestHideButton-disabled]])
--store the created widgets on a table
local TrackerWidgetPool = {}
--height of the quest tracker
WorldQuestTracker.TrackerHeight = 0
--refresh the tracker positioning
function WorldQuestTracker.RefreshTrackerAnchor()
--if not using the tracker, hide it and return
if (not WorldQuestTracker.db.profile.use_tracker) then
WorldQuestTrackerScreenPanel:Hide()
return
end
--automatic calculate the tracker position based on the objective tracker
--when attached to the objective tracker, it'll ignore the locked setting
--also on automatic it should never save the position in the libwindow
if (WorldQuestTracker.db.profile.tracker_attach_to_questlog) then
WorldQuestTrackerScreenPanel:EnableMouse(false)
WorldQuestTrackerScreenPanel:ClearAllPoints()
for i = 1, ObjectiveTrackerFrame:GetNumPoints() do
local point, relativeTo, relativePoint, xOfs, yOfs = ObjectiveTrackerFrame:GetPoint (i)
WorldQuestTrackerScreenPanel:SetPoint(point, relativeTo, relativePoint, -10 + xOfs, yOfs - WorldQuestTracker.TrackerHeight - 20)
end
if (WorldQuestTracker.TrackerAttachToModule) then
WorldQuestTrackerScreenPanel:ClearAllPoints()
WorldQuestTrackerScreenPanel:SetPoint("top", WorldQuestTracker.TrackerAttachToModule.Header, "bottom", 0, -WorldQuestTracker.TrackerHeight + 10)
end
WorldQuestTrackerHeader:ClearAllPoints()
WorldQuestTrackerHeader:SetPoint("bottom", WorldQuestTrackerFrame, "top", 0, -20)
--hide the unlocked widgets
WorldQuestTrackerFrame_QuestHolder.LockButton:Hide()
WorldQuestTrackerFrame_QuestHolder.MoveMeLabel:Hide()
WorldQuestTrackerFrame_QuestHolder:SetBackdrop(nil)
WorldQuestTrackerScreenPanel:Show()
else
if (not WorldQuestTracker.db.profile.tracker_is_locked) then
WorldQuestTrackerScreenPanel:EnableMouse(true)
--show the unlocked widgets
WorldQuestTrackerFrame_QuestHolder:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16})
WorldQuestTrackerFrame_QuestHolder:SetBackdropColor(0, 0, 0, 0.75)
WorldQuestTrackerFrame_QuestHolder.LockButton:Show()
WorldQuestTrackerFrame_QuestHolder.MoveMeLabel:Show()
else
WorldQuestTrackerScreenPanel:EnableMouse(false)
--hide the unlocked widgets
WorldQuestTrackerFrame_QuestHolder.LockButton:Hide()
WorldQuestTrackerFrame_QuestHolder.MoveMeLabel:Hide()
WorldQuestTrackerFrame_QuestHolder:SetBackdrop(nil)
end
LibWindow.RestorePosition(WorldQuestTrackerScreenPanel)
WorldQuestTrackerHeader:ClearAllPoints()
WorldQuestTrackerHeader:SetPoint("bottom", WorldQuestTrackerFrame, "top", 0, -20)
WorldQuestTrackerScreenPanel:Show()
end
end
local TrackerIconButtonOnClick = function(self, button)
if (button == "MiddleButton") then
--was middle button and our group finder is enabled
if (WorldQuestTracker.db.profile.groupfinder.enabled) then
WorldQuestTracker.FindGroupForQuest (self.questID)
return
end
--middle click without our group finder enabled, check for other addons
if (WorldQuestGroupFinderAddon) then
WorldQuestGroupFinder.HandleBlockClick (self.questID)
return
end
end
if (self.questID == C_SuperTrack.GetSuperTrackedQuestID()) then
WorldQuestTracker.SuperTracked = nil
C_SuperTrack.SetSuperTrackedQuestID(0)
C_SuperTrack.ClearSuperTrackedContent()
C_SuperTrack.IsSuperTrackingMapPin()
--started on wow 11.0, the objective tracker isn't always selecting a quest to supertrack.
--[=[
["SetSuperTrackedMapPin"] = function,
["IsSuperTrackingMapPin"] = function,
["ClearSuperTrackedContent"] = function,
["ClearSuperTrackedMapPin"] = function,
["GetSuperTrackedVignette"] = function,
["GetHighestPrioritySuperTrackingType"] = function,
["SetSuperTrackedContent"] = function,
["SetSuperTrackedQuestID"] = function,
["IsSuperTrackingAnything"] = function,
["SetSuperTrackedVignette"] = function,
["GetSuperTrackedMapPin"] = function,
["IsSuperTrackingQuest"] = function,
["GetSuperTrackedContent"] = function,
["GetSuperTrackedQuestID"] = function,
["SetSuperTrackedUserWaypoint"] = function,
["IsSuperTrackingContent"] = function,
["IsSuperTrackingUserWaypoint"] = function,
["ClearAllSuperTracked"] = function,
["IsSuperTrackingCorpse"] = function,
--]=]
return
end
if (HaveQuestData (self.questID)) then
WorldQuestTracker.SelectSingleQuestInBlizzardWQTracker(self.questID) --thanks @ilintar on CurseForge
WorldQuestTracker.RefreshTrackerWidgets()
WorldQuestTracker.SuperTracked = self.questID
end
end
--quando um widget for clicado, mostrar painel com op��o para parar de trackear
local TrackerFrameOnClick = function(self, button)
--ao clicar em cima de uma quest mostrada no tracker
--??--
if (button == "RightButton") then
WorldQuestTracker.RemoveQuestFromTracker (self.questID)
---se o worldmap estiver aberto, dar refresh
if (WorldMapFrame:IsShown()) then
if (WorldQuestTracker.IsCurrentMapQuestHub()) then
--refresh no world map
WorldQuestTracker.UpdateWorldQuestsOnWorldMap (true)
elseif (WorldQuestTracker.ZoneHaveWorldQuest()) then
--refresh nos widgets
WorldQuestTracker.UpdateZoneWidgets (true)
WorldQuestTracker.WorldWidgets_NeedFullRefresh = true
end
else
WorldQuestTracker.WorldWidgets_NeedFullRefresh = true
end
else
if (button == "MiddleButton") then
--was middle button and our group finder is enabled
if (WorldQuestTracker.db.profile.groupfinder.enabled) then
WorldQuestTracker.FindGroupForQuest (self.questID)
return
end
--middle click without our group finder enabled, check for other addons
if (WorldQuestGroupFinderAddon) then
WorldQuestGroupFinder.HandleBlockClick (self.questID)
return
end
end
TrackerIconButtonOnClick(self, "leftbutton")
WorldQuestTracker.CanLinkToChat(self, button)
end
end
local buildTooltip = function(self)
GameTooltip:ClearAllPoints()
GameTooltip:SetPoint("TOPRIGHT", self, "TOPLEFT", -20, 0)
GameTooltip:SetOwner (self, "ANCHOR_PRESERVE")
local questID = self.questID
if ( not HaveQuestData (questID) ) then
GameTooltip:SetText (RETRIEVING_DATA, RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b)
GameTooltip:Show()
return
end
local title, factionID, capped = C_TaskQuest.GetQuestInfoByQuestID (questID)
local tagInfo = C_QuestLog.GetQuestTagInfo(questID)
if (not tagInfo and WorldQuestTracker.__debug) then
WorldQuestTracker:Msg("no tagInfo(2) for quest", questID)
end
local color = WORLD_QUEST_QUALITY_COLORS [tagInfo.quality or LE_WORLD_QUEST_QUALITY_COMMON]
GameTooltip:SetText (title, color.r, color.g, color.b)
--belongs to what faction
if (factionID) then
local factionName = WorldQuestTracker.GetFactionDataByID (factionID)
if (factionName) then
if (capped) then
GameTooltip:AddLine (factionName, GRAY_FONT_COLOR:GetRGB())
else
GameTooltip:AddLine (factionName, 0.4, 0.733, 1.0)
end
GameTooltip:AddLine (" ")
end
end
--time left
local timeLeftMinutes = C_TaskQuest.GetQuestTimeLeftMinutes (questID)
if (timeLeftMinutes) then
local color = NORMAL_FONT_COLOR
local timeString
if (timeLeftMinutes <= WORLD_QUESTS_TIME_CRITICAL_MINUTES) then
color = RED_FONT_COLOR
timeString = SecondsToTime (timeLeftMinutes * 60)
elseif (timeLeftMinutes <= 60 + WORLD_QUESTS_TIME_CRITICAL_MINUTES) then
timeString = SecondsToTime ((timeLeftMinutes - WORLD_QUESTS_TIME_CRITICAL_MINUTES) * 60)
elseif (timeLeftMinutes < 24 * 60 + WORLD_QUESTS_TIME_CRITICAL_MINUTES) then
timeString = D_HOURS:format (math.floor(timeLeftMinutes - WORLD_QUESTS_TIME_CRITICAL_MINUTES) / 60)
else
local days = math.floor(timeLeftMinutes - WORLD_QUESTS_TIME_CRITICAL_MINUTES) / 1440
local hours = math.floor(timeLeftMinutes - WORLD_QUESTS_TIME_CRITICAL_MINUTES) / 60
timeString = D_DAYS:format (days) .. " " .. D_HOURS:format (hours - (floor (days)*24))
end
GameTooltip:AddLine (BONUS_OBJECTIVE_TIME_LEFT:format (timeString), color.r, color.g, color.b)
end
--all objectives
for objectiveIndex = 1, self.numObjectives do
local objectiveText, objectiveType, finished = GetQuestObjectiveInfo(questID, objectiveIndex, false);
if ( objectiveText and #objectiveText > 0 ) then
local color = finished and GRAY_FONT_COLOR or HIGHLIGHT_FONT_COLOR;
GameTooltip:AddLine(QUEST_DASH .. objectiveText, color.r, color.g, color.b, true);
end
end
--percentage bar
local percent = C_TaskQuest.GetQuestProgressBarInfo (questID)
if ( percent ) then
-- WorldMapTaskTooltipStatusBar removed on 8.0
-- GameTooltip_InsertFrame(GameTooltip, WorldMapTaskTooltipStatusBar);
-- WorldMapTaskTooltipStatusBar.Bar:SetValue(percent);
-- WorldMapTaskTooltipStatusBar.Bar.Label:SetFormattedText(PERCENTAGE_STRING, percent);
end
-- rewards
if ( GetQuestLogRewardXP(questID) > 0 or GetNumQuestLogRewardCurrencies(questID) > 0 or GetNumQuestLogRewards(questID) > 0 or GetQuestLogRewardMoney(questID) > 0 or GetQuestLogRewardArtifactXP(questID) > 0 ) then
GameTooltip:AddLine(" ");
GameTooltip:AddLine(QUEST_REWARDS, NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, true);
local hasAnySingleLineRewards = false;
-- xp
local xp = GetQuestLogRewardXP(questID);
if ( xp > 0 ) then
GameTooltip:AddLine(BONUS_OBJECTIVE_EXPERIENCE_FORMAT:format(xp), HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
hasAnySingleLineRewards = true;
end
-- money
local money = GetQuestLogRewardMoney(questID);
if ( money > 0 ) then
SetTooltipMoney(GameTooltip, money, nil);
hasAnySingleLineRewards = true;
end
local artifactXP = GetQuestLogRewardArtifactXP(questID);
if ( artifactXP > 0 ) then
GameTooltip:AddLine(BONUS_OBJECTIVE_ARTIFACT_XP_FORMAT:format(artifactXP), HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
hasAnySingleLineRewards = true;
end
-- currency
local numQuestCurrencies = GetNumQuestLogRewardCurrencies(questID);
for i = 1, numQuestCurrencies do
local name, texture, numItems = GetQuestLogRewardCurrencyInfo(i, questID);
local text = BONUS_OBJECTIVE_REWARD_WITH_COUNT_FORMAT:format(texture, numItems, name);
GameTooltip:AddLine(text, HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
hasAnySingleLineRewards = true;
end
-- items
local numQuestRewards = GetNumQuestLogRewards (questID)
for i = 1, numQuestRewards do
local name, texture, numItems, quality, isUsable = GetQuestLogRewardInfo(i, questID);
local text;
if ( numItems > 1 ) then
text = string.format(BONUS_OBJECTIVE_REWARD_WITH_COUNT_FORMAT, texture, numItems, name);
elseif( texture and name ) then
text = string.format(BONUS_OBJECTIVE_REWARD_FORMAT, texture, name);
end
if( text ) then
local color = ITEM_QUALITY_COLORS[quality];
GameTooltip:AddLine(text, color.r, color.g, color.b);
end
end
end
GameTooltip:Show()
-- if (GameTooltip.ItemTooltip) then
-- GameTooltip:SetHeight (GameTooltip:GetHeight() + GameTooltip.ItemTooltip:GetHeight())
-- end
end
WorldQuestTracker.BuildTooltip = buildTooltip
local TrackerFrameOnEnter = function(self)
local color = OBJECTIVE_TRACKER_COLOR["HeaderHighlight"]
self.Title:SetTextColor (color.r, color.g, color.b)
local color = OBJECTIVE_TRACKER_COLOR["NormalHighlight"]
self.Zone:SetTextColor (color.r, color.g, color.b)
self.RightBackground:SetAlpha(TRACKER_BACKGROUND_ALPHA_MAX)
self.Arrow:SetAlpha(TRACKER_ARROW_ALPHA_MAX)
buildTooltip (self)
self.HasOverHover = true
end
local TrackerFrameOnLeave = function(self)
local color = OBJECTIVE_TRACKER_COLOR["Header"]
self.Title:SetTextColor (color.r, color.g, color.b)
local color = OBJECTIVE_TRACKER_COLOR["Normal"]
self.Zone:SetTextColor (color.r, color.g, color.b)
self.RightBackground:SetAlpha(TRACKER_BACKGROUND_ALPHA_MIN)
self.Arrow:SetAlpha(TRACKER_ARROW_ALPHA_MIN)
GameTooltip:Hide()
self.HasOverHover = nil
self.QuestInfomation.text = ""
end
local TrackerIconButtonOnEnter = function(self)
end
local TrackerIconButtonOnLeave = function(self)
end
--~arrow ãrrow
--from the user @ilintar on CurseForge
--Doing that instead of just SetSuperTrackedQuestID(questID) will make the arrow stay. The code also ensures that only the selected world quest is present in the Blizzard window, as to not make it cluttered.
function WorldQuestTracker.SelectSingleQuestInBlizzardWQTracker (questID)
--for i = 1, C_QuestLog.GetNumWorldQuestWatches() do --removed on 9.0, looks like doesn't need to remove super tracked before adding
--local watchedWorldQuestID = C_QuestLog.GetQuestIDForWorldQuestWatchIndex(i)
--if (watchedWorldQuestID) then
-- BonusObjectiveTracker_UntrackWorldQuest(watchedWorldQuestID)
--end
--end
--BonusObjectiveTracker_TrackWorldQuest(questID, 0)
QuestUtil.TrackWorldQuest(questID, Enum.QuestWatchType.Automatic) --0
C_SuperTrack.SetSuperTrackedQuestID(questID)
end
--
local TrackerIconButtonOnMouseDown = function(self, button)
self.Icon:SetPoint("topleft", self:GetParent(), "topleft", -12, -3)
end
local TrackerIconButtonOnMouseUp = function(self, button)
self.Icon:SetPoint("topleft", self:GetParent(), "topleft", -13, -2)
end
--pega um widget j� criado ou cria um novo ~trackercreate ~trackerwidget
function WorldQuestTracker.GetOrCreateTrackerWidget (index)
if (TrackerWidgetPool [index]) then
return TrackerWidgetPool [index]
end
local f = CreateFrame ("button", "WorldQuestTracker_Tracker" .. index, WorldQuestTrackerFrame_QuestHolder, "BackdropTemplate")
--f:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16})
--f:SetBackdropColor(0, 0, 0, .2)
f:SetSize(235, 30)
f:SetScript("OnClick", TrackerFrameOnClick)
f:SetScript("OnEnter", TrackerFrameOnEnter)
f:SetScript("OnLeave", TrackerFrameOnLeave)
f:RegisterForClicks("LeftButtonDown", "MiddleButtonDown", "RightButtonDown")
f.RightBackground = f:CreateTexture(nil, "background")
f.RightBackground:SetTexture([[Interface\ACHIEVEMENTFRAME\UI-Achievement-HorizontalShadow]])
f.RightBackground:SetTexCoord(1, 61/128, 0, 1)
f.RightBackground:SetDesaturated (true)
f.RightBackground:SetPoint("topright", f, "topright")
f.RightBackground:SetPoint("bottomright", f, "bottomright")
f.RightBackground:SetWidth (200)
f.RightBackground:SetAlpha(TRACKER_BACKGROUND_ALPHA_MIN)
--f.module = _G ["WORLD_QUEST_TRACKER_MODULE"]
f.worldQuest = true
f.Title = DF:CreateLabel (f)
f.Title.textsize = TRACKER_TITLE_TEXT_SIZE_INMAP
--f.Title = f:CreateFontString (nil, "overlay", "ObjectiveFont")
f.Title:SetPoint("topleft", f, "topleft", 10, -1)
local titleColor = OBJECTIVE_TRACKER_COLOR["Header"]
f.Title:SetTextColor (titleColor.r, titleColor.g, titleColor.b)
f.Zone = DF:CreateLabel (f)
f.Zone.textsize = TRACKER_TITLE_TEXT_SIZE_INMAP
--f.Zone = f:CreateFontString (nil, "overlay", "ObjectiveFont")
f.Zone:SetPoint("topleft", f, "topleft", 10, -17)
f.QuestInfomation = DF:CreateLabel (f)
f.QuestInfomation:SetPoint("topright", f, "topleft", -10, 50)
f.YardsDistance = f:CreateFontString (nil, "overlay", "GameFontNormal")
f.YardsDistance:SetPoint("left", f.Zone.widget, "right", 2, 0)
f.YardsDistance:SetJustifyH ("left")
DF:SetFontColor (f.YardsDistance, "white")
DF:SetFontSize (f.YardsDistance, 12)
f.YardsDistance:SetAlpha(.5)
f.TimeLeft = f:CreateFontString (nil, "overlay", "GameFontNormal")
f.TimeLeft:SetPoint("left", f.YardsDistance, "right", 2, 0)
f.TimeLeft:SetJustifyH ("left")
DF:SetFontColor (f.TimeLeft, "white")
DF:SetFontSize (f.TimeLeft, 12)
f.TimeLeft:SetAlpha(.5)
f.Icon = f:CreateTexture(nil, "artwork")
f.Icon:SetPoint("topleft", f, "topleft", -13, -2)
f.Icon:SetSize(16, 16)
f.Icon:SetMask ([[Interface\CharacterFrame\TempPortraitAlphaMask]])
local IconButton = CreateFrame ("button", "$parentIconButton", f, "BackdropTemplate")
IconButton:SetSize(18, 18)
IconButton:SetPoint("center", f.Icon, "center")
IconButton:SetScript("OnEnter", TrackerIconButtonOnEnter)
IconButton:SetScript("OnLeave", TrackerIconButtonOnLeave)
IconButton:SetScript("OnClick", TrackerIconButtonOnClick)
IconButton:SetScript("OnMouseDown", TrackerIconButtonOnMouseDown)
IconButton:SetScript("OnMouseUp", TrackerIconButtonOnMouseUp)
IconButton:RegisterForClicks("LeftButtonDown", "MiddleButtonDown")
IconButton.Icon = f.Icon
f.IconButton = IconButton
f.Circle = f:CreateTexture(nil, "overlay")
f.Circle:SetAtlas("transmog-nav-slot-selected")
f.Circle:SetSize(22, 22)
f.Circle:SetPoint("topleft", f, "topleft", -16, 0)
f.Circle:SetDesaturated (true)
f.Circle:SetAlpha(.7)
f.RewardAmount = f:CreateFontString (nil, "overlay", "ObjectiveFont")
f.RewardAmount:SetTextColor (titleColor.r, titleColor.g, titleColor.b)
f.RewardAmount:SetPoint("top", f.Circle, "bottom", 1, 3)
DF:SetFontSize (f.RewardAmount, 10)
f.BackgroupTexture = f:CreateTexture(nil, "background")
f.BackgroupTexture:SetPoint("topleft", f, "topleft", -25, 2)
f.BackgroupTexture:SetPoint("bottomright", f, "bottomright", 20, -2)
f.BackgroupTexture:SetTexture([[Interface\AddOns\WorldQuestTracker\media\background_gradient.png]])
f.BackgroupTexture:SetVertexColor(0, 0, 0, .5)
local overlayBorder = f:CreateTexture(nil, "overlay", nil, 5)
local overlayBorder2 = f:CreateTexture(nil, "overlay", nil, 6)
overlayBorder:SetDrawLayer("overlay", 5)
overlayBorder2:SetDrawLayer("overlay", 6)
overlayBorder:SetTexture([[Interface\Soulbinds\SoulbindsConduitIconBorder]])
overlayBorder2:SetTexture([[Interface\Soulbinds\SoulbindsConduitIconBorder]])
overlayBorder:SetTexCoord(0/256, 66/256, 0, 0.5)
overlayBorder2:SetTexCoord(67/256, 132/256, 0, 0.5)
overlayBorder:SetPoint("topleft", f.Circle, "topleft", 0, 0)
overlayBorder:SetPoint("bottomright", f.Circle, "bottomright", 0, 0)
overlayBorder2:SetPoint("topleft", f.Circle, "topleft", 0, 0)
overlayBorder2:SetPoint("bottomright", f.Circle, "bottomright", 0, 0)
overlayBorder:Hide()
overlayBorder2:Hide()
f.overlayBorder = overlayBorder
f.overlayBorder2 = overlayBorder2
f.Shadow = f:CreateTexture(nil, "BACKGROUND")
f.Shadow:SetSize(26, 26)
f.Shadow:SetPoint("center", f.Circle, "center")
f.Shadow:SetTexture([[Interface\PETBATTLES\BattleBar-AbilityBadge-Neutral]])
f.Shadow:SetAlpha(.3)
f.Shadow:SetDrawLayer("BACKGROUND", -5)
f.SuperTracked = f:CreateTexture(nil, "background")
f.SuperTracked:SetPoint("center", f.Circle, "center")
f.SuperTracked:SetAlpha(1)
f.SuperTracked:SetTexture([[Interface\Worldmap\UI-QuestPoi-IconGlow]])
f.SuperTracked:SetBlendMode("ADD")
f.SuperTracked:SetSize(42, 42)
f.SuperTracked:SetDrawLayer("BACKGROUND", -6)
f.SuperTracked:Hide()
local highlight = IconButton:CreateTexture(nil, "highlight")
highlight:SetPoint("center", f.Circle, "center")
highlight:SetAlpha(1)
highlight:SetTexture([[Interface\Worldmap\UI-QuestPoi-NumberIcons]])
--highlight:SetTexCoord(167/256, 185/256, 103/256, 121/256) --low light
highlight:SetTexCoord(167/256, 185/256, 231/256, 249/256)
highlight:SetBlendMode("ADD")
highlight:SetSize(14, 14)
f.SuperTrackButton = CreateFrame("button", nil, f) --no need backdrop
f.SuperTrackButton:SetPoint("right", f, "right", 2, 0)
f.SuperTrackButton:SetSize(18, 24)
f.SuperTrackButton:SetAlpha(.5)
f.SuperTrackButton.Icon = f.SuperTrackButton:CreateTexture(nil, "overlay")
f.SuperTrackButton.Icon:SetAllPoints()
f.SuperTrackButton.Icon:SetAtlas("Navigation-Tracked-Icon", true)
f.Arrow = f:CreateTexture(nil, "overlay")
f.Arrow:SetPoint("right", f.SuperTrackButton, "left", 0, 0)
f.Arrow:SetSize(32, 32)
f.Arrow:SetAlpha(.6)
f.Arrow:SetTexture([[Interface\AddOns\WorldQuestTracker\media\ArrowGridT]])
f.ArrowDistance = f:CreateTexture(nil, "overlay")
f.ArrowDistance:SetPoint("center", f.Arrow, "center", 0, 0)
f.ArrowDistance:SetSize(34, 34)
f.ArrowDistance:SetAlpha(.5)
f.ArrowDistance:SetTexture([[Interface\AddOns\WorldQuestTracker\media\ArrowGridTGlow]])
f.ArrowDistance:SetDrawLayer("overlay", 4)
f.Arrow:SetDrawLayer("overlay", 5)
f.SuperTrackButton:SetScript("OnClick", function(self, button)
TrackerIconButtonOnClick(f, button)
--C_Timer.After(.2, function() WorldQuestTracker.RefreshTrackerWidgets() end)
end)
f.SuperTrackButton:SetScript("OnEnter", function()
f.SuperTrackButton:SetAlpha(1)
end)
f.SuperTrackButton:SetScript("OnLeave", function()
if (not f.SuperTracked:IsShown()) then
f.SuperTrackButton:SetAlpha(.3)
end
end)
f.TomTomTrackerIcon = CreateFrame("button", nil, f) --no need backdrop
f.TomTomTrackerIcon:SetPoint("right", f.Arrow, "left", -6, 0)
f.TomTomTrackerIcon:SetSize(24, 24)
f.TomTomTrackerIcon:SetAlpha(.5)
f.TomTomTrackerIcon.Icon = f.TomTomTrackerIcon:CreateTexture(nil, "overlay")
f.TomTomTrackerIcon.Icon:SetAllPoints()
f.TomTomTrackerIcon.Icon:SetTexture([[Interface\AddOns\TomTom\Images\StaticArrow]])
f.TomTomTrackerIcon:SetScript("OnClick", function()
WorldQuestTracker.AddQuestTomTom (f.questID, f.questMapID, true)
WorldQuestTracker.SetTomTomQuestToTrack(f.questID)
end)
f.TomTomTrackerIcon:SetScript("OnEnter", function()
f.TomTomTrackerIcon:SetAlpha(1)
end)
f.TomTomTrackerIcon:SetScript("OnLeave", function()
f.TomTomTrackerIcon:SetAlpha(.5)
end)
------------------------
f.AnimationFrame = CreateFrame ("frame", "$parentAnimation", f, "BackdropTemplate")
f.AnimationFrame:SetAllPoints()
f.AnimationFrame:SetFrameLevel(f:GetFrameLevel()-1)
f.AnimationFrame:Hide()
local star = f.AnimationFrame:CreateTexture(nil, "overlay")
star:SetTexture([[Interface\Cooldown\star4]])
star:SetSize(168, 168)
star:SetPoint("center", f.Icon, "center", 1, -1)
star:SetBlendMode("ADD")
star:Hide()
local flash = f.AnimationFrame:CreateTexture(nil, "overlay")
flash:SetTexture([[Interface\ACHIEVEMENTFRAME\UI-Achievement-Alert-Glow]])
flash:SetTexCoord(0, 400/512, 0, 170/256)
flash:SetPoint("topleft", -60, 30)
flash:SetPoint("bottomright", 40, -30)
flash:SetBlendMode("ADD")
local spark = f.AnimationFrame:CreateTexture(nil, "overlay")
spark:SetTexture([[Interface\ACHIEVEMENTFRAME\UI-Achievement-Alert-Glow]])
spark:SetTexCoord(400/512, 470/512, 0, 70/256)
spark:SetSize(50, 34)
spark:SetBlendMode("ADD")
spark:SetPoint("left")
local iconoverlay = f:CreateTexture(nil, "overlay")
iconoverlay:SetTexture([[Interface\COMMON\StreamBackground]])
iconoverlay:SetPoint("center", f.Icon, "center", 0, 0)
iconoverlay:Hide()
--iconoverlay:SetSize(256, 256)
iconoverlay:SetDrawLayer("overlay", 7)
--iconoverlay:SetSize(50, 34)
--iconoverlay:SetBlendMode("ADD")
local StarShowAnimation = DF:CreateAnimationHub (star, function() star:Show() end, function() star:Hide() end)
DF:CreateAnimation (StarShowAnimation, "alpha", 1, .3, 0, .2)
DF:CreateAnimation (StarShowAnimation, "rotation", 1, .3, 90)
DF:CreateAnimation (StarShowAnimation, "scale", 1, .3, 0, 0, 1.2, 1.2)
DF:CreateAnimation (StarShowAnimation, "alpha", 2, .3, .2, 0)
DF:CreateAnimation (StarShowAnimation, "rotation", 2, .3, .8)
DF:CreateAnimation (StarShowAnimation, "scale", 1, .3, 1.2, 1.2, 0, 0)
local FlashAnimation = DF:CreateAnimationHub (flash, function() flash:Show() end, function() flash:Hide() end)
DF:CreateAnimation (FlashAnimation, "alpha", 1, .05, 0, .3)
DF:CreateAnimation (FlashAnimation, "alpha", 2, .5, .3, 0)
local SparkAnimation = DF:CreateAnimationHub (spark, function() spark:Show() end, function() spark:Hide() end)
DF:CreateAnimation (SparkAnimation, "alpha", 1, .2, 0, .1)
DF:CreateAnimation (SparkAnimation, "translation", 2, .3, 255, 0)
local CircleOverlayAnimation = DF:CreateAnimationHub (iconoverlay, function() iconoverlay:Show() end, function() iconoverlay:Hide() end)
DF:CreateAnimation (CircleOverlayAnimation, "alpha", 1, .05, 0, 1)
DF:CreateAnimation (CircleOverlayAnimation, "alpha", 2, .5, 1, 0)
f.AnimationFrame.ShowAnimation = function()
f.AnimationFrame:Show()
StarShowAnimation:Play()
spark:SetPoint("left", -40, 0)
SparkAnimation:Play()
FlashAnimation:Play()
CircleOverlayAnimation:Play()
end
------------------------
TrackerWidgetPool [index] = f
return f
end
local zoneXLength, zoneYLength = 0, 0
local playerIsMoving = true
function WorldQuestTracker:PLAYER_STARTED_MOVING()
playerIsMoving = true
end
function WorldQuestTracker:PLAYER_STOPPED_MOVING()
playerIsMoving = false
end
--making a cooldown to update the player position to avoid creating a table on tick due to C_Map.GetPlayerMapPosition call
local nextPlayerPositionUpdateCooldown = -1
local currentPlayerX = 0
local currentPlayerY = 0
-- ~trackertick ~trackeronupdate ~tick ~onupdate ~ontick �ntick �nupdate
local TrackerOnTick = function(self, deltaTime)
if (self.NextPositionUpdate < 0) then
if (Sort_currentMapID ~= WorldQuestTracker.GetCurrentStandingMapAreaID()) then
self.Arrow:SetAlpha(.3)
self.Arrow:SetTexture([[Interface\AddOns\WorldQuestTracker\media\ArrowFrozen]])
self.Arrow:SetTexCoord(0, 1, 0, 1)
self.ArrowDistance:Hide()
self.Arrow.Frozen = true
return
elseif (self.Arrow.Frozen) then
self.Arrow:SetTexture([[Interface\AddOns\WorldQuestTracker\media\ArrowGridT]])
self.ArrowDistance:Show()
self.Arrow.Frozen = nil