-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathWorldQuestTracker_OptionsPanel.lua
1620 lines (1438 loc) · 67.6 KB
/
WorldQuestTracker_OptionsPanel.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 = ...
function WorldQuestTrackerAddon.OpenOptionsPanel()
local wqt = WorldQuestTrackerAddon
local DF = DetailsFramework
if (WorldQuestTrackerOptionsPanel) then
WorldQuestTrackerOptionsPanel:Show()
return
end
local unpack = unpack
local languageInfo = {
language_addonId = addonId,
}
local L = DF.Language.GetLanguageTable(addonId)
--create the options frame
local optionsFrame = DF:CreateSimplePanel(UIParent, 800, 600, "World Quest Tracker Options", "WorldQuestTrackerOptionsPanel", {RoundedCorners = true})
optionsFrame:SetFrameStrata("HIGH")
optionsFrame:ClearAllPoints()
PixelUtil.SetPoint(optionsFrame, "center", UIParent, "center", 2, 2, 1, 1)
--this title bar is created by the rounded corners (RoundedCorners = true)
optionsFrame.TitleBar.Text:SetText("World Quest Tracker Options")
--create the footer below the options frame
local statusBar = CreateFrame("frame", "$parentStatusBar", optionsFrame, "BackdropTemplate")
statusBar:SetPoint("bottomleft", optionsFrame, "bottomleft")
statusBar:SetPoint("bottomright", optionsFrame, "bottomright")
statusBar:SetHeight(20)
statusBar:SetAlpha(0.9)
statusBar:SetFrameLevel(optionsFrame:GetFrameLevel()+2)
--DF:ApplyStandardBackdrop(statusBar)
DF:BuildStatusbarAuthorInfo(statusBar, "An AddOn By Terciob")
local bottomGradient = DF:CreateTexture(optionsFrame, {gradient = "vertical", fromColor = {0, 0, 0, 0.6}, toColor = "transparent"}, 1, 100, "artwork", {0, 1, 0, 1}, "bottomGradient")
bottomGradient:SetPoint("bottom-top", statusBar)
local frameOptions = {
y_offset = 0,
button_width = 108,
button_height = 23,
button_x = 190,
button_y = 1,
button_text_size = 10,
right_click_y = 5,
rightbutton_always_close = true,
close_text_alpha = 0.4,
container_width_offset = 30,
}
local selectedTabIndicatorDefaultColor = {.4, .4, .4}
local selectedTabIndicatorColor = {1, 1, 0}
local hookList = {
OnSelectIndex = function(tabContainer, tabButton)
if (not tabButton.leftSelectionIndicator) then
return
end
for i = 1, #tabContainer.AllFrames do
local thisTabButton = tabContainer.AllButtons[i]
thisTabButton.leftSelectionIndicator:SetColorTexture(unpack(selectedTabIndicatorDefaultColor))
end
tabButton.leftSelectionIndicator:SetColorTexture(unpack(selectedTabIndicatorColor))
tabButton.selectedUnderlineGlow:Hide()
end,
}
--create the tab system which will hold the tabs for each section of the options panel
local tabContainer = DF:CreateTabContainer(optionsFrame, "WQT Options", "WQTOptionsPanelContainer",
{
{name = "FrontPage", text = "S_OPTTIONS_TAB_GENERAL_SETTINGS"},
{name = "TrackerConfig", text = "S_OPTTIONS_TAB_TRACKER_SETTINGS"},
{name = "WorldMapConfig", text = "S_OPTTIONS_TAB_WORLDMAP_SETTINGS"},
{name = "ZoneMapConfig", text = "S_OPTTIONS_TAB_ZONEMAP_SETTINGS"},
{name = "GroupFinderConfig", text = "S_OPTTIONS_TAB_GROUPFINDER_SETTINGS"},
{name = "DragonRacingConfig", text = "S_OPTTIONS_TAB_DRAGONRACE_SETTINGS"},
--{name = "RaresConfig", text = "S_OPTTIONS_TAB_RARES_SETTINGS"},
--{name = "IgnoredQuestsPanel", text = "S_OPTTIONS_TAB_IGNOREDQUESTS_SETTINGS"},
},
frameOptions, hookList, languageInfo)
tabContainer:SetPoint("topleft", optionsFrame, "topleft", 5, -10)
tabContainer:Show()
local optionsFrameWidth, optionsFrameHeight = optionsFrame:GetSize()
tabContainer:SetSize(optionsFrameWidth - 5, optionsFrameHeight - 5)
--this function runs when any setting is changed
local globalCallback = function()
end
--make the tab button's text be aligned to left and fit the button's area
for index, frame in ipairs(tabContainer.AllFrames) do
--DF:ApplyStandardBackdrop(frame)
local frameBackgroundTexture = frame:CreateTexture("$parentBackgroundTexture", "artwork")
frameBackgroundTexture:SetPoint("topleft", frame, "topleft", 1, -90)
frameBackgroundTexture:SetPoint("bottomright", frame, "bottomright", -1, 20)
frameBackgroundTexture:SetColorTexture (0.2317647, 0.2317647, 0.2317647)
frameBackgroundTexture:SetVertexColor (0.27, 0.27, 0.27)
frameBackgroundTexture:SetAlpha (0.3)
--frameBackgroundTexture:Hide()
--divisor shown above the background (create above)
local frameBackgroundTextureTopLine = frame:CreateTexture("$parentBackgroundTextureTopLine", "artwork")
frameBackgroundTextureTopLine:SetPoint("bottomleft", frameBackgroundTexture, "topleft", 0, 0)
frameBackgroundTextureTopLine:SetPoint("bottomright", frame, "topright", -1, 0)
frameBackgroundTextureTopLine:SetHeight(1)
frameBackgroundTextureTopLine:SetColorTexture(0.1215, 0.1176, 0.1294)
frameBackgroundTextureTopLine:SetAlpha(1)
frame.titleText.fontsize = 12
local gradientBelowTheLine = DF:CreateTexture(frame, {gradient = "vertical", fromColor = "transparent", toColor = DF.IsDragonflight() and {0, 0, 0, 0.15} or {0, 0, 0, 0.25}}, 1, 100, "artwork", {0, 1, 0, 1}, "gradientBelowTheLine")
gradientBelowTheLine:SetPoint("top-bottom", frameBackgroundTextureTopLine)
local gradientAboveTheLine = DF:CreateTexture(frame, {gradient = "vertical", fromColor = DF.IsDragonflight() and {0, 0, 0, 0.3} or {0, 0, 0, 0.4}, toColor = "transparent"}, 1, 80, "artwork", {0, 1, 0, 1}, "gradientAboveTheLine")
gradientAboveTheLine:SetPoint("bottom-top", frameBackgroundTextureTopLine)
local tabButton = tabContainer.AllButtons[index]
local leftSelectionIndicator = tabButton:CreateTexture(nil, "overlay")
if (index == 1) then
leftSelectionIndicator:SetColorTexture(1, 1, 0)
else
leftSelectionIndicator:SetColorTexture(.4, .4, .4)
end
leftSelectionIndicator:SetPoint("left", tabButton.widget, "left", 2, 0)
leftSelectionIndicator:SetSize(4, tabButton:GetHeight()-4)
tabButton.leftSelectionIndicator = leftSelectionIndicator
local maxTextLength = tabButton:GetWidth() - 7
local fontString = _G[tabButton:GetName() .. "_Text"]
fontString:ClearAllPoints()
fontString:SetPoint("left", leftSelectionIndicator, "right", 2, 0)
fontString:SetJustifyH("left")
fontString:SetWidth(maxTextLength)
fontString:SetHeight(tabButton:GetHeight()+20)
fontString:SetWordWrap(true)
fontString:SetText(fontString:GetText())
local stringWidth = fontString:GetStringWidth()
--print(stringWidth, maxTextLength, fontString:GetText())
if (stringWidth > maxTextLength) then
local fontSize = DF:GetFontSize(fontString)
DF:SetFontSize(fontString, fontSize-0.5)
end
end
--get each tab's frame and create a local variable to cache it
local generalSettingsFrame = tabContainer.AllFrames[1]
local trackerSettingsFrame = tabContainer.AllFrames[2]
local worldMapSettingsFrame = tabContainer.AllFrames[3]
local zoneMapSettingsFrame = tabContainer.AllFrames[4]
local groupFinderSettingsFrame = tabContainer.AllFrames[5]
local dragonRaceSettingsFrame = tabContainer.AllFrames[6]
--local raresSettingsFrame = tabContainer.AllFrames[6]
--local ignoredQuestsSettingsFrame = tabContainer.AllFrames[7]
local DB = wqt.db
local WorldQuestTracker = wqt
--templates
local options_text_template = DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE")
local options_dropdown_template = DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")
local options_switch_template = DF:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE")
local options_slider_template = DF:GetTemplate("slider", "OPTIONS_SLIDER_TEMPLATE")
local options_button_template = DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")
--~languages
local onLanguageChangedCallback = function(languageId)
WQTrackerLanguage.language = languageId
end
--addonId, parent, callback, defaultLanguage
local languageSelectorDropdown = DF.Language.CreateLanguageSelector(addonId, generalSettingsFrame, onLanguageChangedCallback, WQTrackerLanguage.language)
languageSelectorDropdown:SetPoint("topright", -21, -108)
--buttons moved from the statusbar
---------------------------------------------------------
--statistics button
local statisticsButton = CreateFrame("button", "WorldQuestTrackerStatisticsButton", generalSettingsFrame, "BackdropTemplate")
statisticsButton:SetPoint("bottomleft", generalSettingsFrame, "bottomleft", 5, 26)
WorldQuestTracker.SetupStatusbarButton(statisticsButton, "Statistics")
if (GameCooltip.InjectQuickTooltip) then
GameCooltip:InjectQuickTooltip(statisticsButton, "Click to show reward statistics from world quests, timeline and quests available on your other characters.")
end
DF:ApplyStandardBackdrop(statisticsButton)
statisticsButton:SetSize(120, 20)
statisticsButton:HookScript("OnEnter", WorldQuestTracker.OnEnterStatusbarButton)
statisticsButton:HookScript("OnLeave", WorldQuestTracker.OnLeaveStatusbarButton)
statisticsButton:SetScript("OnClick", function()
WorldQuestTrackerSummaryPanel:Show()
WorldQuestTrackerSummaryUpPanel:Show()
WorldQuestTrackerSummaryDownPanel:Show()
WorldQuestTracker.UpdateSummaryFrame()
WorldQuestTrackerSummaryUpPanel.CharsQuestsScroll:Refresh()
end)
---------------------------------------------------------
--sort options
local sortButton = CreateFrame("button", "WorldQuestTrackerSortButton", generalSettingsFrame, "BackdropTemplate")
WorldQuestTracker.SetupStatusbarButton(sortButton, L["S_MAPBAR_SORTORDER"])
sortButton:SetPoint("left", statisticsButton, "right", 5, 0)
DF:ApplyStandardBackdrop(sortButton)
sortButton:SetSize(120, 20)
-- ~sort
local change_sort_mode = function(a, b, questType, _, _, mouseButton)
local currentIndex = WorldQuestTracker.db.profile.sort_order [questType]
if (currentIndex < WQT_QUESTTYPE_MAX) then
for type, order in pairs(WorldQuestTracker.db.profile.sort_order) do
if (WorldQuestTracker.db.profile.sort_order [type] == currentIndex+1) then
WorldQuestTracker.db.profile.sort_order [type] = currentIndex
break
end
end
WorldQuestTracker.db.profile.sort_order [questType] = WorldQuestTracker.db.profile.sort_order [questType] + 1
end
GameCooltip:ExecFunc(sortButton)
--atualiza as quests
if (WorldQuestTracker.IsWorldQuestHub(WorldQuestTracker.GetCurrentMapAreaID())) then
WorldQuestTracker.UpdateWorldQuestsOnWorldMap(true)
end
end
local overlayColor = {.5, .5, .5, 1}
local BuildSortMenu = function()
local t = {}
for type, order in pairs(WorldQuestTracker.db.profile.sort_order) do
table.insert(t, {type, order})
end
table.sort(t, function(a, b) return a[2] > b[2] end)
GameCooltip:Preset(2)
GameCooltip:SetOption("TextSize", 10)
GameCooltip:SetOption("FixedWidth", 180)
--warning: this looks like is running in protective mode without any error message
for i = 1, #t do
local questInfoTable = t[i]
local questType = questInfoTable[1]
local info = WorldQuestTracker.MapData.QuestTypeIcons[questType]
local bIsEnabled = WorldQuestTracker.db.profile.filters[WorldQuestTracker.QuestTypeToFilter[questType]]
if (bIsEnabled) then
GameCooltip:AddLine(info.name)
GameCooltip:AddIcon(info.icon, 1, 1, 16, 16, unpack(info.coords))
GameCooltip:AddIcon([[Interface\BUTTONS\UI-MicroStream-Yellow]], 1, 2, 16, 16, 0, 1, 1, 0, overlayColor, nil, true)
else
GameCooltip:AddLine(info.name, _, _, "silver")
local l, r, t, b = unpack(info.coords)
GameCooltip:AddIcon(info.icon, 1, 1, 16, 16, l, r, t, b, _, _, true)
end
GameCooltip:AddMenu(1, change_sort_mode, questType)
end
end
sortButton.CoolTip = {
Type = "menu",
BuildFunc = BuildSortMenu, --> called when user mouse over the frame
OnEnterFunc = function(self)
sortButton.button_mouse_over = true
WorldQuestTracker.OnEnterStatusbarButton(self)
end,
OnLeaveFunc = function(self)
sortButton.button_mouse_over = false
WorldQuestTracker.OnLeaveStatusbarButton(self)
end,
FixedValue = "none",
ShowSpeed = 0.05,
Options = function()
if (WorldQuestTracker.db.profile.bar_anchor == "top") then
GameCooltip:SetOption("MyAnchor", "top")
GameCooltip:SetOption("RelativeAnchor", "bottom")
GameCooltip:SetOption("WidthAnchorMod", 0)
GameCooltip:SetOption("HeightAnchorMod", -10)
else
GameCooltip:SetOption("MyAnchor", "bottom")
GameCooltip:SetOption("RelativeAnchor", "top")
GameCooltip:SetOption("WidthAnchorMod", 0)
GameCooltip:SetOption("HeightAnchorMod", -5)
end
end
}
GameCooltip:CoolTipInject(sortButton)
---------------------------------------------------------
-- ~filter
local filterButton = CreateFrame("button", "WorldQuestTrackerFilterButton", generalSettingsFrame, "BackdropTemplate")
filterButton:SetPoint("left", sortButton, "right", 5, 0)
WorldQuestTracker.SetupStatusbarButton(filterButton, L["S_MAPBAR_FILTER"])
DF:ApplyStandardBackdrop(filterButton)
filterButton:SetSize(120, 20)
local filter_quest_type = function(_, _, questType, _, _, mouseButton)
WorldQuestTracker.db.profile.filters[questType] = not WorldQuestTracker.db.profile.filters[questType]
GameCooltip:ExecFunc(filterButton)
--atualiza as quests
if (WorldQuestTrackerAddon.GetCurrentZoneType() == "world") then
WorldQuestTracker.UpdateWorldQuestsOnWorldMap(true)
elseif (WorldQuestTrackerAddon.GetCurrentZoneType() == "zone") then
WorldQuestTracker.UpdateZoneWidgets()
end
end
local toggle_faction_objectives = function()
WorldQuestTracker.db.profile.filter_always_show_faction_objectives = not WorldQuestTracker.db.profile.filter_always_show_faction_objectives
GameCooltip:ExecFunc(filterButton)
--atualiza as quests
if (WorldQuestTrackerAddon.GetCurrentZoneType() == "world") then
WorldQuestTracker.UpdateWorldQuestsOnWorldMap(true)
elseif (WorldQuestTrackerAddon.GetCurrentZoneType() == "zone") then
WorldQuestTracker.UpdateZoneWidgets()
end
end
local toggle_brokenshore_bypass = function()
WorldQuestTracker.db.profile.filter_force_show_brokenshore = not WorldQuestTracker.db.profile.filter_force_show_brokenshore
GameCooltip:ExecFunc(filterButton)
--atualiza as quests
if (WorldQuestTrackerAddon.GetCurrentZoneType() == "world") then
WorldQuestTracker.UpdateWorldQuestsOnWorldMap(true)
elseif (WorldQuestTrackerAddon.GetCurrentZoneType() == "zone") then
WorldQuestTracker.UpdateZoneWidgets()
end
end
local toggle_filters_all_on = function()
for filterType, canShow in pairs(WorldQuestTracker.db.profile.filters) do
local questType = filterType
WorldQuestTracker.db.profile.filters [questType] = true
end
GameCooltip:ExecFunc(filterButton)
--update quest on current map shown
if (WorldQuestTrackerAddon.GetCurrentZoneType() == "world") then
WorldQuestTracker.UpdateWorldQuestsOnWorldMap(true)
elseif (WorldQuestTrackerAddon.GetCurrentZoneType() == "zone") then
WorldQuestTracker.UpdateZoneWidgets()
end
end
local toggle_filters_all_off = function()
for filterType, canShow in pairs(WorldQuestTracker.db.profile.filters) do
local questType = filterType
WorldQuestTracker.db.profile.filters[questType] = false
end
GameCooltip:ExecFunc(filterButton)
--update quest on current map shown
if (WorldQuestTrackerAddon.GetCurrentZoneType() == "world") then
WorldQuestTracker.UpdateWorldQuestsOnWorldMap(true)
elseif (WorldQuestTrackerAddon.GetCurrentZoneType() == "zone") then
WorldQuestTracker.UpdateZoneWidgets()
end
end
local BuildFilterMenu = function()
GameCooltip:Preset(2)
GameCooltip:SetOption("TextSize", 10)
GameCooltip:SetOption("FixedWidth", 180)
GameCooltip:SetOption("FixedWidthSub", 200)
GameCooltip:SetOption("SubMenuIsTooltip", true)
GameCooltip:SetOption("IgnoreArrows", true)
local t = {}
for filterType, canShow in pairs(WorldQuestTracker.db.profile.filters) do
local sortIndex = WorldQuestTracker.db.profile.sort_order[WorldQuestTracker.FilterToQuestType[filterType]]
table.insert(t, {filterType, sortIndex})
end
table.sort(t, function(a, b) return a[2] > b[2] end)
for i, filter in ipairs(t) do
local filterType = filter [1]
local info = WorldQuestTracker.MapData.QuestTypeIcons[WorldQuestTracker.FilterToQuestType[filterType]]
local isEnabled = WorldQuestTracker.db.profile.filters[filterType]
if (isEnabled) then
GameCooltip:AddLine(info.name)
GameCooltip:AddIcon(info.icon, 1, 1, 16, 16, unpack(info.coords))
GameCooltip:AddIcon([[Interface\BUTTONS\UI-CheckBox-Check]], 1, 2, 16, 16, 0, 1, 0, 1, overlayColor, nil, true)
else
GameCooltip:AddLine(info.name, _, _, "silver")
local l, r, t, b = unpack(info.coords)
GameCooltip:AddIcon(info.icon, 1, 1, 16, 16, l, r, t, b, _, _, true)
end
GameCooltip:AddMenu(1, filter_quest_type, filterType)
end
GameCooltip:AddLine("$div")
GameCooltip:AddLine("Select All")
GameCooltip:AddMenu(1, toggle_filters_all_on)
GameCooltip:AddLine("Select None")
GameCooltip:AddMenu(1, toggle_filters_all_off)
GameCooltip:AddLine("$div")
local l, r, t, b = unpack(WorldQuestTracker.MapData.GeneralIcons.CRITERIA.coords)
if (WorldQuestTracker.db.profile.filter_always_show_faction_objectives) then
GameCooltip:AddLine(L["S_MAPBAR_FILTERMENU_FACTIONOBJECTIVES"])
GameCooltip:AddLine(L["S_MAPBAR_FILTERMENU_FACTIONOBJECTIVES_DESC"], "", 2)
GameCooltip:AddIcon(WorldQuestTracker.MapData.GeneralIcons.CRITERIA.icon, 1, 1, 23*.54, 37*.40, l, r, t, b)
GameCooltip:AddIcon([[Interface\BUTTONS\UI-CheckBox-Check]], 1, 2, 16, 16, 0, 1, 0, 1, overlayColor, nil, true)
else
GameCooltip:AddLine(L["S_MAPBAR_FILTERMENU_FACTIONOBJECTIVES"], "", 1, "silver")
GameCooltip:AddLine(L["S_MAPBAR_FILTERMENU_FACTIONOBJECTIVES_DESC"], "", 2)
GameCooltip:AddIcon(WorldQuestTracker.MapData.GeneralIcons.CRITERIA.icon, 1, 1, 23*.54, 37*.40, l, r, t, b, nil, nil, true)
end
GameCooltip:AddMenu(1, toggle_faction_objectives)
GameCooltip:AddLine("$div")
--[= --this is deprecated at the moment, but might be needed again in the future
if (WorldQuestTracker.db.profile.filter_force_show_brokenshore) then
GameCooltip:AddLine("Ignore New Zones", "", 1, "orange")
GameCooltip:AddLine("World quets on new zones will always be shown.\n\nCurrent new zones:\n-Najatar\n-Machagon.", "", 2)
GameCooltip:AddIcon([[Interface\ICONS\70_inscription_vantus_rune_tomb]], 1, 1, 23*.54, 37*.40, 0, 1, 0, 1)
GameCooltip:AddIcon([[Interface\BUTTONS\UI-CheckBox-Check]], 1, 2, 16, 16, 0, 1, 0, 1, overlayColor, nil, true)
else
GameCooltip:AddLine("Ignore New Zones", "", 1, "silver")
GameCooltip:AddLine("World quets on new zones will always be shown.\n\nCurrent new zones:\n-Najatar\n-Machagon", "", 2)
--GameCooltip:AddIcon([[Interface\ICONS\70_inscription_vantus_rune_tomb]], 1, 1, 23*.54, 37*.40, l, r, t, b, nil, nil, true)
end
GameCooltip:AddMenu(1, toggle_brokenshore_bypass)
--]=]
end
filterButton.CoolTip = {
Type = "menu",
BuildFunc = BuildFilterMenu, --> called when user mouse over the frame
OnEnterFunc = function(self)
filterButton.button_mouse_over = true
WorldQuestTracker.OnEnterStatusbarButton(self)
end,
OnLeaveFunc = function(self)
filterButton.button_mouse_over = false
WorldQuestTracker.OnLeaveStatusbarButton(self)
end,
FixedValue = "none",
ShowSpeed = 0.05,
Options = function()
if (WorldQuestTracker.db.profile.bar_anchor == "top") then
GameCooltip:SetOption("MyAnchor", "top")
GameCooltip:SetOption("RelativeAnchor", "bottom")
GameCooltip:SetOption("WidthAnchorMod", 0)
GameCooltip:SetOption("HeightAnchorMod", -10)
else
GameCooltip:SetOption("MyAnchor", "bottom")
GameCooltip:SetOption("RelativeAnchor", "top")
GameCooltip:SetOption("WidthAnchorMod", 0)
GameCooltip:SetOption("HeightAnchorMod", -5)
end
end,
}
GameCooltip:CoolTipInject(filterButton)
local xStart = 5
local yStart = -100
local tabFrameHeight = generalSettingsFrame:GetHeight()
do --General Settings
local optionsTable = {
always_boxfirst = true,
language_addonId = addonId,
{
type = "toggle",
get = function()
return DB.profile.map_frame_anchor == "center"
end,
set = function(self, fixedparam, value)
WorldQuestTracker.SetSetting("map_frame_anchor", WorldQuestTracker.db.profile.map_frame_anchor == "center" and "left" or "center")
end,
name = "S_OPTIONS_MAPFRAME_ALIGN",
desc = "S_OPTIONS_MAPFRAME_ALIGN",
},
{
type = "toggle",
get = function()
return DB.profile.hoverover_animations
end,
set = function(self, fixedparam, value)
WorldQuestTracker.SetSetting("hoverover_animations", not WorldQuestTracker.db.profile.hoverover_animations)
end,
name = "S_OPTIONS_ANIMATIONS",
desc = "S_OPTIONS_ANIMATIONS",
},
{
type = "toggle",
get = function()
return WorldQuestTracker.db.profile.bar_anchor == "top"
end,
set = function(self, fixedparam, value)
WorldQuestTracker.SetSetting("bar_anchor", WorldQuestTracker.db.profile.bar_anchor == "bottom" and "top" or "bottom")
end,
name = "S_MAPBAR_OPTIONSMENU_STATUSBARANCHOR",
desc = "S_MAPBAR_OPTIONSMENU_STATUSBARANCHOR",
},
{
type = "toggle",
get = function()
return WorldQuestTracker.db.profile.show_emissary_info
end,
set = function(self, fixedparam, value)
WorldQuestTracker.SetSetting("emissary_quest_info", not WorldQuestTracker.db.profile.show_emissary_info)
end,
name = "S_OPTIONS_QUEST_EMISSARY",
desc = "S_OPTIONS_QUEST_EMISSARY",
},
{
type = "toggle",
get = function()
return WorldQuestTracker.db.profile.flymaster_tracker_enabled
end,
set = function(self, fixedparam, value)
WorldQuestTracker.SetSetting("oribos_flight_master", WorldQuestTracker.db.profile.flymaster_tracker_enabled)
end,
name = "S_OPTIONS_TRACKER_FLIGHTMASTER",
desc = "S_OPTIONS_TRACKER_FLIGHTMASTER",
},
{
type = "toggle",
get = function()
return DB.profile.bar_visible
end,
set = function(self, fixedparam, value)
WorldQuestTracker.SetSetting("bar_visible", not WorldQuestTracker.db.profile.bar_visible)
end,
name = "S_MAPBAR_OPTIONSMENU_STATUSBAR_VISIBILITY",
desc = "S_MAPBAR_OPTIONSMENU_STATUSBAR_VISIBILITY",
},
{
type = "toggle",
get = function()
return DB.profile.use_old_icons
end,
set = function(self, fixedparam, value)
WorldQuestTracker.SetSetting("use_old_icons", not WorldQuestTracker.db.profile.use_old_icons)
end,
name = "S_MAPBAR_OPTIONSMENU_EQUIPMENTICONS",
desc = "|TInterface\\AddOns\\WorldQuestTracker\\media\\options_visibility_context:" .. 49 .. ":" .. 87 .. ":0:0:256:256:" .. (0) .. ":" .. (87) .. ":" .. (131) .. ":" .. (131+49) .. "|t"
},
{
type = "toggle",
get = function()
return DB.profile.sound_enabled
end,
set = function(self, fixedparam, value)
WorldQuestTracker.SetSetting("sound_enabled", not WorldQuestTracker.db.profile.sound_enabled)
end,
name = "S_MAPBAR_OPTIONSMENU_SOUNDENABLED",
desc = "S_MAPBAR_OPTIONSMENU_SOUNDENABLED",
},
{
type = "toggle",
get = function()
return DB.profile.close_blizz_popups.ABANDON_QUEST
end,
set = function(self, fixedparam, value)
DB.profile.close_blizz_popups.ABANDON_QUEST = value
end,
name = "S_OPTTIONS_AUTOACCEPT_ABANDONQUEST",
desc = "|TInterface\\AddOns\\WorldQuestTracker\\media\\options_visibility_context:" .. 36 .. ":" .. 173 .. ":0:0:256:256:" .. (80) .. ":" .. (253) .. ":" .. (0) .. ":" .. (36) .. "|t"
},
{
type = "toggle",
get = function()
return DB.profile.numerate_quests
end,
set = function(self, fixedparam, value)
DB.profile.numerate_quests = value
end,
name = "S_OPTTIONS_NUMERATE_QUEST",
desc = "|TInterface\\AddOns\\WorldQuestTracker\\media\\options_visibility_context:" .. 30 .. ":" .. 90 .. ":0:0:256:256:" .. (0) .. ":" .. (90) .. ":" .. (100) .. ":" .. (130) .. "|t"
},
{type = "blank"},
{
type = "label",
get = function() return "S_OPTIONS_PATHLINE" end,
text_template = DF:GetTemplate("font", "ORANGE_FONT_TEMPLATE")
},
{
type = "toggle",
get = function()
return WorldQuestTracker.db.profile.path.enabled
end,
set = function(self, fixedparam, value)
WorldQuestTracker.SetSetting("pathdots", "enabled", value)
end,
name = "S_ENABLE",
desc = "|TInterface\\AddOns\\WorldQuestTracker\\media\\options_visibility_context:" .. 30 .. ":" .. 134 .. ":0:0:256:256:" .. (91) .. ":" .. (225) .. ":" .. (100) .. ":" .. (130) .. "|t"
},
{type = "blank"},
{
type = "label",
get = function() return "S_OPTIONS_TALKINGHEADS" end,
text_template = DF:GetTemplate("font", "ORANGE_FONT_TEMPLATE")
},
{
type = "toggle",
get = function()
return DB.profile.talking_heads_torgast
end,
set = function(self, fixedparam, value)
WorldQuestTracker.SetSetting("talkinghead", "talking_heads_torgast", not WorldQuestTracker.db.profile.talking_heads_torgast)
end,
name = "S_TORGAST",
desc = "S_TORGAST",
},
{
type = "toggle",
get = function()
return DB.profile.talking_heads_dungeon
end,
set = function(self, fixedparam, value)
WorldQuestTracker.SetSetting("talkinghead", "talking_heads_dungeon", not WorldQuestTracker.db.profile.talking_heads_dungeon)
end,
name = "S_DUNGEON",
desc = "S_DUNGEON",
},
{
type = "toggle",
get = function()
return DB.profile.talking_heads_raid
end,
set = function(self, fixedparam, value)
WorldQuestTracker.SetSetting("talkinghead", "talking_heads_raid", not WorldQuestTracker.db.profile.talking_heads_raid)
end,
name = "S_RAID",
desc = "S_RAID",
},
{
type = "toggle",
get = function()
return DB.profile.talking_heads_openworld
end,
set = function(self, fixedparam, value)
WorldQuestTracker.SetSetting("talkinghead", "talking_heads_openworld", not WorldQuestTracker.db.profile.talking_heads_openworld)
end,
name = "S_OPENWORLD",
desc = "S_OPENWORLD",
},
{type = "breakline"},
{
type = "label",
get = function() return "S_OPTIONS_ACCESSIBILITY" end,
text_template = DF:GetTemplate("font", "ORANGE_FONT_TEMPLATE")
},
{
type = "toggle",
get = function()
return DB.profile.accessibility.use_bounty_ring
end,
set = function(self, fixedparam, value)
WorldQuestTracker.SetSetting("accessibility", "use_bounty_ring", not WorldQuestTracker.db.profile.accessibility.use_bounty_ring)
end,
name = "S_OPTIONS_ACCESSIBILITY_SHOWBOUNTYRING",
desc = "S_OPTIONS_ACCESSIBILITY_SHOWBOUNTYRING",
},
{
type = "toggle",
get = function()
return DB.profile.accessibility.extra_tracking_indicator
end,
set = function(self, fixedparam, value)
WorldQuestTracker.SetSetting("accessibility", "extra_tracking_indicator", not WorldQuestTracker.db.profile.accessibility.extra_tracking_indicator)
end,
name = "S_OPTIONS_ACCESSIBILITY_EXTRATRACKERMARK",
desc = "S_OPTIONS_ACCESSIBILITY_EXTRATRACKERMARK"
},
{type = "blank"},
{type = "breakline"},
{
type = "label",
get = function() return "S_VISIBILITY" end,
text_template = DF:GetTemplate("font", "ORANGE_FONT_TEMPLATE")
},
{
type = "toggle",
get = function()
return DB.profile.show_faction_frame
end,
set = function(self, fixedparam, value)
WorldQuestTracker.SetSetting("show_faction_frame", not WorldQuestTracker.db.profile.show_faction_frame)
end,
name = "S_OPTIONS_SHOWFACTIONS",
desc = "|TInterface\\AddOns\\WorldQuestTracker\\media\\options_visibility_context:" .. 33 .. ":" .. 208 .. ":0:0:256:256:" .. (0) .. ":" .. (208) .. ":" .. (36+30) .. ":" .. (36+30+33) .. "|t",
},
{
type = "toggle",
get = function()
return DB.profile.show_world_shortcuts
end,
set = function(self, fixedparam, value)
WorldQuestTracker.db.profile.show_world_shortcuts = not WorldQuestTracker.db.profile.show_world_shortcuts
WorldQuestTracker.SetShownWorldShortcuts()
end,
name = "S_OPTIONS_SHOW_WORLDSHORTCUT_BUTTON",
desc = "|TInterface\\AddOns\\WorldQuestTracker\\media\\options_visibility_context:" .. 36 .. ":" .. 80 .. ":0:0:256:256:" .. (0) .. ":" .. (80) .. ":" .. (0) .. ":" .. (36) .. "|t",
},
{
type = "toggle",
get = function()
return WorldQuestTracker.db.profile.show_timeleft_button
end,
set = function(self, fixedparam, value)
WorldQuestTracker.db.profile.show_timeleft_button = not WorldQuestTracker.db.profile.show_timeleft_button
WorldQuestTracker.RefreshStatusBarButtons()
end,
name = "S_OPTIONS_SHOW_TIMELEFT_BUTTON",
desc = "|TInterface\\AddOns\\WorldQuestTracker\\media\\options_visibility_context:" .. 30 .. ":" .. 210 .. ":0:0:256:256:" .. (0) .. ":" .. (210) .. ":" .. (37) .. ":" .. (37+30) .. "|t",
},
{
type = "toggle",
get = function()
return WorldQuestTracker.db.profile.show_sort_button
end,
set = function(self, fixedparam, value)
WorldQuestTracker.db.profile.show_sort_button = not WorldQuestTracker.db.profile.show_sort_button
WorldQuestTracker.RefreshStatusBarButtons()
end,
name = "S_OPTIONS_SHOW_SORT_BUTTON",
desc = "|TInterface\\AddOns\\WorldQuestTracker\\media\\options_visibility_context:" .. 30 .. ":" .. 210 .. ":0:0:256:256:" .. (0) .. ":" .. (210) .. ":" .. (37) .. ":" .. (37+30) .. "|t",
},
{
type = "toggle",
get = function()
return WorldQuestTracker.db.profile.show_filter_button
end,
set = function(self, fixedparam, value)
WorldQuestTracker.db.profile.show_filter_button = not WorldQuestTracker.db.profile.show_filter_button
WorldQuestTracker.RefreshStatusBarButtons()
end,
name = "S_OPTIONS_SHOW_FILTER_BUTTON",
desc = "|TInterface\\AddOns\\WorldQuestTracker\\media\\options_visibility_context:" .. 30 .. ":" .. 210 .. ":0:0:256:256:" .. (0) .. ":" .. (210) .. ":" .. (37) .. ":" .. (37+30) .. "|t",
},
{
type = "toggle",
get = function()
return WorldQuestTracker.db.profile.show_warband_rep_warning
end,
set = function(self, fixedparam, value)
WorldQuestTracker.db.profile.show_warband_rep_warning = not WorldQuestTracker.db.profile.show_warband_rep_warning
if (WorldQuestTrackerAddon.GetCurrentZoneType() == "world") then
WorldQuestTracker.UpdateWorldQuestsOnWorldMap(true)
else
WorldQuestTracker.UpdateZoneWidgets(true)
end
end,
name = "S_OPTIONS_SHOW_WARBAND_REP_WARNING",
desc = "|TInterface\\AddOns\\WorldQuestTracker\\media\\options_visibility_context:" .. (71-45) .. ":" .. (239-213) .. ":0:0:256:256:" .. (213) .. ":" .. (239) .. ":" .. (45) .. ":" .. (71) .. "|t",
},
{type = "blank"},
{
type = "range",
get = function() return WorldQuestTracker.db.profile.world_summary_alpha end,
set = function(self, fixedparam, value)
WorldQuestTracker.db.profile.world_summary_alpha = value
WorldQuestTracker.UpdateZoneSummaryFrame()
WorldQuestTracker.RefreshZoneSummaryAlpha()
end,
min = 0.5,
max = 1,
step = 0.01,
usedecimals = true,
thumbscale = 1.8,
name = "S_OPTIONS_WORLD_SUMMARY_ALPHA",
desc = "S_OPTIONS_WORLD_SUMMARY_ALPHA",
},
{
type = "range",
get = function() return WorldQuestTracker.db.profile.worldmap_widget_alpha end,
set = function(self, fixedparam, value)
WorldQuestTracker.db.profile.worldmap_widget_alpha = value
local bForceUpdate = true
if (WorldQuestTrackerAddon.GetCurrentZoneType() == "world") then
WorldQuestTracker.UpdateWorldQuestsOnWorldMap(bForceUpdate)
else
WorldQuestTracker.UpdateZoneWidgets(bForceUpdate)
end
end,
min = 0.5,
max = 1,
step = 0.01,
usedecimals = true,
thumbscale = 1.8,
name = "S_OPTIONS_WORLDMAP_WIDGET_ALPHA",
desc = "S_OPTIONS_WORLDMAP_WIDGET_ALPHA",
},
{type = "blank"},
{
type = "label",
get = function() return "S_SPEEDRUN" end,
text_template = DF:GetTemplate("font", "ORANGE_FONT_TEMPLATE")
},
{
type = "toggle",
get = function()
return WorldQuestTracker.db.profile.speed_run.auto_accept
end,
set = function(self, fixedparam, value)
WorldQuestTracker.db.profile.speed_run.auto_accept = not WorldQuestTracker.db.profile.speed_run.auto_accept
WorldQuestTracker.RefreshStatusBarButtons()
end,
name = "S_SPEEDRUN_AUTO_ACCEPT",
desc = "S_SPEEDRUN_AUTO_ACCEPT",
},
{
type = "toggle",
get = function()
return WorldQuestTracker.db.profile.speed_run.auto_complete
end,
set = function(self, fixedparam, value)
WorldQuestTracker.db.profile.speed_run.auto_complete = not WorldQuestTracker.db.profile.speed_run.auto_complete
WorldQuestTracker.RefreshStatusBarButtons()
end,
name = "S_SPEEDRUN_AUTO_COMPLETE",
desc = "S_SPEEDRUN_AUTO_COMPLETE",
},
{
type = "toggle",
get = function()
return WorldQuestTracker.db.profile.speed_run.cancel_cinematic
end,
set = function(self, fixedparam, value)
WorldQuestTracker.db.profile.speed_run.cancel_cinematic = not WorldQuestTracker.db.profile.speed_run.cancel_cinematic
WorldQuestTracker.RefreshStatusBarButtons()
end,
name = "S_SPEEDRUN_CANCEL_CINEMATIC",
desc = "S_SPEEDRUN_CANCEL_CINEMATIC",
},
--
--map_frame_scale_enabled = false,
--map_frame_scale_mod = 1,
}
optionsTable.always_boxfirst = true
optionsTable.language_addonId = addonId
DF:BuildMenu(generalSettingsFrame, optionsTable, xStart, yStart, tabFrameHeight, false, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template, globalCallback)
end
do --Tracker Settings
local optionsTable = {
always_boxfirst = true,
language_addonId = addonId,
{
type = "toggle",
get = function()
return WorldQuestTracker.db.profile.use_tracker
end,
set = function(self, fixedparam, value)
WorldQuestTracker.SetSetting("use_tracker", value)
end,
name = "S_MAPBAR_OPTIONSMENU_QUESTTRACKER",
desc = "S_MAPBAR_OPTIONSMENU_QUESTTRACKER",
},
{
type = "toggle",
get = function()
return WorldQuestTracker.db.profile.show_yards_distance
end,
set = function(self, fixedparam, value)
WorldQuestTracker.SetSetting("show_yards_distance", value)
WorldQuestTracker.RefreshTrackerWidgets()
end,
name = "S_MAPBAR_OPTIONSMENU_YARDSDISTANCE",
desc = "S_MAPBAR_OPTIONSMENU_YARDSDISTANCE",
},
{
type = "toggle",
get = function()
return WorldQuestTracker.db.profile.tracker_only_currentmap
end,
set = function(self, fixedparam, value)
WorldQuestTracker.SetSetting("tracker_only_currentmap", value)
WorldQuestTracker.RefreshTrackerWidgets()
end,
name = "S_MAPBAR_OPTIONSMENU_TRACKER_CURRENTZONE",
desc = "S_MAPBAR_OPTIONSMENU_TRACKER_CURRENTZONE",
},
{
type = "toggle",
get = function()
return WorldQuestTracker.db.profile.tracker_show_time
end,
set = function(self, fixedparam, value)
WorldQuestTracker.SetSetting("tracker_show_time", value)
WorldQuestTracker.RefreshTrackerWidgets()
end,
name = "S_MAPBAR_SORTORDER_TIMELEFTPRIORITY_TITLE",
desc = "S_MAPBAR_SORTORDER_TIMELEFTPRIORITY_TITLE",
},
{
type = "range",
get = function() return WorldQuestTracker.db.profile.tracker_scale end,
set = function(self, fixedparam, value)
WorldQuestTracker.SetSetting("tracker_scale", value)
end,
min = 0.6,
max = 1.5,
step = 0.01,
usedecimals = true,
thumbscale = 1.8,
name = "S_MAPBAR_OPTIONSMENU_TRACKER_SCALE_NAME",
desc = "S_MAPBAR_OPTIONSMENU_TRACKER_SCALE_NAME",
},
{
type = "range",
get = function() return WorldQuestTracker.db.profile.tracker_textsize end,
set = function(self, fixedparam, value)
WorldQuestTracker.SetSetting("tracker_textsize", value)
end,
min = 8,
max = 15,
step = 1,
thumbscale = 1.8,
name = "S_TEXT_SIZE",
desc = "S_TEXT_SIZE",
},
{
type = "range",
get = function() return WorldQuestTracker.db.profile.arrow_update_frequence end,
set = function(self, fixedparam, value)
WorldQuestTracker.SetSetting("arrow_update_speed", value)
end,
min = 0,
max = 0.1,
step = 0.001,
usedecimals = true,
thumbscale = 1.8,
name = "S_MAPBAR_OPTIONSMENU_ARROWSPEED",
desc = "S_MAPBAR_OPTIONSMENU_ARROWSPEED",
},
{
type = "range",
get = function() return WorldQuestTracker.db.profile.tracker_background_alpha end,
set = function(self, fixedparam, value)
WorldQuestTracker.db.profile.tracker_background_alpha = value