-
Notifications
You must be signed in to change notification settings - Fork 5
/
GUI.lua
2775 lines (2504 loc) · 150 KB
/
GUI.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
-- Purpose: Namespace
local _, core = ... --Global addon namespace
local L = core.L --Global localisation table
core.Config = {} --Add a config table to the addon namespace
core.IATInfoFrame = {} --A frame for displaying useful information about the encounter during a fight without having to use chat channel
local InfoFrame
-- Purpose: Stores all the frames for each tab in the GUI.
local Config = core.Config
local IATInfoFrame = core.IATInfoFrame
local DragonflightContent
local DragonflightContentButtons = {}
local ShadowlandsContent
local ShadowlandsContentButtons = {}
local BattleForAzerothContent
local BattleForAzerothContentButtons = {}
local LegionContent
local LegionContentButtons = {}
local WarlordsOfDraenorContent
local WarlordsOfDraenorContentButtons = {}
local MistsOfPandariaContent
local MistsOfPandariaContentButtons = {}
local CataclysmContent
local CataclysmContentButtons = {}
local WrathOfTheLichKingContent
local WrathOfTheLichKingContentButtons = {}
local Left = nil
local Top = nil
local InfoFrameScale = nil
local InfoFrameTestBarsActive = false
--API
local IAT_InstanceLocation = nil
local IAT_InstanceType = nil
local IAT_CurrentTab = nil
-- Purpose: Stores information about the current status of the GUI
Config.currentTab = nil --Stores which tab is currently selected
Config.currentInstance = nil --Stores which instance is currently selected
-- Purpose: Stores information about the current options in the GUI
AchievementTrackerOptions = {}
-- Purpose: Stores NPC names
AchievementTrackerNPCCache = {}
AchievementTrackerNPCCacheClassic = {}
-- Purpose: Information about the current release. This is mianly used to detect which addon should output messages to chat to avoid spam
Config.majorVersion = 4 --Addon with a higher major version change have priority over a lower major version
Config.minorVersion = 44 --Addon with a minor version change have prioirty over a lower minor version
Config.revisionVersion = 0 --Addon with a revision change have the same priorty as a lower revision verison
Config.releaseType = "" --Release type (Alpha, Beta, Release)
Config.classicPhase = 5 --What phase classic realms are currently running
------------------------------------------------------
---- Game Versions
------------------------------------------------------
-- Purpose: Used to detect which version of the game the user is running. This is used so we can add features for different versions of the game.
core.gameVersion, core.gameBuild, core.gameDate, core.tocVersion = GetBuildInfo()
function getGameBuild()
core.gameVersionMajor, core.gameVersionMinor, core.gameVersionRevision = strsplit(".", core.gameVersion, 3)
core.gameVersionMajor = tonumber(core.gameVersionMajor)
core.gameVersionMinor = tonumber(core.gameVersionMinor)
core.gameVersionRevision = tonumber(core.gameVersionRevision)
end
------------------------------------------------------
---- Localisation
------------------------------------------------------
function Config:getLocalisedInstanceName(instanceID)
if core.gameVersionMajor > 3 then
return EJ_GetInstanceInfo(instanceID)
else
return ""
end
end
function Config:getLocalisedScenarioName(dungeonID)
--Scenario were introduced in patch 5 (MoP)
if core.gameVersionMajor >= 5 then
return C_LFGInfo.GetDungeonInfo(dungeonID).name
else
return ""
end
end
function Config:getLocalisedEncouterName(encounterID,instanceType)
if type(encounterID) == "table" then
--Decide if player is alliance or horde then return correct id
if UnitFactionGroup("player") == "Alliance" then
return EJ_GetEncounterInfo(encounterID[1])
else--Horde
return EJ_GetEncounterInfo(encounterID[2])
end
elseif tonumber(encounterID) then
if instanceType == "Scenarios" then
return getNPCName(encounterID)
else
return EJ_GetEncounterInfo(encounterID)
end
else
--The encounterID is actually string since there is no dungeon journal entry for this achievement
--This will happen for achievements that are not tied directly to a boss.
--Localised strings will be attached in the instances database
return encounterID
end
end
-- Method: Config:Toggle()
-- What it Does: Toggles the GUI to show or hide
-- Purpose: Checks whether the GUI is currently being shown and performs the opposite action
function Config:Toggle()
local GUI = UIConfig or Config:CreateGUI()
GUI:SetShown(not GUI:IsShown())
GameTooltip:Hide()
end
function Config:ToggleOn()
--Toggle on only
local GUI = UIConfig or Config:CreateGUI()
GUI:SetShown(true)
GameTooltip:Hide()
end
function IAT_GlobalToggle()
local GUI = UIConfig or Config:CreateGUI()
GUI:SetShown(not GUI:IsShown())
GameTooltip:Hide()
end
-- Method: Config:CreateButton()
-- What it Does: Create a new frame of type button
-- Purpose: This is used to create a frame which the specified paramters. Returns a button frame.
function Config:CreateButton(point, relativeFrame, relativePoint, yOffset, text, mapID)
local btn = CreateFrame("Button", nil, relativeFrame, "GameMenuButtonTemplate");
btn:SetPoint(point, relativeFrame, relativePoint, 0, yOffset);
btn:SetSize(200, 30);
btn:SetText(text);
btn:SetNormalFontObject("GameFontNormal");
btn:SetHighlightFontObject("GameFontHighlight");
if mapID ~= nil then --If the mapID paramters was passed, set the ID of the button the mapID
local mapID = tostring(mapID) --This is used so when the user clicks on the button we can fetch the
mapID = mapID:gsub('%-', '') --information relating to that ID from the instances table.
btn:SetID(tonumber(mapID))
end
return btn;
end
function Config:CreateButton2(point, relativeFrame, relativePoint, xOffset, yOffset, text)
local btn = CreateFrame("Button", nil, relativeFrame, "GameMenuButtonTemplate");
btn:SetPoint(point, relativeFrame, relativePoint, xOffset, yOffset);
btn:SetSize(200, 30);
btn:SetText(text);
btn:SetNormalFontObject("GameFontNormal");
btn:SetHighlightFontObject("GameFontHighlight");
return btn;
end
-- Method: Config:CreateCheckBox()
-- What it Does: Create a new frame of type checkbox
-- Purpose: This is used to create a frame which the specified paramters. Returns a checkbutton frame.
function Config:CreateCheckBox(point, relativeFrame, relativePoint, xOffset, yOffset, checkboxName)
local chk = CreateFrame("CheckButton", checkboxName, relativeFrame, "UICheckButtonTemplate")
chk:SetPoint(point, relativeFrame, relativePoint, xOffset, yOffset);
return chk;
end
function Config:CreateSlider(point, relativeFrame, relativePoint, xOffset, yOffset, sliderName)
local chk = CreateFrame("Slider", sliderName, relativeFrame, "OptionsSliderTemplate")
chk:SetPoint(point, relativeFrame, relativePoint, xOffset, yOffset);
return chk;
end
-- Method: Config:CreateText()
-- What it Does: Create a new frame of type fontstring
-- Purpose: This is used to put text on the GUI
function Config:CreateText(point, relativeFrame, relativePoint, xOffset, yOffset, textString)
local text = relativeFrame:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall")
text:SetPoint(point, relativeFrame, relativePoint, xOffset, yOffset)
text:SetText(textString)
return text
end
function Config:CreateText2(point, relativeFrame, relativePoint, xOffset, yOffset, textString, size)
local text = UIConfig:CreateFontString(nil, "OVERLAY", size)
text:SetPoint(point, relativeFrame, relativePoint, xOffset, yOffset)
text:SetText(textString)
return text
end
-- Method: Tab_OnClick()
-- What it Does: Event fired when the user clicks on a tab
-- Purpose: This is used to load the correct frames when clicking on each of the tabs
function Tab_OnClick(self)
Config.currentTab = self:GetID(); --Get the ID of the tab the user has selected.
if Config.currentTab == 10 then
--Dragonflight
PanelTemplates_SetTab(self:GetParent(), 2) --Changed the selected tab to the tab the user has just clicked on
elseif Config.currentTab == 9 then
--Shadowlands
PanelTemplates_SetTab(self:GetParent(), 3) --Changed the selected tab to the tab the user has just clicked on
elseif Config.currentTab == 8 then
--BFA
PanelTemplates_SetTab(self:GetParent(), 4) --Changed the selected tab to the tab the user has just clicked on
elseif Config.currentTab == 7 then
--Legion
PanelTemplates_SetTab(self:GetParent(), 5) --Changed the selected tab to the tab the user has just clicked on
elseif Config.currentTab == 6 then
--WoD
PanelTemplates_SetTab(self:GetParent(), 6) --Changed the selected tab to the tab the user has just clicked on
elseif Config.currentTab == 5 then
--Panda
PanelTemplates_SetTab(self:GetParent(), 7) --Changed the selected tab to the tab the user has just clicked on
elseif Config.currentTab == 4 then
--Cata
PanelTemplates_SetTab(self:GetParent(), 8) --Changed the selected tab to the tab the user has just clicked on
elseif Config.currentTab == 3 then
--WoTLK
PanelTemplates_SetTab(self:GetParent(), 9)
else
PanelTemplates_SetTab(self:GetParent(), self:GetID()) --Changed the selected tab to the tab the user has just clicked on
end
--This scrollframe holds the button for each instances shown on the expansion tabs
--If this scrollframe is currently being shown then hide it and shown the correct frame for the tab that has just been clicked
local scrollChild = UIConfig.ScrollFrame:GetScrollChild()
if scrollChild then
scrollChild:Hide()
end
UIConfig.ScrollFrame:SetScrollChild(self.content)
--This scrollframe holds the tactics, achievements and players for the selected instance.
--If this scrollframe is currently being shown then hide it and shown the correct frame for the tab that has just been clicked
local scrollChild2 = UIConfig.ScrollFrame2:GetScrollChild()
if scrollChild2 then
scrollChild2:Hide()
end
if Config.currentTab > 1 then
UIConfig.ScrollFrame2:SetScrollChild(self.contenta)
end
--Show the content for the selected instances
self.content:Show()
if self.contenta ~= nil then
self.contenta:Show()
end
if Config.currentTab == 1 then --User has clicked on the "Main" tab
UIConfig.ScrollFrame:Hide()
UIConfig.ScrollFrame2:Hide()
if UIConfig.Main then --Main tab frames have already been created so just shown them.
UIConfig.Main:Show()
UIConfig.Main2:Show()
-- UIConfig.Main2.features:Show()
-- UIConfig.Main2.features1:Show()
-- UIConfig.Main2.features2:Show()
-- UIConfig.Main2.features3:Show()
-- UIConfig.Main2.features4:Show()
-- UIConfig.Main2.features5:Show()
-- UIConfig.Main2.features6:Show()
UIConfig.Main2.options:Show()
UIConfig.Main2.options:Show()
UIConfig.Main2.options2:Show()
UIConfig.Main2.options3:Show()
UIConfig.Main2.options4:Show()
UIConfig.Main2.options5:Show()
UIConfig.Main2.options6:Show()
UIConfig.Main2.options7:Show()
UIConfig.Main2.options8:Show()
UIConfig.Main2.options9:Show()
UIConfig.Main2.options10:Show()
UIConfig.Main2.options11:Show()
UIConfig.Main2.options12:Show()
UIConfig.Main2.options012:Show()
UIConfig.Main2.options013:Show()
UIConfig.Main2.options13:Show()
-- UIConfig.Main2.options14:Show()
UIConfig.Main2.options15:Show()
-- UIConfig.Main2.options16:Show()
UIConfig.Main2.options17:Show()
UIConfig.Main2.options18:Show()
UIConfig.Main2.options19:Show()
UIConfig.Main2.options20:Show()
UIConfig.Main2.options21:Show()
UIConfig.Main2.options22:Show()
UIConfig.Main2.options23:Show()
UIConfig.Main2.options24:Show()
UIConfig.Main2.options25:Show()
UIConfig.Main2.options26:Show()
UIConfig.Main2.options27:Show()
UIConfig.Main2.options28:Show()
UIConfig.Main2.options29:Show()
UIConfig.Main2.options30:Show()
UIConfig.Main2.options31:Show()
UIConfig.Main2.options32:Show()
UIConfig.Main2.options33:Show()
UIConfig.Main2.options34:Show()
-- UIConfig.Main2.options35:Show()
-- UIConfig.Main2.options36:Show()
-- UIConfig.Main2.options37:Show()
UIConfig.Main.author:Show()
UIConfig.Main.tacticsCredit:Show()
UIConfig.Main.verison:Show()
UIConfig.Main2.content:Show()
UIConfig.Main2.content2:Show()
UIConfig.Main2.credits:Show()
UIConfig.Main2.credits2:Show()
UIConfig.Main2.credits3:Show()
if UIConfig.Main.translators ~= nil then
UIConfig.Main.translators:Show()
end
if UIConfig.achievementsCompleted ~= nil then
UIConfig.achievementsCompleted:Hide()
end
else --Main tab frames have not been created so need to create frames first before showing.
--Heading
UIConfig.Main = Config:CreateText2("TOP", AchievementTrackerDialogBG, "TOP", 0, -10, "Instance Achievement Tracker", "GameFontNormalLarge")
UIConfig.Main:SetWidth(750)
--Author & Translators
if (GetLocale() == "enGB" or GetLocale() == "enUS") then
UIConfig.Main.author = Config:CreateText2("BOTTOMRIGHT", AchievementTrackerDialogBG, "BOTTOMRIGHT", -5, 20, L["GUI_Author"] .. ": (EU) Whizzey-Doomhammer","GameFontNormal")
UIConfig.Main.tacticsCredit = Config:CreateText2("BOTTOMRIGHT", AchievementTrackerDialogBG, "BOTTOMRIGHT", -5, 5,L["GUI_Tactics"] .. ": " .. L["Gui_TacticsNames"],"GameFontNormal")
else
UIConfig.Main.author = Config:CreateText2("BOTTOMRIGHT", AchievementTrackerDialogBG, "BOTTOMRIGHT", -5, 35, L["GUI_Author"] .. ": (EU) Whizzey-Doomhammer","GameFontNormal")
UIConfig.Main.translators = Config:CreateText2("BOTTOMRIGHT", AchievementTrackerDialogBG, "BOTTOMRIGHT", -5, 20,L["GUI_Translators"] .. ": " .. L["Gui_TranslatorNames"],"GameFontNormal")
UIConfig.Main.tacticsCredit = Config:CreateText2("BOTTOMRIGHT", AchievementTrackerDialogBG, "BOTTOMRIGHT", -5, 5,L["GUI_Tactics"] .. ": " .. L["Gui_TacticsNames"],"GameFontNormal")
end
--Version
UIConfig.Main.verison = Config:CreateText2("BOTTOMLEFT", AchievementTrackerDialogBG, "BOTTOMLEFT", 5, 5, "v" .. Config.majorVersion .. "." .. Config.minorVersion .. "." .. Config.revisionVersion .. Config.releaseType,"GameFontNormal")
--Currently tracking
UIConfig.Main2 = Config:CreateText2("TOPLEFT", UIConfig.Main, "TOPLEFT", 0, -45, L["GUI_TrackingNumber"] .. ":","GameFontNormalLarge")
UIConfig.Main2:SetWidth(300)
UIConfig.Main2:SetJustifyH("LEFT")
--Work out how many achievements and tactics are currently being tracked
local achievementsTracked = 0
local tacticsTracked = 0
local totalCount = 0
for expansion, _ in pairs(core.Instances) do
for instanceType, _ in pairs(core.Instances[expansion]) do
for instance, _ in pairs(core.Instances[expansion][instanceType]) do
for boss, _ in pairs(core.Instances[expansion][instanceType][instance]) do
if string.match(boss, "boss") then
if core.Instances[expansion][instanceType][instance][boss].track ~= nil then
achievementsTracked = achievementsTracked + 1
end
if #core.Instances[expansion][instanceType][instance][boss].tactics > 1 then
tacticsTracked = tacticsTracked + 1
end
totalCount = totalCount + 1
end
end
end
end
end
UIConfig.Main2.content = Config:CreateText2("TOPLEFT", UIConfig.Main2, "TOPLEFT", 0, -20, achievementsTracked .. " " .. L["GUI_Achievements"] .. " (" .. tonumber(string.format("%.0f", (achievementsTracked/totalCount)*100)) .. "%)","GameFontHighlight")
UIConfig.Main2.content2 = Config:CreateText2("TOPLEFT", UIConfig.Main2.content, "TOPLEFT", 0, -15, tacticsTracked .. " " .. L["GUI_Tactics"] .. " (" .. tonumber(string.format("%.0f", (tacticsTracked/totalCount)*100)) .. "%)","GameFontHighlight")
-- --Features
-- UIConfig.Main2.features = Config:CreateText2("TOPLEFT", UIConfig.Main2.content, "TOPLEFT", 0, -40, L["Features"] .. ":","GameFontNormalLarge")
-- UIConfig.Main2.features:SetWidth(750)
-- UIConfig.Main2.features:SetJustifyH("LEFT")
-- UIConfig.Main2.features1 = Config:CreateText2("TOPLEFT", UIConfig.Main2.features, "TOPLEFT", 0, -20, L["- Tracks when the criteria of instance achievements have been met and output this to chat"],"GameFontHighlight")
-- UIConfig.Main2.features2 = Config:CreateText2("TOPLEFT", UIConfig.Main2.features1, "TOPLEFT", 0, -20, L["- Tracks when the criteria of instance achievements has been failed and outputs this to chat"],"GameFontHighlight")
-- UIConfig.Main2.features3 = Config:CreateText2("TOPLEFT", UIConfig.Main2.features2, "TOPLEFT", 0, -20, L["- Keeps track of achievements which require you to kill so many mobs within a certain time period. It will announce to chat when enough mobs have spawned and whether they were killed in the time period."],"GameFontHighlight")
-- UIConfig.Main2.features4 = Config:CreateText2("TOPLEFT", UIConfig.Main2.features3, "TOPLEFT", 0, -30, L["- Scans all players in the group to see which achievements each player is missing for the current instance"],"GameFontHighlight")
-- UIConfig.Main2.features5 = Config:CreateText2("TOPLEFT", UIConfig.Main2.features4, "TOPLEFT", 0, -20, L["- Announce to chat players who are missing achievements for certain bosses"],"GameFontHighlight")
-- UIConfig.Main2.features6 = Config:CreateText2("TOPLEFT", UIConfig.Main2.features5, "TOPLEFT", 0, -20, L["- Announce to chat tactics for a certain boss"],"GameFontHighlight")
-- UIConfig.Main2.features3:SetWidth(750)
-- UIConfig.Main2.features3:SetJustifyH("LEFT")
--Options
UIConfig.Main2.options = Config:CreateText2("TOPLEFT", UIConfig.Main2.content2, "TOPLEFT", 0, -30, L["GUI_Options"] .. ":","GameFontNormalLarge")
UIConfig.Main2.options:SetWidth(750)
UIConfig.Main2.options:SetJustifyH("LEFT")
--Enable Addon
UIConfig.Main2.options2 = Config:CreateCheckBox("TOPLEFT", UIConfig, "TOPLEFT", 20, -160, "AchievementTracker_EnableAddon")
UIConfig.Main2.options2:SetScript("OnClick", enableAddon_OnClick)
UIConfig.Main2.options3 = Config:CreateText2("TOPLEFT", UIConfig, "TOPLEFT", 51, -170, L["GUI_EnableAddon"],"GameFontHighlight")
UIConfig.Main2.options2:SetScript("OnEnter", function(self)
GameTooltip:SetOwner(self, "ANCHOR_TOPRIGHT")
GameTooltip:SetText(L["GUI_EnableAddonDescription"],1.0,0.82,0.0,1,true)
GameTooltip:Show()
end)
UIConfig.Main2.options2:SetScript("OnLeave", function(self)
GameTooltip:Hide()
end)
--Toggle Minimap Icon
UIConfig.Main2.options4 = Config:CreateCheckBox("TOPLEFT", UIConfig.Main2.options2, "TOPLEFT", 0, -25, "AchievementTracker_ToggleMinimapIcon")
UIConfig.Main2.options4:SetScript("OnClick", ATToggleMinimapIcon_OnClick)
UIConfig.Main2.options5 = Config:CreateText2("TOPLEFT", UIConfig.Main2.options4, "TOPLEFT", 30, -9, L["GUI_ToggleMinimap"],"GameFontHighlight")
UIConfig.Main2.options4:SetScript("OnEnter", function(self)
GameTooltip:SetOwner(self, "ANCHOR_TOPRIGHT")
GameTooltip:SetText(L["GUI_ShowMimapButtonDescription"],1.0,0.82,0.0,1,true)
GameTooltip:Show()
end)
UIConfig.Main2.options4:SetScript("OnLeave", function(self)
GameTooltip:Hide()
end)
--Link achievements being tracked for current boss to chat
UIConfig.Main2.options6 = Config:CreateCheckBox("TOPLEFT", UIConfig.Main2.options4, "TOPLEFT", 0, -25, "AchievementTracker_ToggleAchievementAnnounce")
UIConfig.Main2.options6:SetScript("OnClick", ATToggleAchievementAnnounce_OnClick)
UIConfig.Main2.options7 = Config:CreateText2("TOPLEFT", UIConfig.Main2.options6, "TOPLEFT", 30, -9, L["GUI_AnnounceTracking"],"GameFontHighlight")
UIConfig.Main2.options7:SetWordWrap(true)
UIConfig.Main2.options7:SetWidth(320)
UIConfig.Main2.options7:SetJustifyH("LEFT")
UIConfig.Main2.options6:SetScript("OnEnter", function(self)
GameTooltip:SetOwner(self, "ANCHOR_TOPRIGHT")
GameTooltip:SetText(L["GUI_AnnounceAchievementsToGroupDescription"],1.0,0.82,0.0,1,true)
GameTooltip:Show()
end)
UIConfig.Main2.options6:SetScript("OnLeave", function(self)
GameTooltip:Hide()
end)
--Only track achievements in the group that players need.
--Note this will only track achievements if players need them account wide not character wide
--If players have achievements hidden then tracking may not start as intended
UIConfig.Main2.options8 = Config:CreateCheckBox("TOPLEFT", UIConfig.Main2.options6, "TOPLEFT", 0, -25, "AchievementTracker_ToggleTrackMissingAchievementsOnly")
UIConfig.Main2.options8:SetScript("OnClick", ATToggleTrackMissingAchievementsOnly_OnClick)
UIConfig.Main2.options9 = Config:CreateText2("TOPLEFT", UIConfig.Main2.options8, "TOPLEFT", 30, -9, L["GUI_OnlyTrackMissingAchievements"],"GameFontHighlight")
UIConfig.Main2.options8:SetScript("OnEnter", function(self)
GameTooltip:SetOwner(self, "ANCHOR_TOPRIGHT")
GameTooltip:SetText(L["GUI_OnlyTrackMissingAchievementsDescription"],1.0,0.82,0.0,1,true)
GameTooltip:Show()
end)
UIConfig.Main2.options8:SetScript("OnLeave", function(self)
GameTooltip:Hide()
end)
--Announce messages to Raid Warning if player has permission
UIConfig.Main2.options10 = Config:CreateCheckBox("TOPLEFT", UIConfig.Main2.options8, "TOPLEFT", 0, -25, "AchievementTracker_ToggleAnnounceToRaidWarning")
UIConfig.Main2.options10:SetScript("OnClick", ATToggleAnnounceToRaidWarning_OnClick)
UIConfig.Main2.options11 = Config:CreateText2("TOPLEFT", UIConfig.Main2.options10, "TOPLEFT", 30, -9, L["GUI_AnnounceMessagesToRaidWarning"],"GameFontHighlight")
UIConfig.Main2.options10:SetScript("OnEnter", function(self)
GameTooltip:SetOwner(self, "ANCHOR_TOPRIGHT")
GameTooltip:SetText(L["GUI_AnnounceMessagesToRaidWarningDescription"],1.0,0.82,0.0,1,true)
GameTooltip:Show()
end)
UIConfig.Main2.options10:SetScript("OnLeave", function(self)
GameTooltip:Hide()
end)
--Links to current guides and achievement discord credit for tactics
UIConfig.Main2.credits = Config:CreateText2("TOPRIGHT",UIConfig, "TOPRIGHT", -10, -70, L["GUI_AchievementsDiscordTitle"] .. ":","GameFontNormalLarge")
UIConfig.Main2.credits:SetWidth(400)
UIConfig.Main2.credits:SetJustifyH("LEFT")
UIConfig.Main2.credits2 = Config:CreateText2("TOPRIGHT", UIConfig.Main2.credits, "BOTTOMRIGHT", 0, -5, "https://discord.gg/achievements","GameFontNormal")
UIConfig.Main2.credits2:SetWidth(400)
UIConfig.Main2.credits2:SetJustifyH("LEFT")
UIConfig.Main2.credits3 = Config:CreateText2("TOPRIGHT", UIConfig.Main2.credits2, "BOTTOMRIGHT", 0, -5, L["GUI_AchievementsDiscordDescription"],"GameFontHighlight")
UIConfig.Main2.credits3:SetWidth(400)
UIConfig.Main2.credits3:SetJustifyH("LEFT")
--Make a sound when an achievement has been completed
UIConfig.Main2.options12 = Config:CreateCheckBox("TOPLEFT", UIConfig.Main2.options10, "TOPLEFT", 0, -25, "AchievementTracker_ToggleSound")
UIConfig.Main2.options12:SetScript("OnClick", ATToggleSound_OnClick)
UIConfig.Main2.options13 = Config:CreateText2("TOPLEFT", UIConfig.Main2.options12, "TOPLEFT", 30, -9, L["GUI_PlaySoundOnSuccess"],"GameFontHighlight")
UIConfig.Main2.options12:SetScript("OnEnter", function(self)
GameTooltip:SetOwner(self, "ANCHOR_TOPRIGHT")
GameTooltip:SetText(L["GUI_PlaySoundOnCompletionDescription"],1.0,0.82,0.0,1,true)
GameTooltip:Show()
end)
UIConfig.Main2.options12:SetScript("OnLeave", function(self)
GameTooltip:Hide()
end)
--Dropdown menu to select sound for completed Achievement
UIConfig.Main2.options15 = MSA_DropDownMenu_Create("AchievementTracker_SelectSoundDropdownCompleted", UIConfig.Main2.options12)
UIConfig.Main2.options15:SetPoint("TOPLEFT", UIConfig.Main2.options12, "TOPLEFT", UIConfig.Main2.options13:GetStringWidth() + 30, 0)
MSA_DropDownMenu_SetWidth(UIConfig.Main2.options15, 100)
MSA_DropDownMenu_SetText(UIConfig.Main2.options15, L["GUI_SelectSound"])
MSA_DropDownMenu_Initialize(UIConfig.Main2.options15, function(self, level, menuList)
local info = MSA_DropDownMenu_CreateInfo()
info.func = AchievementTracker_SelectSoundCompleted
for i=1,13 do
info.text = "Sound: " .. i
info.menuList = i
info.value = i
info.arg1 = i
info.arg2 = UIConfig.Main2.options15
MSA_DropDownMenu_AddButton(info)
end
end)
--Make a sound when an achievement has been failed
UIConfig.Main2.options012 = Config:CreateCheckBox("TOPLEFT", UIConfig.Main2.options12, "TOPLEFT", 0, -25, "AchievementTracker_ToggleSoundFailed")
UIConfig.Main2.options012:SetScript("OnClick", ATToggleSoundFailed_OnClick)
UIConfig.Main2.options013 = Config:CreateText2("TOPLEFT", UIConfig.Main2.options012, "TOPLEFT", 30, -9, L["GUI_PlaySoundOnFailed"],"GameFontHighlight")
UIConfig.Main2.options012:SetScript("OnEnter", function(self)
GameTooltip:SetOwner(self, "ANCHOR_TOPRIGHT")
GameTooltip:SetText(L["GUI_PlaySoundOnFailDescription"],1.0,0.82,0.0,1,true)
GameTooltip:Show()
end)
UIConfig.Main2.options012:SetScript("OnLeave", function(self)
GameTooltip:Hide()
end)
--Dropdown menu to select sound for failed Achievement
UIConfig.Main2.options17 = MSA_DropDownMenu_Create("AchievementTracker_SelectSoundDropdownFailed", UIConfig.Main2.options012)
UIConfig.Main2.options17:SetPoint("TOPLEFT", UIConfig.Main2.options012, "TOPLEFT", UIConfig.Main2.options013:GetStringWidth() + 30, 0)
MSA_DropDownMenu_SetWidth(UIConfig.Main2.options17, 100)
MSA_DropDownMenu_SetText(UIConfig.Main2.options17, L["GUI_SelectSound"])
MSA_DropDownMenu_Initialize(UIConfig.Main2.options17, function(self, level, menuList)
local info = MSA_DropDownMenu_CreateInfo()
info.func = AchievementTracker_SelectSoundFailed
for i=1,11 do
info.text = "Sound: " .. i
info.menuList = i
info.value = i
info.arg1 = i
info.arg2 = UIConfig.Main2.options17
MSA_DropDownMenu_AddButton(info)
end
end)
--Hide completed achievements
UIConfig.Main2.options18 = Config:CreateCheckBox("TOPLEFT", UIConfig.Main2.options012, "TOPLEFT", 0, -25, "AchievementTracker_HideCompletedAchievements")
UIConfig.Main2.options18:SetScript("OnClick", ATToggleHideCompletedAchievements_OnClick)
UIConfig.Main2.options19 = Config:CreateText2("TOPLEFT", UIConfig.Main2.options18, "TOPLEFT", 30, -9, L["GUI_HideCompletedAchievements"],"GameFontHighlight")
UIConfig.Main2.options18:SetScript("OnEnter", function(self)
GameTooltip:SetOwner(self, "ANCHOR_TOPRIGHT")
GameTooltip:SetText(L["GUI_HideCompletedAchievementsDescription"],1.0,0.82,0.0,1,true)
GameTooltip:Show()
end)
UIConfig.Main2.options18:SetScript("OnLeave", function(self)
GameTooltip:Hide()
end)
--Grey out completed achievements
UIConfig.Main2.options20 = Config:CreateCheckBox("TOPLEFT", UIConfig.Main2.options18, "TOPLEFT", 0, -25, "AchievementTracker_GreyOutCompletedAchievements")
UIConfig.Main2.options20:SetScript("OnClick", ATToggleGreyOutCompletedAchievements_OnClick)
UIConfig.Main2.options21 = Config:CreateText2("TOPLEFT", UIConfig.Main2.options20, "TOPLEFT", 30, -9, L["GUI_GreyOutCompletedAchievements"],"GameFontHighlight")
UIConfig.Main2.options20:SetScript("OnEnter", function(self)
GameTooltip:SetOwner(self, "ANCHOR_TOPRIGHT")
GameTooltip:SetText(L["GUI_GreyOutCompletedAchievementsDescription"],1.0,0.82,0.0,1,true)
GameTooltip:Show()
end)
UIConfig.Main2.options20:SetScript("OnLeave", function(self)
GameTooltip:Hide()
end)
-- UIConfig.Main2.options20:Hide()
-- UIConfig.Main2.options21:Hide()
--Enable Automatic Combat Logging
UIConfig.Main2.options22 = Config:CreateCheckBox("TOPLEFT", UIConfig.Main2.options20, "TOPLEFT", 0, -25, "AchievementTracker_EnableAutomaticCombatLogging")
UIConfig.Main2.options22:SetScript("OnClick", ATToggleAutomaticCombatLogging_OnClick)
UIConfig.Main2.options23 = Config:CreateText2("TOPLEFT", UIConfig.Main2.options22, "TOPLEFT", 30, -9, L["GUI_EnableAutomaticCombatLogging"],"GameFontHighlight")
UIConfig.Main2.options22:SetScript("OnEnter", function(self)
GameTooltip:SetOwner(self, "ANCHOR_TOPRIGHT")
GameTooltip:SetText(L["GUI_EnableCombatLogDescription"],1.0,0.82,0.0,1,true)
GameTooltip:Show()
end)
UIConfig.Main2.options22:SetScript("OnLeave", function(self)
GameTooltip:Hide()
end)
--Disable InfoFrame
UIConfig.Main2.options24 = Config:CreateCheckBox("TOPLEFT", UIConfig.Main2.options22, "TOPLEFT", 0, -25, "AchievementTracker_DisplayInfoFrame")
UIConfig.Main2.options24:SetScript("OnClick", ATToggleInfoFrame_OnClick)
UIConfig.Main2.options25 = Config:CreateText2("TOPLEFT", UIConfig.Main2.options24, "TOPLEFT", 30, -9, L["GUI_DisplayInfoFrame"],"GameFontHighlight")
UIConfig.Main2.options24:SetScript("OnEnter", function(self)
GameTooltip:SetOwner(self, "ANCHOR_TOPRIGHT")
GameTooltip:SetText(L["GUI_EnableInfoFrameDescription"],1.0,0.82,0.0,1,true)
GameTooltip:Show()
end)
UIConfig.Main2.options24:SetScript("OnLeave", function(self)
GameTooltip:Hide()
end)
--Track missing achievements in Blizzard UI
UIConfig.Main2.options26 = Config:CreateCheckBox("TOPLEFT", UIConfig.Main2.options24, "TOPLEFT", 0, -25, "AchievementTracker_TrackAchievementsInBlizzardUI")
UIConfig.Main2.options26:SetScript("OnClick", ATToggleTrackAchievementsInBlizzardUI_OnClick)
UIConfig.Main2.options27 = Config:CreateText2("TOPLEFT", UIConfig.Main2.options26, "TOPLEFT", 30, -9, L["GUI_TrackAchievementsInBlizzardUI"],"GameFontHighlight")
UIConfig.Main2.options26:SetScript("OnEnter", function(self)
GameTooltip:SetOwner(self, "ANCHOR_TOPRIGHT")
GameTooltip:SetText(L["GUI_TrackAchievementsInUIDescription"],1.0,0.82,0.0,1,true)
GameTooltip:Show()
end)
UIConfig.Main2.options26:SetScript("OnLeave", function(self)
GameTooltip:Hide()
end)
--Track achievements completed by player instead of account
UIConfig.Main2.options28 = Config:CreateCheckBox("TOPLEFT", UIConfig.Main2.options2, "TOPLEFT", 363, 0, "AchievementTracker_TrackCharacterAchievements")
UIConfig.Main2.options28:SetScript("OnClick", ATToggleTrackCharacterAchievements_OnClick)
UIConfig.Main2.options29 = Config:CreateText2("TOPLEFT", UIConfig.Main2.options28, "TOPLEFT", 30, -9, L["GUI_TrackCharacterAchievements"],"GameFontHighlight")
UIConfig.Main2.options29:SetWordWrap(true)
UIConfig.Main2.options29:SetWidth(400)
UIConfig.Main2.options29:SetJustifyH("LEFT")
UIConfig.Main2.options28:SetScript("OnEnter", function(self)
GameTooltip:SetOwner(self, "ANCHOR_TOPRIGHT")
GameTooltip:SetText(L["GUI_TrackChararcterAchievementsDescription"],1.0,0.82,0.0,1,true)
GameTooltip:Show()
end)
UIConfig.Main2.options28:SetScript("OnLeave", function(self)
GameTooltip:Hide()
end)
--Track achievement automatically upon entering a compatible instance
UIConfig.Main2.options30 = Config:CreateCheckBox("TOPLEFT", UIConfig.Main2.options28, "TOPLEFT", 0, -25, "AchievementTracker_TrackAchievementsAutomatically")
UIConfig.Main2.options30:SetScript("OnClick", ATToggleTrackAchievementsAutomatically_OnClick)
UIConfig.Main2.options31 = Config:CreateText2("TOPLEFT", UIConfig.Main2.options30, "TOPLEFT", 30, -9, L["GUI_TrackAchievementsAutomatically"],"GameFontHighlight")
UIConfig.Main2.options31:SetWordWrap(true)
UIConfig.Main2.options31:SetWidth(400)
UIConfig.Main2.options31:SetJustifyH("LEFT")
UIConfig.Main2.options30:SetScript("OnEnter", function(self)
GameTooltip:SetOwner(self, "ANCHOR_TOPRIGHT")
GameTooltip:SetText(L["GUI_TrackAchievementsAutomaticallyDescription"],1.0,0.82,0.0,1,true)
GameTooltip:Show()
end)
UIConfig.Main2.options30:SetScript("OnLeave", function(self)
GameTooltip:Hide()
end)
--Change Minimap icon when addon is enabled/disabled
UIConfig.Main2.options32 = Config:CreateCheckBox("TOPLEFT", UIConfig.Main2.options30, "TOPLEFT", 0, -25, "AchievementTracker_ChangeMinimapIcon")
UIConfig.Main2.options32:SetScript("OnClick", ATToggleChangeMinimapIcon_OnClick)
UIConfig.Main2.options33 = Config:CreateText2("TOPLEFT", UIConfig.Main2.options32, "TOPLEFT", 30, -9, L["GUI_ChangeMinimapIcon"],"GameFontHighlight")
UIConfig.Main2.options33:SetWordWrap(true)
UIConfig.Main2.options33:SetWidth(400)
UIConfig.Main2.options33:SetJustifyH("LEFT")
UIConfig.Main2.options32:SetScript("OnEnter", function(self)
GameTooltip:SetOwner(self, "ANCHOR_TOPRIGHT")
GameTooltip:SetText(L["GUI_ChangeMinimapIconDescription"],1.0,0.82,0.0,1,true)
GameTooltip:Show()
end)
UIConfig.Main2.options32:SetScript("OnLeave", function(self)
GameTooltip:Hide()
end)
--Show/Hide InfoFrame
UIConfig.Main2.options34 = Config:CreateButton2("TOPLEFT", UIConfig.Main2.options32, "TOPLEFT", 0, -35, L["GUI_ToggleInfoFrameTestFrame"])
UIConfig.Main2.options34:SetWidth(UIConfig.Main2.options34:GetTextWidth() + 10)
UIConfig.Main2.options34:SetScript("OnClick", ATToggleShowInfoFrameTestFrame_OnClick)
UIConfig.Main2.options34:SetScript("OnEnter", function(self)
GameTooltip:SetOwner(self, "ANCHOR_TOPRIGHT")
GameTooltip:SetText(L["GUI_ToggleInfoFrameTestFrameDescription"],1.0,0.82,0.0,1,true)
GameTooltip:Show()
end)
UIConfig.Main2.options34:SetScript("OnLeave", function(self)
GameTooltip:Hide()
end)
-- --Make a sound whxen an achievement has been failed
-- UIConfig.Main2.options35 = Config:CreateCheckBox("TOPLEFT", UIConfig.Main2.options34, "TOPLEFT", 0, -25, "AchievementTracker_ToggleLocalisation")
-- UIConfig.Main2.options35:SetScript("OnClick", ATToggleSoundFailed_OnClick)
-- UIConfig.Main2.options36 = Config:CreateText2("TOPLEFT", UIConfig.Main2.options35, "TOPLEFT", 30, -9, L["GUI_SelectLocalisation"],"GameFontHighlight")
-- UIConfig.Main2.options35:SetScript("OnEnter", function(self)
-- GameTooltip:SetOwner(self, "ANCHOR_TOPRIGHT")
-- GameTooltip:SetText(L["GUI_SelectLocalisationDescription"],1.0,0.82,0.0,1,true)
-- GameTooltip:Show()
-- end)
-- UIConfig.Main2.options35:SetScript("OnLeave", function(self)
-- GameTooltip:Hide()
-- end)
-- --Dropdown menu to select sound for failed Achievement
-- UIConfig.Main2.options37 = MSA_DropDownMenu_Create("AchievementTracker_SelectLocalisationDropdown", UIConfig.Main2.options35)
-- UIConfig.Main2.options37:SetPoint("TOPLEFT", UIConfig.Main2.options35, "TOPLEFT", UIConfig.Main2.options36:GetStringWidth() + 30, 0)
-- MSA_DropDownMenu_SetWidth(UIConfig.Main2.options37, 100)
-- MSA_DropDownMenu_SetText(UIConfig.Main2.options37, L["GUI_Automatic"])
-- MSA_DropDownMenu_Initialize(UIConfig.Main2.options37, function(self, level, menuList)
-- local info = MSA_DropDownMenu_CreateInfo()
-- info.func = AchievementTracker_SelectLocalisation
-- local languages = {L["GUI_Automatic"],_G["ENGB"],_G["DEDE"],_G["ESES"],_G["RURU"],_G["FRFR"],_G["ZHCN"],_G["ZHTW"]}
-- for i=1,#languages do
-- info.text = languages[i]
-- info.menuList = i
-- info.value = i
-- info.arg1 = languages[i]
-- info.arg2 = UIConfig.Main2.options37
-- info.arg3 = i
-- MSA_DropDownMenu_AddButton(info)
-- end
-- end)
end
else --User has selected an expansion tab so hide main menu options
UIConfig.ScrollFrame:Show()
UIConfig.ScrollFrame2:Show()
UIConfig.Main:Hide()
UIConfig.Main2:Hide()
-- UIConfig.Main2.features:Hide()
-- UIConfig.Main2.features1:Hide()
-- UIConfig.Main2.features2:Hide()
-- UIConfig.Main2.features3:Hide()
-- UIConfig.Main2.features4:Hide()
-- UIConfig.Main2.features5:Hide()
-- UIConfig.Main2.features6:Hide()
UIConfig.Main2.options:Hide()
UIConfig.Main2.options:Hide()
UIConfig.Main2.options2:Hide()
UIConfig.Main2.options3:Hide()
UIConfig.Main2.options4:Hide()
UIConfig.Main2.options5:Hide()
UIConfig.Main2.options6:Hide()
UIConfig.Main2.options7:Hide()
UIConfig.Main2.options8:Hide()
UIConfig.Main2.options9:Hide()
UIConfig.Main2.options10:Hide()
UIConfig.Main2.options11:Hide()
UIConfig.Main2.options12:Hide()
UIConfig.Main2.options012:Hide()
UIConfig.Main2.options013:Hide()
UIConfig.Main2.options13:Hide()
-- UIConfig.Main2.options14:Hide()
UIConfig.Main2.options15:Hide()
-- UIConfig.Main2.options16:Hide()
UIConfig.Main2.options17:Hide()
UIConfig.Main2.options18:Hide()
UIConfig.Main2.options19:Hide()
UIConfig.Main2.options20:Hide()
UIConfig.Main2.options21:Hide()
UIConfig.Main2.options22:Hide()
UIConfig.Main2.options23:Hide()
UIConfig.Main2.options24:Hide()
UIConfig.Main2.options25:Hide()
UIConfig.Main2.options26:Hide()
UIConfig.Main2.options27:Hide()
UIConfig.Main2.options28:Hide()
UIConfig.Main2.options29:Hide()
UIConfig.Main2.options30:Hide()
UIConfig.Main2.options31:Hide()
UIConfig.Main2.options32:Hide()
UIConfig.Main2.options33:Hide()
UIConfig.Main2.options34:Hide()
-- UIConfig.Main2.options35:Hide()
-- UIConfig.Main2.options36:Hide()
-- UIConfig.Main2.options37:Hide()
UIConfig.Main.author:Hide()
UIConfig.Main.verison:Hide()
UIConfig.Main.tacticsCredit:Hide()
UIConfig.Main2.content:Hide()
UIConfig.Main2.content2:Hide()
UIConfig.Main2.credits:Hide()
UIConfig.Main2.credits2:Hide()
UIConfig.Main2.credits3:Hide()
if UIConfig.Main.translators ~= nil then
UIConfig.Main.translators:Hide()
end
if UIConfig.achievementsCompleted ~= nil then
UIConfig.achievementsCompleted:Hide()
end
end
end
-- function AchievementTracker_SelectLocalisation(self, arg1, arg2, arg3, checked)
-- AchievementTrackerOptions["localisationOption"] = arg1
-- AchievementTrackerOptions["localisationOptionIndex"] = arg3
-- MSA_DropDownMenu_SetText(arg2, arg3)
-- end
function ATToggleShowInfoFrameTestFrame_OnClick(self)
if InfoFrameTestBarsActive == false then
InfoFrameTestBarsActive = true
core.IATInfoFrame:SetupInfoFrame()
core.IATInfoFrame:ToggleOn()
core.IATInfoFrame:SetHeading(GetAchievementLink(14148))
core.IATInfoFrame:SetSubHeading1(L["Shared_PlayersMetCriteria"] .. " (0/10)")
core.IATInfoFrame:SetText1(getNPCName(134442).."\n"..getNPCName(144637).."\n"..getNPCName(138314).."\n"..getNPCName(94960).."\n"..getNPCName(95833).."\n"..getNPCName(116691).."\n"..getNPCName(111882).."\n"..getNPCName(111861).."\n"..getNPCName(74571).."\n"..getNPCName(74570))
else
InfoFrameTestBarsActive = false
core.IATInfoFrame:ToggleOff()
end
end
function ATToggleChangeMinimapIcon_OnClick(self)
AchievementTrackerOptions["changeMinimapIcon"] = self:GetChecked()
setChangeMinimapIcon(self:GetChecked())
end
function ATToggleTrackAchievementsAutomatically_OnClick(self)
AchievementTrackerOptions["trackAchievementsAutomatically"] = self:GetChecked()
setTrackAchievementsAutomatically(self:GetChecked())
end
function ATToggleTrackCharacterAchievements_OnClick(self)
AchievementTrackerOptions["trackCharacterAchievements"] = self:GetChecked()
setTrackCharacterAchievements(self:GetChecked())
end
function ATToggleTrackAchievementsInBlizzardUI_OnClick(self)
AchievementTrackerOptions["trackAchievementsInBlizzardUI"] = self:GetChecked()
setTrackAchievementsInBlizzardUI(self:GetChecked())
end
function ATToggleInfoFrame_OnClick(self)
AchievementTrackerOptions["displayInfoFrame"] = self:GetChecked()
setDisplayInfoFrame(self:GetChecked())
end
function ATToggleAutomaticCombatLogging_OnClick(self)
AchievementTrackerOptions["enableAutomaticCombatLogging"] = self:GetChecked()
setEnableAutomaticCombatLogging(self:GetChecked())
end
function ATToggleHideCompletedAchievements_OnClick(self)
AchievementTrackerOptions["hideCompletedAchievements"] = self:GetChecked()
setHideCompletedAchievements(self:GetChecked())
end
function ATToggleGreyOutCompletedAchievements_OnClick(self)
AchievementTrackerOptions["greyOutCompletedAchievements"] = self:GetChecked()
setGreyOutCompletedAchievements(self:GetChecked())
end
function AchievementTracker_SelectSoundCompleted(self, arg1, arg2, checked)
if arg1 == 1 then
PlaySound(SOUNDKIT.READY_CHECK, "Master") --Success
AchievementTrackerOptions["completedSound"] = SOUNDKIT.RAID_WARNING
AchievementTrackerOptions["completedSoundID"] = 1
setCompletedSound(SOUNDKIT.READY_CHECK)
elseif arg1 == 2 then
PlaySound(SOUNDKIT.ALARM_CLOCK_WARNING_2, "Master") --Success
AchievementTrackerOptions["completedSound"] = SOUNDKIT.RAID_WARNING
AchievementTrackerOptions["completedSoundID"] = 2
setCompletedSound(SOUNDKIT.ALARM_CLOCK_WARNING_2)
elseif arg1 == 3 then
PlaySound(SOUNDKIT.ALARM_CLOCK_WARNING_3, "Master") --Success
AchievementTrackerOptions["completedSound"] = SOUNDKIT.RAID_WARNING
AchievementTrackerOptions["completedSoundID"] = 3
setCompletedSound(SOUNDKIT.ALARM_CLOCK_WARNING_3)
elseif arg1 == 4 then
PlaySound(SOUNDKIT.AUCTION_WINDOW_CLOSE, "Master") --Success
AchievementTrackerOptions["completedSound"] = SOUNDKIT.RAID_WARNING
AchievementTrackerOptions["completedSoundID"] = 4
setCompletedSound(SOUNDKIT.AUCTION_WINDOW_CLOSE)
elseif arg1 == 4 then
PlaySound(SOUNDKIT.AUCTION_WINDOW_CLOSE, "Master") --Success
AchievementTrackerOptions["completedSound"] = SOUNDKIT.RAID_WARNING
AchievementTrackerOptions["completedSoundID"] = 4
setCompletedSound(SOUNDKIT.AUCTION_WINDOW_CLOSE)
elseif arg1 == 4 then
PlaySound(SOUNDKIT.AUCTION_WINDOW_CLOSE, "Master") --Success
AchievementTrackerOptions["completedSound"] = SOUNDKIT.RAID_WARNING
AchievementTrackerOptions["completedSoundID"] = 4
setCompletedSound(SOUNDKIT.AUCTION_WINDOW_CLOSE)
elseif arg1 == 5 then
PlaySoundFile("Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\You_Are_Prepared.ogg", "Master") --Success
AchievementTrackerOptions["completedSound"] = "Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\You_Are_Prepared.ogg"
AchievementTrackerOptions["completedSoundID"] = 5
setCompletedSound("Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\You_Are_Prepared.ogg")
elseif arg1 == 6 then
PlaySoundFile("Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound 6.ogg", "Master") --Success
AchievementTrackerOptions["completedSound"] = "Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound 6.ogg"
AchievementTrackerOptions["completedSoundID"] = 6
setCompletedSound("Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound 6.ogg")
elseif arg1 == 7 then
PlaySoundFile("Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound 7.ogg", "Master") --Success
AchievementTrackerOptions["completedSound"] = "Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound 7.ogg"
AchievementTrackerOptions["completedSoundID"] = 7
setCompletedSound("Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound 7.ogg")
elseif arg1 == 8 then
PlaySoundFile("Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound 8.ogg", "Master") --Success
AchievementTrackerOptions["completedSound"] = "Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound 8.ogg"
AchievementTrackerOptions["completedSoundID"] = 8
setCompletedSound("Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound 8.ogg")
elseif arg1 == 9 then
PlaySoundFile("Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound 9.ogg", "Master") --Success
AchievementTrackerOptions["completedSound"] = "Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound 9.ogg"
AchievementTrackerOptions["completedSoundID"] = 9
setCompletedSound("Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound 9.ogg")
elseif arg1 == 10 then
PlaySoundFile("Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound 10.ogg", "Master") --Success
AchievementTrackerOptions["completedSound"] = "Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound 10.ogg"
AchievementTrackerOptions["completedSoundID"] = 10
setCompletedSound("Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound 10.ogg")
elseif arg1 == 11 then
PlaySoundFile("Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound 11.ogg", "Master") --Success
AchievementTrackerOptions["completedSound"] = "Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound 11.ogg"
AchievementTrackerOptions["completedSoundID"] = 11
setCompletedSound("Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound 11.ogg")
elseif arg1 == 12 then
PlaySoundFile("Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound 12.ogg", "Master") --Success
AchievementTrackerOptions["completedSound"] = "Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound 12.ogg"
AchievementTrackerOptions["completedSoundID"] = 12
setCompletedSound("Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound 12.ogg")
elseif arg1 == 13 then
PlaySoundFile("Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Achievement Completed.ogg", "Master") --Success
AchievementTrackerOptions["completedSound"] = "Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Achievement Completed.ogg"
AchievementTrackerOptions["completedSoundID"] = 13
setCompletedSound("Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Achievement Completed.ogg")
end
MSA_DropDownMenu_SetText(arg2, arg1)
end
function AchievementTracker_SelectSoundFailed(self, arg1, arg2, checked)
if arg1 == 1 then
PlaySound(SOUNDKIT.RAID_WARNING, "Master") --Fail
AchievementTrackerOptions["failedSound"] = SOUNDKIT.RAID_WARNING
AchievementTrackerOptions["failedSoundID"] = 1
setFailedSound(SOUNDKIT.RAID_WARNING)
elseif arg1 == 2 then
PlaySound(SOUNDKIT.LFG_REWARDS, "Master") --Fail
AchievementTrackerOptions["failedSound"] = SOUNDKIT.LFG_REWARDS
AchievementTrackerOptions["failedSoundID"] = 2
setFailedSound(SOUNDKIT.LFG_REWARDS)
elseif arg1 == 3 then
PlaySound(SOUNDKIT.UI_BATTLEGROUND_COUNTDOWN_FINISHED, "Master") --Fail
AchievementTrackerOptions["failedSound"] = SOUNDKIT.UI_BATTLEGROUND_COUNTDOWN_FINISHED
AchievementTrackerOptions["failedSoundID"] = 3
setFailedSound(SOUNDKIT.UI_BATTLEGROUND_COUNTDOWN_FINISHED)
elseif arg1 == 4 then
PlaySound(SOUNDKIT.UI_SCENARIO_ENDING, "Master") --Fail
AchievementTrackerOptions["failedSound"] = SOUNDKIT.UI_SCENARIO_ENDING
AchievementTrackerOptions["failedSoundID"] = 4
setFailedSound(SOUNDKIT.UI_SCENARIO_ENDING)
elseif arg1 == 5 then
PlaySound(SOUNDKIT.UI_GARRISON_MISSION_COMPLETE_ENCOUNTER_FAIL, "Master") --Fail
AchievementTrackerOptions["failedSound"] = SOUNDKIT.UI_GARRISON_MISSION_COMPLETE_ENCOUNTER_FAIL
AchievementTrackerOptions["failedSoundID"] = 5
setFailedSound(SOUNDKIT.UI_GARRISON_MISSION_COMPLETE_ENCOUNTER_FAIL)
elseif arg1 == 6 then
PlaySoundFile("Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\You_Are_Not_Prepared.ogg", "Master") --Fail
AchievementTrackerOptions["failedSound"] = "Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\You_Are_Not_Prepared.ogg"
AchievementTrackerOptions["failedSoundID"] = 6
setFailedSound("Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\You_Are_Not_Prepared.ogg")
elseif arg1 == 7 then
PlaySoundFile("Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound_2.ogg", "Master") --Fail
AchievementTrackerOptions["failedSound"] = "Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound_2.ogg"
AchievementTrackerOptions["failedSoundID"] = 7
setFailedSound("Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound_2.ogg")
elseif arg1 == 8 then
PlaySoundFile("Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound_3.ogg", "Master") --Fail
AchievementTrackerOptions["failedSound"] = "Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound_3.ogg"
AchievementTrackerOptions["failedSoundID"] = 8
setFailedSound("Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound_3.ogg")
elseif arg1 == 9 then
PlaySoundFile("Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound_4.ogg", "Master") --Fail
AchievementTrackerOptions["failedSound"] = "Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound_4.ogg"
AchievementTrackerOptions["failedSoundID"] = 9
setFailedSound("Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound_4.ogg")
elseif arg1 == 10 then
PlaySoundFile("Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound_5.ogg", "Master") --Fail
AchievementTrackerOptions["failedSound"] = "Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound_5.ogg"
AchievementTrackerOptions["failedSoundID"] = 10
setFailedSound("Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Sound_5.ogg")
elseif arg1 == 11 then
PlaySoundFile("Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Achievement Failed.ogg", "Master") --Fail
AchievementTrackerOptions["failedSound"] = "Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Achievement Failed.ogg"
AchievementTrackerOptions["failedSoundID"] = 11
setFailedSound("Interface\\AddOns\\InstanceAchievementTracker\\Sounds\\Achievement Failed.ogg")
end
MSA_DropDownMenu_SetText(arg2, arg1)
end
function ATToggleSound_OnClick(self)
AchievementTrackerOptions["toggleSound"] = self:GetChecked()
setEnableSound(self:GetChecked())
end
function ATToggleSoundFailed_OnClick(self)
AchievementTrackerOptions["toggleSoundFailed"] = self:GetChecked()
setEnableSoundFailed(self:GetChecked())
end
function ATToggleAnnounceToRaidWarning_OnClick(self)
AchievementTrackerOptions["announceToRaidWarning"] = self:GetChecked()
setAnnounceToRaidWarning(self:GetChecked())
end
function ATToggleTrackMissingAchievementsOnly_OnClick(self)
AchievementTrackerOptions["onlyTrackMissingAchievements"] = self:GetChecked()
setOnlyTrackMissingAchievements(self:GetChecked())
end
function ATToggleAchievementAnnounce_OnClick(self)
AchievementTrackerOptions["announceTrackedAchievements"] = self:GetChecked()
setAnnounceTrackedAchievementsToChat(self:GetChecked())
end