forked from smaitch/Wholly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Wholly.lua
5153 lines (4882 loc) · 237 KB
/
Wholly.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
--
-- Wholly
-- Written by [email protected]
--
-- This was inspired by my need to replace EveryQuest with something that was more accurate. The pins
-- was totally inspired by QuestHubber which I found when looking for a replacement for EveryQuest. I
-- initially made a port of QuestHubber to QuestHubberGrail to make use of the Grail database, but now
-- I have integrated that work into this addon. Many thanks for all the work put into QuestHubber. I
-- was inspired to add a quest breadcrumb area from seeing one in Quest Completist.
--
-- Version History
-- 001 Initial version.
-- 002 Support for displaysDungeonQuests now works properly.
-- Added the ability for the panel tooltip to display questgivers.
-- Added the ability to click a quest in the panel to create a TomTom waypoint.
-- Map pins are only displayed for the proper dungeon level of the map.
-- 003 Added a panel button to switch to the current zone.
-- Changed the Close button into a Sort button that switches between three different modes:
-- 1. Alphabetical 2. Quest level, then alphabetical 3. Quest status, then alphabetical
-- Made map pins only have one pin per NPC, indicating the "best" color possible.
-- The entire zone dropdown button on the quest log panel now can be clicked to change zones.
-- Corrected a problem where someone running without LibStub would get a LUA error.
-- Corrected a localization issue.
-- 004 Added the ability to display a basic quest prerequisite chain in the quest panel tooltip, requiring Grail 014 or later.
-- Added the ability to right-click a "prerequisite" quest in the panel to put a TomTom arrow to the first prerequisite quest.
-- Added Dungeons and Other menu items for map areas in the quest log panel.
-- The last-used sort preference is stored on a per-character basis.
-- 005 Corrected the fix introduced in version 003 putting the LibDataBroker icon back in place.
-- Corrected a problem where the quest log tooltip would have an error if the questgiver was in a dungeon appearing in the zone.
-- Added the ability for the quest log tooltip to show that the questgiver should be killed (like the map pin tooltip).
-- The problem where map pins would not live update unless the quest log panel was opened has been fixed as long
-- as the Wholly check button appears on the map.
-- Added the ability to show quest breadcrumb information when the Quest Frame opens, showing a tooltip of breadcrumb
-- quests when the mouse enters the "breadcrumb area", and putting TomTom waypoints when clicking in it.
-- 006 Added the new quest group "World Events" which has holiday quests in it, requiring Grail 015.
-- Added a tooltip to the Wholly check button on the map that indicates how many quests of each type are in the map.
-- Added a tooltip to the LibDataBroker icon that shows the quest log panel "map" selection and the quest count/type.
-- Added a tooltip to the quest log panel Zone button that shows the quest count/type.
-- Corrected the problem where the quest log panel and map pins were not live updating when quest givers inside dungeons checked.
-- Corrected the problem where an NPC that drops items that starts more than one quest does not display the information properly
-- in its tooltip.
-- Made it so the open World Map can be updated when crossing into a new zone.
-- 007 Added the ability to show whether quests in the quest log are completed or failed.
-- Made it so right-clicking an "in log" quest will put in TomTom waypoints for the turn in locations, which requires Grail 016
-- for proper functioning since Grail 015 had a bug.
-- Made the strings for the preferences color quest information like it appears in the UI.
-- Made it so alt-clicking a log in the Wholly quest log selects the NPC that gives the quest or for the case of "in log" quests
-- the one to which the quest is turned in.
-- 008 Split out Dungeons into dungeons in different continents, requiring Grail version 017.
-- Corrected a misspelling of the global game tooltip name.
-- 009 Added localization for ptBR in anticipation of the Brazilian release.
-- Changed over to using Blizzard-defined strings for as many things as possible.
-- Corrected a problem that was causing the tooltip for creatures that needed to be killed to start a quest not to appear properly.
-- Added a few basic localizations.
-- Made the breadcrumb frame hide by default to attempt to eliminate an edge case.
-- Fixed a problem where button clicking behavior would never be set if the button was first entered while in combat.
-- Made prerequisite information appear as question marks instead of causing a LUA error in case the Grail data is lacking.
-- 010 Made it so the color of the breadcrumb quest names match their current status.
-- The click areas to the right and bottom of the quest log window no longer extend past the window.
-- Added menu options for Class quests, Profession quests, Reputation quests, and Daily quests. The Class and Profession quests will show all the quests in the system except for the class and professions that match the player. For those, the quests are displayed using the normal filtering rules. The Reputation quests follow the normal filtering rules except those that fail to be acceptable solely because of reputation will be displayed instead of following the display unobtainable filter.
-- Changed over to using Grail's StatusCode() vice Status(), and making use of more modern bit values, thereby requiring version 20.
-- Removed a few event types that are handled because Grail now does that. Instead switched to using Grail's new Status notification.
-- The tooltips for quests in the panel show profession and reputation requirements as appropriate.
-- Corrected a problem where the quest panel may not update properly while in combat.
-- 011 Made it so the breadcrumb warning will disappear properly when the user dismisses the quest frame.
-- Made it so Grail's support for Monks does not cause headaches when Monks are not available in the game.
-- Made it so Classes that do not have any class quests will not show up in the list.
-- Put in a feature to limit quests shown to those that count towards Loremaster, thereby requiring Grail version 21.
-- When the quest details appear the quest ID is shown in the top right, and it has a tooltip with useful quest information.
-- Changed the behavior of right-clicking a quest in the quest panel to put arrows to the turn in locations for all but prerequisite quests.
-- The tooltip information describing the quest shows failure reasons by changing to red categories that fail, and to orange categories that fail in prerequisite quests.
-- The quest tooltip information now indicates the first quest(s) in the prerequisite quest list as appropriate.
-- The preference to control displaying prerequisite quests in the tooltip has been removed.
-- 012 Added the ability for the tooltip to display faction reputation changes that happen when a quest is turned in.
-- Grouped the Dungeons menu items under a single Dungeons menu item.
-- Added menu items for Reputation Changes quests, grouped by reputation.
-- Added menu items for Achievement quests, grouped by continent, requiring Grail 22.
-- Updated the TOC to support Interface 40300.
-- Fixed the map pin icons whose height Blizzard changed with the 4.3 release.
-- 013 Fixes a problem where map pins would not appear and the quest ID would not appear in the Blizzard Quest Frame because the events were not set up properly because sometimes Blizzard sends events in a different order than expected.
-- Makes all the Wholly quest panel update calls ensure they are performed out of combat.
-- Updates Portuguese translation thanks to weslleih and htgome.
-- Fixes a problem where quests in the Blizzard log sometimes would not appear purple in the Wholly Quest Log.
-- Fixes a problem where holidays are not detected properly because of timing issues.
-- 014 Fixes the problem where the NPC tooltip did not show the exclamation point properly (instead showing a different icon) when the NPC can start a quest.
-- Adds a search ability that allows searching for quests based on their titles.
-- Adds the ability to display player coordinates into a LibDataBroker feed.
-- Updates some localizations.
-- Fixes the problem where the panel would no longer update after a UI reload, requiring Grail 26.
-- Adds some more achievements to the menu that are world event related.
-- Makes it so quests in the Blizzard quest log will be colored purple in preference to other colors (like brown in case the player would no longer qualify getting the quest).
-- Makes it so the indicator for a completed repeatable quest will appear even if the quest is not colored blue.
-- 015 Adds the filtered and total quest counts to the tooltip that tells the counts of the types of quests. For the world map button tooltip the filtered quest count displays in red if the quest markers on the map are hidden.
-- Corrects a problem where lacking LibDataBroker would cause a LUA error associated with the player coordinates.
-- Fixes a cosmetic issue with the icon in the top left of the Wholly quest log panel to show the surrounding edge properly.
-- Changes the world map check box into a button that performs the same function.
-- Changes the classification of "weekly", "monthly" and "yearly" quests so they no longer appear as resettable quests, but as normal ones.
-- Adds a tooltip for the coordinates that shows the map area ID and name.
-- 016 *** Requires Grail 28 or later ***
-- Adds the ability to color the achievement menu items based on whether they are complete.
-- Corrects the problem where the tooltip does not show the different names of the NPCs that can drop an item to start a quest.
-- Corrects the problem where alt-clicking a quest would not select the NPC properly if the NPC drops an item to start a quest.
-- Tracks multiple waypoints that are logically added as a group so when one is removed all of them are removed.
-- Updates some Portuguese localizations.
-- Adds the ability to show bugged information about a quest.
-- Adds a preference to consider bugged quests unobtainable.
-- Makes it select the closest waypoint when more than one is added at the same time.
-- 017 *** Requires Grail 29 or later ***
-- Updates the preferences to allow more precise control of displayed quest types.
-- Creates the ability to control whether achievement and reputation change information is used.
-- Adds some Russian localization by freega3 but abused by me.
-- Adds basic structural support for the Italian localization.
-- Changes the presentation of prerequisite quest information to have all types unified in one location.
-- 018 Adds some missing Italian UI keys.
-- Removes UI keys no longer used.
-- Fixes the icon that appears in the tooltip when an NPC drops an item that starts a quest.
-- Adds the ability to display item quest prerequisites.
-- Changes the priority of quest classification to ensure truly repeatable quests are never green.
-- Adds support for Cooking and Fishing achievements, present in Grail 31.
-- Adds support to display LightHeaded data by shift-left-click a quest in the Wholly quest panel.
-- Adds the ability to display abandoned and accepted quest prerequisites.
-- 019 Adds German localization provided by polzi and aryl2mithril.
-- Adds French localization provided by deadse and Noeudtribal.
-- Corrects the problem where the preference to control holiday quests always was not working properly, requiring Grail 32.
-- Updates Russian localization provided by dartraiden.
-- Adds support for Just Another Day in Tol Barad achievements when Grail provides that data (starting in Grail 32).
-- Adds the ability to display all quests from the search menu.
-- Updates Portuguese localization provided by andrewalves.
-- Corrects a rare problem interacting with LDB.
-- Adds the ability to display quest prerequisites filtering through flag quests when Grail provides the functionality.
-- 020 *** Requires Grail 33 or later ***
-- Corrects the problem where quests in the log that are no longer obtainable do not appear properly.
-- Adds the ability to show daily quests that are too high for the character as orange.
-- Adds Spanish localization provided by Trisquite.
-- Moves the Daily quests into the Other category.
-- Adds the experimental option to have a wide quest panel.
-- 021 *** Requires Grail 34 or later ***
-- Makes it so Mists of Pandaria reputations can be handled.
-- Makes it so starter Pandarens no longer cause LUA errors.
-- Corrects the problem where removing all TomTom waypoints was not clearing them from Wholly's memory.
-- Corrects locations for Wholly informational frames placed on QuestFrame in MoP beta.
-- Updates the tooltip to better indicate when breadcrumb quests are problems for unobtainable quests.
-- Adds the ability to display profession prerequisites (in the prerequisites section vice its own for the few that need it).
-- 022 *** Requires Grail 36 or later ***
-- Corrects the problem where NPC tooltips may not be updated until the world map is shown.
-- Changes how map pins are created so no work is done unless the WorldMapFrame is being shown.
-- Adds the ability to show that quests are Scenario or Legendary.
-- Changes the artwork on the right side of the wide panel.
-- Fixes the problem where the search panel was not attaching itself to the Wholly quest panel.
-- Updates some Korean localization provided by next96.
-- Makes it so Legendary quests appear orange while daily quests that are too high level appear dark blue.
-- Adds two new sort techniques, and also a tooltip for the sort button that describes the active sort technique.
-- Adds the ability to show an abbreviated quest count for each map area in the second scroll area of the wide quest panel, with optional live updates.
-- Fixes the problem where the Wholly world map button can appear above other frames.
-- Makes changing the selection in the first scroll view in the wide version of the Wholly quest panel, remove the selection in the second scroll view, thereby allowing the zone button to properly switch to the current zone.
-- Adds a Wholly quest tooltip for each of the quests in the Blizzard quest log.
-- Updates searching in the wide frame to select the newly sought term.
-- 023 Updates some Korean localization provided by next96.
-- Updates some German localization provided by DirtyHarryGermany.
-- Updates from French localization provided by akirra83.
-- Adds support to indicate account-wide quests, starting with Grail 037 use.
-- 024 *** Requires Grail 38 or later ***
-- Updates some Russian localization provided by dartraiden.
-- Adds support for quests that require skills as prerequisites, requiring Grail 038.
-- Updates some Italian localization provided by meygan.
-- 025 *** Requires Grail 39 or later ***
-- Adds support to display quest required friendship levels.
-- Fixes the problem where NPC tooltips would not be updated (from changed addon data) upon reloading the UI.
-- Adds support to display prerequisites using Grail's newly added capabilities for OR within AND.
-- Adds support for quests that require lack of spells or spells ever being cast as prerequisites.
-- Adds a filter for Scenario quests.
-- Delays the creation of the dropdown menu until it is absolutely needed to attempt to minimize the taint in Blizzard's code.
-- Fixes an issue where considering bugged quests unobtainable would not filter as unobtainable properly.
-- 026 *** Requires Grail 40 or later ***
-- Adds support for displaying special reputation requirements currently only used in Tillers quests.
-- 027 *** Requires Grail 41 or later ***
-- Adds the ability to display requirements for spells that have ever been experienced.
-- Adds the ability to specify amounts above the minimum reputation level as provided in Grail 041 and later.
-- Updates some Traditional Chinese localization provided by machihchung and BNSSNB.
-- Adds the ability to display requirements from groups of quests, both turning in and accepting the quests.
-- Changes spell prerequisite failures to color red vice yellow.
-- Changes preference "Display holiday quests always" to become a "World Events" filter instead, making World Events always shown in their categories.
-- Changes world events titles to be brown (unobtainable) if they are not being celebrated currently.
-- Adds the ability to Ctrl-click any quest in the Wholly quest panel to add waypoints for EVERY quest in the panel.
-- Corrects the incorrect rendering of the wide panel that can happen on some systems.
-- Adds keybindings for toggling display of map pins and quests that need prerequsites, daily quests, repeatable quests, completed, and unobtainable quests.
-- Adds the ability to display maximum reputation requirements that are quest prerequisites.
-- Changes the maximum line count for the tooltip before the second is created, to be able to be overridden by WhollyDatabase.maximumTooltipLines value if it exists.
-- Adds the ability to Ctrl-Shift-click any quest in the Wholly quest panel to toggle whether the quest is ignored.
-- Adds the ability to filter quests that are marked ignored.
-- 028 Switches to using Blizzard's IGNORED string instead of maintaining a localized version.
-- Adds basic support for putting pins on the Omega Map addon.
-- Changes the display of the requirement for a quest to ever have been completed to be green if true, and not the actual status of the quest.
-- Updates the TOC to support interface 50100.
-- Replaces the calls to Grail:IsQuestInQuestLog() with the status bit mask use since (1) we know whether the quest is in the log from its status, and (2) the call was causing Grail to use a lot of memory.
-- 029 Adds support for Grail's T code prerequisites.
-- Adds Simplified Chinese localization provided by Sunteya.
-- 030 Changes to use some newly added API Grail provides, *** requiring Grail 45 or later ***.
-- Updates some Spanish localization provided by Davidinmoral.
-- Updates some French localization provided by Noeudtribal.
-- Reputation values that are not to be exceeded now have "< " placed in front of the value name.
-- Allows the key binding for toggling open/close the Wholly panel to work in combat, though this function will need to be rebound once.
-- Fixes a map pin problem with the addon Mapster Enhanced.
-- Changes the faction prerequisites to color green, red or brown depending on whether the prerequisite is met, can be met with increase in reputation or is not obtainable because reputation is too high.
-- Adds support for Grail's new "Other" map area where oddball quests are located.
-- Adds support for Grail's new NPC location flags of created and mailbox.
-- Updates some Portuguese localization provided by marciobruno.
-- Adds Pet Battle achievements newly provided by Grail.
-- 031 Updates some German localization provided by bigx2.
-- Updates some Russian localization provided by dartraiden.
-- Adds ability to display F code prerequisite information.
-- 032 Fixes a problem where the Achievements were not working properly unless the UI was reloaded.
-- Adds the ability to display NPCs with prerequisites, *** requiring Grail 47 or later ***.
-- Makes the X code prerequisite display with ![Turned in].
-- Adds the ability to display phase prerequisite information.
-- Adds some Spanish translations based on input by Davidinmoral.
-- 033 Adds a hidden default shouldNotRestoreDirectionalArrows that can be present in the WhollyDatabase saved variables to not reinstate directional arrows upon reloading.
-- Adds the ability to show when a quest is obsolete (removed) or pending.
-- Adds support for displaying Q prerequisites and for displaying pet "spells".
-- Changes the technique used to display reputation changes in the tooltip, *** requiring Grail 048 or later ***.
-- Adds support for Grail's new representation of prerequisite information.
-- 034 Changes the tooltip code to allow for better displaying of longer entries.
-- Adds some Korean localization provided by next96.
-- Changes the Interface to 50300 to support the 5.3.0 Blizzard release.
-- Adds the ability to control the Grail-When loadable addon to record when quests are turned in.
-- Adds the ability to display when quests are turned in, and if the quest can be done more than once, the count of how many times done.
-- Updates support for Grail's new representation of prerequisite information.
-- 035 Updates Chinese localizations by Isjyzjl.
-- Adds the ability to show equipped iLvl prerequisites.
-- Corrects the display problem with OR within AND prerequisites introduced in version 034.
-- Makes opening the preferences work even if Wholly causes the preferences to be opened the first time in a session.
-- 036 Updates Russian localizations by dartraiden.
-- Removes the prerequisite population code in favor of API provided by Grail, requiring Grail 054 or later.
-- 037 Fixes the problem where tooltips do not appear in non-English clients properly.
-- 038 Fixes the problem where tooltips that show the currently equipped iLevel cause a Lua error.
-- Adds a preference to control whether tooltips appear in the Blizzard Quest Log.
-- Corrects the problem introdced by Blizzard in their 5.4.0 release when they decided to call API (IsForbidden()) before checking whether it exists.
-- Makes the attached Lightheaded frame work better with the wide panel mode.
-- Corrects a problem where a variable was leaking into the global namespace causing a prerequisite evaluation failure.
-- Attempts to make processing a little quicker by making local references to many Blizzard functions.
-- 039 Fixes the problem where tooltips for map pins were not appearing correctly.
-- Fixes a Lua error with the non-wide Wholly quest panel's drop down menu.
-- Fixes a Lua error when Wholly is used for the first time (or has no saved variables file).
-- Adds a preference to control display of weekly quests.
-- Adds a color for weekly quests.
-- Enables quest colors to be stored in player preferences so users can changed them, albeit manually.
-- Fixes the problem where the keybindings or buttons not on the preference panel would not work the first time without the preference panel being opened.
-- 040 Updates Russian localizations by dartraiden.
-- Adds a workaround to supress the panel that appears because of Blizzard's IsDisabledByParentalControls taint issue.
-- Updates Simplified Chinese localizations by dh0000.
-- 041 Adds the capability to set the colors for each of the quest types.
-- Changes to use newer way Grail does things.
-- 042 Updates Russian localizations by dartraiden.
-- Corrects the search function to use the new Grail quest structures.
-- Makes it so quests that are pending or obsolete do not appear when the option indicates unobtainable quests should not appear.
-- Changed display of profession requirements to only show failure as quest prerequisites now show profession requirements consistently.
-- 043 Handles Grail's change in AZ quests to handle pre- and post-063 implementation.
-- Adds the ability to mark quests with arbitrary tags.
-- 044 Corrects the Lua error that happens when attempting to tag a quest when no tag exists.
-- Fixes the map icons to look cleaner by Shenj.
-- Updates Russian localizations by vitasikxp.
-- 045 Updates various localizations by Nimhfree.
-- Updates to support changes in WoD that Grail supports. *** Requires Grail 065 or later. ***
-- Adds hidden WhollyDatabase preference ignoreReputationQuests that controls whether the Reputations section of quests appears in the Wholly panel.
-- Adds hidden WhollyDatabase preference displaysEmptyZones that controls whether map zones where no quests start are displayed.
-- Changes the Interface to 60000.
-- 046 Regenerates installation package.
-- 047 Updates Traditional Chinese localizations by machihchung.
-- Updates Portuguese localizations by DMoRiaM.
-- Updates French localizations by Dabeuliou;
-- Changes level for pins to display over Blizzard POIs.
-- Changes level for pins so yellow/grey pins display over other colors.
-- Changes default behavior to only show in tooltips faction changes available to the player, with hidden WhollyDatabase preference showsAllFactionReputations to override.
-- 048 Fixes a problem where Wholly does not load properly when TomTom is not present.
-- 049 Adds the ability to display quests that reward followers.
-- Updates some Korean localization provided by next96.
-- Updates some German localization provided by DirtyHarryGermany.
-- 050 Adds support for garrison building requirements.
-- Updates Russian localization provided by dartraiden.
-- Updates German localization provided by DirtyHarryGermany.
-- Updates both Chinese localizations provided by FreedomL10n.
-- 051 Adds support to control display of bonus objective, rare mob and treasure quests.
-- Adds Wholly tooltip to the QuestLogPopupDetailFrame.
-- Updates French localization provided by aktaurus.
-- Breaks out the preferences into multiple pages, making the hidden preferences no longer hidden.
-- Adds ability to control the display of legendary quests.
-- Updates Russian localization provided by dartraiden.
-- Changes the Interface to 60200.
-- 052 Adds support to display new group prerequisite information.
-- Corrects the issue where NPC tooltips were not showing drops that start quests.
-- Updates Spanish (Latin America) localization by Moixe.
-- Updates German localization by Mistrahw.
-- Updates Korean localization by mrgyver.
-- Updates Spanish (Spain) localization by Ertziano.
-- Corrects the problem where the drop down button in the Wholly window does not update the follower name properly.
-- Adds the ability to display quest rewards.
-- Splits up zone drop downs that are too large.
-- 053 Adds the ability to filter pet battle quests.
-- Adds the ability to display a quest as a bonus objective, rare mob, treasure or pet battle.
-- Adds the ability to have the quest filter work for NPC tooltips.
-- Updates German localization by Rikade.
-- Updates prerequisite displays to match new Grail features.
-- 054 Adds support for Adventure Guide
-- Updates German localization by potsrabe.
-- 055 Updates Traditional Chinese localization by gaspy10.
-- Updates Spanish (Spain) localization by ISBILIANS.
-- Corrects the problem where the map location is lost on UI reload.
-- 056 Updates German localization by pas06.
-- Adds the ability to filter quests based on PVP.
-- Adds the ability to support Grail's ability to indicate working buildings.
--
-- Known Issues
--
-- The quest log quest colors are not updated live (when the panel is open).
--
-- UTF-8 file
--
local format, pairs, tContains, tinsert, tonumber = format, pairs, tContains, tinsert, tonumber
local ipairs, print, strlen, tremove, type = ipairs, print, strlen, tremove, type
local strsplit, strfind, strformat, strsub, strgmatch = strsplit, string.find, string.format, string.sub, string.gmatch
local bitband = bit.band
local tablesort = table.sort
local mathmax, mathmin, sqrt = math.max, math.min, math.sqrt
local CloseDropDownMenus = CloseDropDownMenus
local CreateFrame = CreateFrame
local GetAchievementInfo = GetAchievementInfo
local GetAddOnMetadata = GetAddOnMetadata
local GetBuildInfo = GetBuildInfo
local GetCurrentMapAreaID = GetCurrentMapAreaID
local GetCurrentMapDungeonLevel = GetCurrentMapDungeonLevel
local GetCursorPosition = GetCursorPosition
local GetCVarBool = GetCVarBool
local GetLocale = GetLocale
local GetPlayerMapPosition = GetPlayerMapPosition
local GetQuestID = GetQuestID
local GetRealZoneText = GetRealZoneText
local GetSpellInfo = GetSpellInfo
local GetTitleText = GetTitleText
local InCombatLockdown = InCombatLockdown
local InterfaceOptions_AddCategory = InterfaceOptions_AddCategory
local InterfaceOptionsFrame_OpenToCategory = InterfaceOptionsFrame_OpenToCategory
local IsControlKeyDown = IsControlKeyDown
local IsShiftKeyDown = IsShiftKeyDown
local PlaySound = PlaySound
local SetMapByID = SetMapByID
local ToggleDropDownMenu = ToggleDropDownMenu
local UIDropDownMenu_AddButton = UIDropDownMenu_AddButton
local UIDropDownMenu_CreateInfo = UIDropDownMenu_CreateInfo
local UIDropDownMenu_GetText = UIDropDownMenu_GetText
local UIDropDownMenu_Initialize = UIDropDownMenu_Initialize
local UIDropDownMenu_JustifyText = UIDropDownMenu_JustifyText
local UIDropDownMenu_SetText = UIDropDownMenu_SetText
local UIDropDownMenu_SetWidth = UIDropDownMenu_SetWidth
local UIParentLoadAddOn = UIParentLoadAddOn
local UnitIsPlayer = UnitIsPlayer
local GameTooltip = GameTooltip
local UIErrorsFrame = UIErrorsFrame
local UIParent = UIParent
local QuestFrame = QuestFrame
local WorldMapFrame = WorldMapFrame
local GRAIL = nil -- will be set in ADDON_LOADED
local directoryName, _ = ...
local versionFromToc = GetAddOnMetadata(directoryName, "Version")
local _, _, versionValueFromToc = strfind(versionFromToc, "(%d+)")
local Wholly_File_Version = tonumber(versionValueFromToc)
local requiredGrailVersion = 67
-- Set up the bindings to use the localized name Blizzard supplies. Note that the Bindings.xml file cannot
-- just contain the TOGGLEQUESTLOG because then the entry for Wholly does not show up. So, we use a version
-- named WHOLLY_TOGGLEQUESTLOG which maps to the same Global string, which works exactly as we want.
_G["BINDING_NAME_CLICK com_mithrandir_whollyFrameHiddenToggleButton:LeftButton"] = BINDING_NAME_TOGGLEQUESTLOG
--BINDING_NAME_WHOLLY_TOGGLEQUESTLOG = BINDING_NAME_TOGGLEQUESTLOG
BINDING_HEADER_WHOLLY = "Wholly"
BINDING_NAME_WHOLLY_TOGGLEMAPPINS = "Toggle map pins"
BINDING_NAME_WHOLLY_TOGGLESHOWNEEDSPREREQUISITES = "Toggle shows needs prerequisites"
BINDING_NAME_WHOLLY_TOGGLESHOWDAILIES = "Toggle shows dailies"
BINDING_NAME_WHOLLY_TOGGLESHOWWEEKLIES = "Toggle shows weeklies"
BINDING_NAME_WHOLLY_TOGGLESHOWREPEATABLES = "Toggle shows repeatables"
BINDING_NAME_WHOLLY_TOGGLESHOWUNOBTAINABLES = "Toggle shows unobtainables"
BINDING_NAME_WHOLLY_TOGGLESHOWCOMPLETED = "Toggle shows completed"
if nil == Wholly or Wholly.versionNumber < Wholly_File_Version then
local function trim(s)
local n = s:find"%S"
return n and s:match(".*%S", n) or ""
end
WhollyDatabase = {}
Wholly = {
cachedMapCounts = {},
cachedPanelQuests = {}, -- quests and their status for map area self.zoneInfo.panel.mapId
cachedPinQuests = {}, -- quests and their status for map area self.zoneInfo.pins.mapId
carboniteMapLoaded = false,
carboniteNxMapOpen = nil,
checkedGrailVersion = false, -- used so the actual check can be simpler
checkedNPCs = {},
checkingNPCTechniqueNew = true,
chooseClosestWaypoint = true,
clearNPCTooltipData = function(self)
self.checkedNPCs = {}
self.npcs = {}
self:_RecordTooltipNPCs(GetCurrentMapAreaID())
end,
color = {
['B'] = "FF996600", -- brown [unobtainable]
['C'] = "FF00FF00", -- green [completed]
['D'] = "FF0099CC", -- daily [repeatable]
['G'] = "FFFFFF00", -- yellow [can accept]
['H'] = "FF0000FF", -- blue [daily + too high level]
['I'] = "FFFF00FF", -- purple [in log]
['K'] = "FF66CC66", -- greenish [weekly]
['L'] = "FFFFFFFF", -- white [too high level]
['P'] = "FFFF0000", -- red [does not meet prerequisites]
['R'] = "FF0099CC", -- daily [true repeatable - used for question mark in pins]
['U'] = "FF00FFFF", -- bogus default[unknown]
['W'] = "FF666666", -- grey [low-level can accept]
['Y'] = "FFCC6600", -- orange [legendary]
},
colorWells = {},
configurationScript1 = function(self)
Wholly:ScrollFrame_Update_WithCombatCheck()
Wholly.pinsNeedFiltering = true
Wholly:_UpdatePins()
Wholly:clearNPCTooltipData()
end,
configurationScript2 = function(self)
Wholly:_UpdatePins()
if Wholly.tooltip:IsVisible() and Wholly.tooltip:GetOwner() == Wholly.mapFrame then
Wholly.tooltip:ClearLines()
Wholly.tooltip:AddLine(Wholly.mapCountLine)
end
end,
configurationScript3 = function(self)
Wholly:_DisplayMapFrame(self:GetChecked())
end,
configurationScript4 = function(self)
Wholly:UpdateQuestCaches(true)
Wholly:ScrollFrame_Update_WithCombatCheck()
Wholly:_UpdatePins(true)
end,
configurationScript5 = function(self)
Wholly:UpdateBreadcrumb(Wholly)
end,
configurationScript7 = function(self)
Wholly:ScrollFrame_Update_WithCombatCheck()
end,
configurationScript8 = function(self)
Wholly:UpdateCoordinateSystem()
end,
configurationScript9 = function(self)
UIParentLoadAddOn("Grail-Achievements")
Wholly:_InitializeLevelOneData()
end,
configurationScript10 = function(self)
UIParentLoadAddOn("Grail-Reputations")
Wholly:_InitializeLevelOneData()
end,
configurationScript11 = function(self)
Wholly:ToggleCurrentFrame()
end,
configurationScript12 = function(self)
Wholly:ScrollFrameTwo_Update()
end,
configurationScript13 = function(self)
end,
configurationScript14 = function(self)
UIParentLoadAddOn("Grail-When")
end,
configurationScript15 = function(self)
UIParentLoadAddOn("Grail-Rewards")
end,
coordinates = nil,
currentFrame = nil,
currentMaximumTooltipLines = 50,
currentTt = 0,
debug = true,
defaultMaximumTooltipLines = 50,
dropdown = nil,
dropdownLimit = 40,
dropdownText = nil,
dungeonTest = {},
eventDispatch = {
['PLAYER_REGEN_ENABLED'] = function(self, frame)
self:ScrollFrame_Update()
frame:UnregisterEvent("PLAYER_REGEN_ENABLED")
end,
-- So in Blizzard's infinite wisdom it turns out that normal quests that just appear with the
-- quest giver post a QUEST_DETAIL event, unless they are quests like the Candy Bucket quests
-- which post a QUEST_COMPLETE event (even though they really are not complete until they are
-- accepted). And if there are more than one quest then QUEST_GREETING is posted, which also
-- is posted if one were to decline one of the selected ones to return to the multiple choice
-- frame again. Therefore, it seems three events are required to ensure the breadcrumb panel
-- is properly removed.
['QUEST_ACCEPTED'] = function(self, frame)
self:BreadcrumbUpdate(frame)
end,
['QUEST_COMPLETE'] = function(self, frame)
self:BreadcrumbUpdate(frame, true)
end,
['QUEST_DETAIL'] = function(self, frame)
self:BreadcrumbUpdate(frame)
end,
['QUEST_GREETING'] = function(self, frame)
com_mithrandir_whollyQuestInfoFrameText:SetText("")
com_mithrandir_whollyQuestInfoBuggedFrameText:SetText("")
com_mithrandir_whollyBreadcrumbFrame:Hide()
end,
['QUEST_LOG_UPDATE'] = function(self, frame) -- this is just here to record the tooltip information after a reload
frame:UnregisterEvent("QUEST_LOG_UPDATE")
-- This used to be in ADDON_LOADED but has been moved here because it was reported in 5.2.0
-- that the Achievements were not appearing properly, and this turned out to be caused by a
-- change that Blizzard seems to have done to make it so GetAchievementInfo() no longer has
-- a proper title in its return values at that point.
if WhollyDatabase.loadAchievementData then
self.configurationScript9()
end
self:_RecordTooltipNPCs(GetCurrentMapAreaID())
end,
['QUEST_PROGRESS'] = function(self, frame)
self:BreadcrumbUpdate(frame, true)
end,
['ADDON_LOADED'] = function(self, frame, arg1)
if "Wholly" == arg1 then
local WDB = WhollyDatabase
local Grail = Grail
local TomTom = TomTom
if nil == WDB.defaultsLoaded then
WDB = self:_LoadDefaults()
end
if nil == WDB.currentSortingMode then
WDB.currentSortingMode = 1
end
if nil == WDB.closedHeaders then
WDB.closedHeaders = {}
end
if nil == WDB.ignoredQuests then
WDB.ignoredQuests = {}
end
-- Setup the colors, only setting those that do not already exist
WDB.color = WDB.color or {}
for code, colorCode in pairs(self.color) do
WDB.color[code] = WDB.color[code] or colorCode
end
self:ConfigFrame_OnLoad(com_mithrandir_whollyConfigFrame, "Wholly")
self:ConfigFrame_OnLoad(com_mithrandir_whollyTitleAppearanceConfigFrame, Wholly.s.TITLE_APPEARANCE, "Wholly")
self:ConfigFrame_OnLoad(com_mithrandir_whollyWorldMapConfigFrame, Wholly.s.WORLD_MAP, "Wholly")
self:ConfigFrame_OnLoad(com_mithrandir_whollyWidePanelConfigFrame, Wholly.s.WIDE_PANEL, "Wholly")
self:ConfigFrame_OnLoad(com_mithrandir_whollyLoadDataConfigFrame, Wholly.s.LOAD_DATA, "Wholly")
self:ConfigFrame_OnLoad(com_mithrandir_whollyOtherConfigFrame, Wholly.s.OTHER_PREFERENCE, "Wholly")
-- Now to be nicer to those that have used the addon before the current
-- incarnation, newly added defaults will have their normal setting set
-- as appropriate.
if nil == WDB.version then -- first loaded prior to version 006, so default options added in 006
WDB.displaysHolidaysAlways = true -- version 006
WDB.updatesWorldMapOnZoneChange = true -- version 006
WDB.version = 6 -- just to make sure none of the other checks fails
end
if WDB.version < 7 then
WDB.showsInLogQuestStatus = true -- version 007
end
if WDB.version < 16 then
WDB.showsAchievementCompletionColors = true -- version 016
end
if WDB.version < 17 then
-- transform old values into new ones as appropriate
if WDB.showsDailyQuests then
WDB.showsRepeatableQuests = true
end
WDB.loadAchievementData = true
WDB.loadReputationData = true
end
if WDB.version < 27 then
WDB.showsHolidayQuests = true
end
if WDB.version < 34 then
WDB.loadDateData = true
end
if WDB.version < 38 then
WDB.displaysBlizzardQuestTooltips = true
end
if WDB.version < 39 then
WDB.showsWeeklyQuests = true
end
if WDB.version < 51 then
WDB.showsLegendaryQuests = true
end
if WDB.version < 53 then
WDB.showsPetBattleQuests = true
end
if WDB.version < 56 then
WDB.showsPVPQuests = true
end
WDB.version = Wholly.versionNumber
if WDB.maximumTooltipLines then
self.currentMaximumTooltipLines = WDB.maximumTooltipLines
else
self.currentMaximumTooltipLines = self.defaultMaximumTooltipLines
end
self:_DisplayMapFrame(WDB.displaysMapFrame)
Grail:RegisterObserver("Status", self._CallbackHandler)
Grail:RegisterObserverQuestAbandon(self._CallbackHandler)
Grail:RegisterObserver("WORLD_MAP_UPDATE", self._WorldMapUpdateHandler)
-- Find out which "map area" is for the player's class
for key, value in pairs(Grail.classMapping) do
if Grail.playerClass == value then
self.playerClassMap = Grail.classToMapAreaMapping['C'..key]
end
end
self:UpdateCoordinateSystem() -- installs OnUpdate script appropriately
frame:RegisterEvent("PLAYER_ENTERING_WORLD")
frame:RegisterEvent("QUEST_ACCEPTED")
frame:RegisterEvent("QUEST_COMPLETE") -- to clear the breadcrumb frame
frame:RegisterEvent("QUEST_GREETING") -- to clear the breadcrumb frame
frame:RegisterEvent("QUEST_LOG_UPDATE") -- just to be able update tooltips after reload UI
frame:RegisterEvent("QUEST_PROGRESS")
frame:RegisterEvent("WORLD_MAP_UPDATE") -- this is for pins
frame:RegisterEvent("ZONE_CHANGED_NEW_AREA") -- this is for the panel
self:UpdateBreadcrumb() -- sets up registration of events for breadcrumbs based on user preferences
if not WDB.shouldNotRestoreDirectionalArrows then
self:_ReinstateDirectionalArrows()
end
if WDB.loadReputationData then
self.configurationScript10()
end
if WDB.loadDateData then
self.configurationScript14()
end
if WDB.loadRewardData then
self.configurationScript15()
end
-- We steal the TomTom:RemoveWaypoint() function because we want to override it ourselves
if TomTom and TomTom.RemoveWaypoint then
self.removeWaypointFunction = TomTom.RemoveWaypoint
TomTom.RemoveWaypoint = function(self, uid)
Wholly:_RemoveDirectionalArrows(uid)
Wholly.removeWaypointFunction(TomTom, uid)
end
end
if TomTom and TomTom.ClearAllWaypoints then
self.clearAllWaypointsFunction = TomTom.ClearAllWaypoints
TomTom.ClearAllWaypoints = function(self)
Wholly:_RemoveAllDirectionalArrows()
Wholly.clearAllWaypointsFunction(TomTom)
end
end
-- We steal Carbonite's Nx.TTRemoveWaypoint() function because we need it to clear our waypoints
if Nx and Nx.TTRemoveWaypoint then
self.carboniteRemoveWaypointFunction = Nx.TTRemoveWaypoint
Nx.TTRemoveWaypoint = function(self, uid)
Wholly:_RemoveDirectionalArrows(uid)
Wholly.carboniteRemoveWaypointFunction(Nx, uid)
end
end
self.easyMenuFrame = CreateFrame("Frame", "com_mithrandir_whollyEasyMenu", self.currentFrame, "UIDropDownMenuTemplate")
self.easyMenuFrame:Hide()
StaticPopupDialogs["com_mithrandir_whollyTagDelete"] = {
text = CONFIRM_COMPACT_UNIT_FRAME_PROFILE_DELETION,
button1 = ACCEPT,
button2 = CANCEL,
OnAccept = function(self, tagName)
WhollyDatabase.tags[tagName] = nil
Wholly:ScrollFrameTwo_Update()
end,
timeout = 0,
whileDead = true,
hideOnEscape = true,
preferredIndex = 3,
}
self:_InitializeLevelOneData()
if WDB.useWidePanel then self:ToggleCurrentFrame() end
-- Set up Carbonite support
if Nx and Nx.Map then
self.carboniteNxMapOpen = Nx.Map.Open
Nx.Map.Open = function()
self.carboniteNxMapOpen(Nx.Map)
-- this is done this way because NxMap1 does not exist until Nx.Map.Open is called
tinsert(self.supportedControlMaps, NxMap1)
tinsert(self.supportedMaps, NxMap1)
tinsert(self.supportedPOIMaps, NxMap1)
self.carboniteMapLoaded = true
end
end
-- Allow specific quest detection to work even with previous versions of Grail
-- that do not have the expected API.
if nil == Grail.IsBonusObjective then
Grail.IsBonusObjective = function(self, questId) return false end
end
if nil == Grail.IsRareMob then
Grail.IsRareMob = function(self, questId) return false end
end
if nil == Grail.IsTreasure then
Grail.IsTreasure = function(self, questId) return false end
end
if nil == Grail.IsPetBattle then
Grail.IsPetBattle = function(self, questId) return (bitband(Grail:CodeType(questId), Grail.bitMaskQuestPetBattle) > 0) end
end
-- Make it so we can populate the questId into the QuestLogPopupDetailFrame
self.QuestLogPopupDetailFrame_Show = QuestLogPopupDetailFrame_Show
QuestLogPopupDetailFrame_Show = function(questLogIndex)
local questId = select(8, GetQuestLogTitle(questLogIndex))
com_mithrandir_whollyPopupQuestInfoFrameText:SetText(questId)
Wholly.QuestLogPopupDetailFrame_Show(questLogIndex)
end
end
end,
['WORLD_MAP_UPDATE'] = function(self, frame)
Grail:_CoalesceDelayedNotification("WORLD_MAP_UPDATE", 0.1)
end,
['PLAYER_ENTERING_WORLD'] = function(self, frame)
-- It turns out that GetCurrentMapAreaID() and GetCurrentMapDungeonLevel() are not working properly unless the map system is accessed.
-- This would manifest itself when the UI is reloaded, and then the map location would be lost. By forcing the map to the current zone
-- the problem goes away.
SetMapToCurrentZone()
self.zoneInfo.map.mapId = GetCurrentMapAreaID()
self.zoneInfo.map.dungeonLevel = GetCurrentMapDungeonLevel()
self.zoneInfo.zone.mapId = self.zoneInfo.map.mapId
self.zoneInfo.zone.dungeonLevel = self.zoneInfo.map.dungeonLevel
end,
['ZONE_CHANGED_NEW_AREA'] = function(self, frame)
local mapWeSupportIsVisible = false
local WDB = WhollyDatabase
local Grail = Grail
-- Blizzard sends out WORLD_MAP_UPDATE before it sends out ZONE_CHANGED_NEW_AREA
-- and we really do not want both as we do our work here. So, we remove our own
-- delayed processing of WORLD_MAP_UPDATE in this case. Normal ones we want our
-- code to process, which are ones from the user clicking the map UI elements.
Grail:_RemoveDelayedNotification("WORLD_MAP_UPDATE")
-- Detect if any of the maps on which Wholly can put pins is currently visible because
-- if none are, we do not need to worry about switching maps back.
for _, mapFrame in pairs(self.supportedControlMaps) do
if mapFrame and mapFrame:IsVisible() then
mapWeSupportIsVisible = true
break
end
end
-- Blizzard default behavior is to leave the map alone if it is open, otherwise it will set
-- the map to the new zone. Wholly offers the ability to set the open map to the new zone
-- based on a preference value. Wholly is going to force the map to the new zone no matter
-- what, and then reset it to the previous zone if the user does not want Wholly to change
-- the open map.
SetMapToCurrentZone()
self.zoneInfo.zone.mapId = GetCurrentMapAreaID()
self.zoneInfo.zone.dungeonLevel = GetCurrentMapDungeonLevel()
if not WDB.updatesWorldMapOnZoneChange and mapWeSupportIsVisible then
SetMapByID(self.zoneInfo.map.mapId)
if 0 ~= self.zoneInfo.map.dungeonLevel then
SetDungeonMapLevel(self.zoneInfo.map.dungeonLevel)
end
end
self:UpdateQuestCaches(false, false, WDB.updatesPanelWhenZoneChanges, true)
if self.checkingNPCTechniqueNew then
-- When first entering a zone for the first time the NPCs need to be studied to see whether their
-- tooltips need to be modified with quest information.
local newMapId = self.zoneInfo.zone.mapId
if not self.checkedNPCs[newMapId] then
self:_RecordTooltipNPCs(newMapId)
end
end
-- Now update open tooltips showing our quest count data
if GameTooltip:IsVisible() then
if GameTooltip:GetOwner() == com_mithrandir_whollyFrameSwitchZoneButton then
GameTooltip:ClearLines()
GameTooltip:AddLine(Wholly.panelCountLine)
elseif GameTooltip:GetOwner() == self.ldbTooltipOwner then -- LibDataBroker tooltip
GameTooltip:ClearLines()
GameTooltip:AddLine("Wholly - " .. Wholly:_Dropdown_GetText() )
GameTooltip:AddLine(Wholly.panelCountLine)
elseif GameTooltip:GetOwner() == self.ldbCoordinatesTooltipOwner then -- LibDataBroker coordinates tooltip
GameTooltip:ClearLines()
local dungeonLevel = Wholly.zoneInfo.zone.dungeonLevel
local dungeonIndicator = (dungeonLevel > 0) and "["..dungeonLevel.."]" or ""
local mapAreaId = Wholly.zoneInfo.zone.mapId
local mapAreaName = Grail:MapAreaName(mapAreaId) or "UNKNOWN"
GameTooltip:AddLine(strformat("%d%s %s", mapAreaId, dungeonIndicator, mapAreaName))
end
elseif self.tooltip:IsVisible() then
if self.tooltip:GetOwner() == self.mapFrame then
self.tooltip:ClearLines()
self.tooltip:AddLine(Wholly.mapCountLine)
end
end
end,
},
filteredPanelQuests = {}, -- filtered table from cachedPanelQuests using current panel filters
filteredPinQuests = {}, -- filtered table from cachedPinQuests using current pin filters
initialUpdateProcessed = false,
lastWhich = nil,
lastPrerequisiteQuest = nil,
lastUpdate = 0,
ldbCoordinatesTooltipOwner = nil,
ldbTooltipOwner = nil,
levelOneCurrent = nil,
levelOneData = nil,
levelTwoCurrent = nil,
levelTwoData = nil,
mapFrame = nil, -- the world map frame that contains the checkbox to toggle pins
maximumSearchHistory = 10,
npcs = {},
onlyAddingTooltipToGameTooltip = false,
pairedConfigurationButton = nil,-- configuration panel button that does the same thing as the world map button
pairedCoordinatesButton = nil, -- configuration panel button that does the same thing as the LDB coordinate button
panelCountLine = "",
pinsDisplayedLast = nil,
pinsNeedFiltering = false,
playerAliveReceived = false,
playerClassMap = nil,
preferenceButtons = {}, -- when each of the preference buttons gets created we put them in here to be able to access them if we want
previousX = 0,
previousY = 0,
receivedCalendarUpdateEventList = false,
pins = {}, -- the pins are contained in a structure that follows, where the first key is the parent frame of the pins contained
-- pins = {
-- [WorldMapDetailFrame] = {
-- [npcs] = {}, -- each key is the NPC id, and the value is the actual pin
-- [ids] = {}, -- each key is the id : NPC id, and the value is the actual pin
-- },
-- }
removeWaypointFunction = nil,
s = {
-- Start of actual strings that need localization.
['KILL_TO_START_FORMAT'] = "Kill to start [%s]",
['DROP_TO_START_FORMAT'] = "Drops %s to start [%s]",
['REQUIRES_FORMAT'] = "Wholly requires Grail version %s or later",
['MUST_KILL_PIN_FORMAT'] = "%s [Kill]",
['ESCORT'] = "Escort",
['BREADCRUMB'] = "Breadcrumb quests:",
['IS_BREADCRUMB'] = "Is breadcrumb quest for:",
['PREREQUISITES'] = "Prerequisites:",
['OTHER'] = "Other",
['SINGLE_BREADCRUMB_FORMAT'] = "Breadcrumb quest available",
['MULTIPLE_BREADCRUMB_FORMAT'] = "%d Breadcrumb quests available",
['WORLD_EVENTS'] = "World Events",
['REPUTATION_REQUIRED'] = "Reputation Required",
['REPEATABLE'] = "Repeatable",
['YEARLY'] = "Yearly",
['GRAIL_NOT_HAVE'] = "|cFFFF0000Grail does not have this quest|r",
['QUEST_ID'] = "Quest ID: ",
['REQUIRED_LEVEL'] = "Required Level",
['MAXIMUM_LEVEL_NONE'] = "None",
['QUEST_TYPE_NORMAL'] = "Normal",
['MAPAREA_NONE'] = "None",
['LOREMASTER_AREA'] = "Loremaster Area",
['FACTION_BOTH'] = "Both",
['CLASS_NONE'] = "None",
['CLASS_ANY'] = "Any",
['GENDER_NONE'] = "None",
['GENDER_BOTH'] = "Both",
['GENDER'] = "Gender",
['RACE_NONE'] = "None",
['RACE_ANY'] = "Any",
['HOLIDAYS_ONLY'] = "Available only during Holidays:",
['SP_MESSAGE'] = "Special quest never enters Blizzard quest log",
['INVALIDATE'] = "Invalidated by Quests:",
['OAC'] = "On acceptance complete quests:",
['OCC'] = "On completion of requirements complete quests:",
['OTC'] = "On turn in complete quests:",
['ENTER_ZONE'] = "Accepted when entering map area",
['WHEN_KILL'] = "Accepted when killing:",
['SEARCH_NEW'] = "New",
['SEARCH_CLEAR'] = "Clear",
['SEARCH_ALL_QUESTS'] = "All quests",
['NEAR'] = "Near",
['FIRST_PREREQUISITE'] = "First in Prerequisite Chain:",
['BUGGED'] = "|cffff0000*** BUGGED ***|r",
['IN_LOG'] = "In Log",
['TURNED_IN'] = "Turned in",
['EVER_COMPLETED'] = "Has ever been completed",
['ITEM'] = "Item",
['ITEM_LACK'] = "Item lack",
['ABANDONED'] = "Abandoned",
['NEVER_ABANDONED'] = "Never Abandoned",
['ACCEPTED'] = "Accepted",
['LEGENDARY'] = "Legendary",
['ACCOUNT'] = "Account",
['EVER_CAST'] = "Has ever cast",
['EVER_EXPERIENCED'] = "Has ever experienced",
['TAGS'] = "Tags",
['TAGS_NEW'] = "New Tag",
['TAGS_DELETE'] = "Delete Tag",
['MAP'] = "Map",
['PLOT'] = "Plot",
['BUILDING'] = "Building",
['BASE_QUESTS'] = "Base Quests",
['COMPLETED'] = "Completed",
['NEEDS_PREREQUISITES'] = "Needs prerequisites",
['UNOBTAINABLE'] = "Unobtainable",
['LOW_LEVEL'] = "Low-level",
['HIGH_LEVEL'] = "High level",
['TITLE_APPEARANCE'] = "Quest Title Appearance",
['PREPEND_LEVEL'] = "Prepend quest level",
['APPEND_LEVEL'] = "Append required level",
['REPEATABLE_COMPLETED'] = "Show whether repeatable quests previously completed",
['IN_LOG_STATUS'] = "Show status of quests in log",
['MAP_PINS'] = "Display map pins for quest givers",
['MAP_BUTTON'] = "Display button on world map",
['MAP_DUNGEONS'] = "Display dungeon quests in outer map",
['MAP_UPDATES'] = "Open world map updates when zones change",
['OTHER_PREFERENCE'] = "Other",
['PANEL_UPDATES'] = "Quest log panel updates when zones change",
['SHOW_BREADCRUMB'] = "Display breadcrumb quest information on Quest Frame",
['SHOW_LOREMASTER'] = "Show only Loremaster quests",
['ENABLE_COORDINATES'] = "Enable player coordinates",
['ACHIEVEMENT_COLORS'] = "Show achievement completion colors",
['BUGGED_UNOBTAINABLE'] = "Bugged quests considered unobtainable",
['BLIZZARD_TOOLTIP'] = "Tooltips appear on Blizzard Quest Log",
['WIDE_PANEL'] = "Wide Wholly Quest Panel",
['WIDE_SHOW'] = "Show",
['QUEST_COUNTS'] = "Show quest counts",
['LIVE_COUNTS'] = "Live quest count updates",
['LOAD_DATA'] = "Load Data",
['COMPLETION_DATES'] = "Completion Dates",
['ALL_FACTION_REPUTATIONS'] = "Show all faction reputations",
['RARE_MOBS'] = 'Rare Mobs',
['TREASURE'] = 'Treasure',
['EMPTY_ZONES'] = 'Display empty zones',
['IGNORE_REPUTATION_SECTION'] = 'Ignore reputation section of quests',
['RESTORE_DIRECTIONAL_ARROWS'] = 'Should not restore directional arrows',
['ADD_ADVENTURE_GUIDE'] = 'Display Adventure Guide quests in every zone',
},
supportedControlMaps = { WorldMapFrame, OmegaMapFrame, }, -- the frame to check for visibility
supportedMaps = { WorldMapDetailFrame, OmegaMapDetailFrame, }, -- the frame that is the parent of the pins
supportedPOIMaps = { WorldMapPOIFrame, OmegaMapPOIFrame, }, -- the frame to use to set pin level, index from supportedMaps used to determine which to use
tooltip = nil,
updateDelay = 0.5,
updateThreshold = 0.1,
versionNumber = Wholly_File_Version,
waypoints = {},
zoneInfo = {
["map"] = { ["mapId"] = 0, ["dungeonLevel"] = 0, }, -- this is what the world map is set to
["panel"] = { ["mapId"] = 0, ["dungeonLevel"] = 0, }, -- this is what the Wholly panel is displaying
["pins"] = { ["mapId"] = 0, ["dungeonLevel"] = 0, }, -- this is where the pins were last showing
["zone"] = { ["mapId"] = 0, ["dungeonLevel"] = 0, }, -- this is where the player is
},
_AchievementName = function(self, mapID)
local colorStart, colorEnd = "", ""
local Grail = Grail
local baseName = Grail:MapAreaName(mapID) or "UNKONWN"
if WhollyDatabase.showsAchievementCompletionColors then
local completed = Grail:AchievementComplete(mapID - Grail.mapAreaBaseAchievement)
colorStart = completed and "|cff00ff00" or "|cffffff00"
colorEnd = "|r"
end
return colorStart .. baseName .. colorEnd, baseName
end,
_AddDirectionalArrows = function(self, questTable, npcType, groupNumberToUse)
local TomTom = TomTom
if not TomTom or not TomTom.AddMFWaypoint then return end
if nil == questTable or nil == npcType then return end
local locations
local WDB = WhollyDatabase
local Grail = Grail
if not groupNumberToUse then
WDB.lastGrouping = WDB.lastGrouping or 0 -- initialize if needed
WDB.lastGrouping = WDB.lastGrouping + 1
WDB.waypointGrouping = WDB.waypointGrouping or {}
WDB.waypointGrouping[WDB.lastGrouping] = {}
end
for _, questId in pairs(questTable) do
if 'T' == npcType then
locations = Grail:QuestLocationsTurnin(questId)