Repository navigation
Expand file tree
/
Copy pathEllesmereUI_FriendsKit.lua
More file actions
1838 lines (1732 loc) · 66.5 KB
/
Copy pathEllesmereUI_FriendsKit.lua
File metadata and controls
1838 lines (1732 loc) · 66.5 KB
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
if EUI_CLIENT_BLOCKED then return end -- pre-12.1 client failsafe (EllesmereUI_ClientGate.lua)
-------------------------------------------------------------------------------
-- EllesmereUI_FriendsKit.lua
-- The friends list pieces two modules share, so neither keeps a copy: the
-- Friends List module on retail, and Blizzard Skins+ on WoW Forever, where
-- the Friends List module never loads and the Window Skins "Friends List"
-- card hosts them (EllesmereUIBlizzardSkin_FriendsForever.lua):
-- - the realm -> region lookup and the region icons (public API);
-- - the 12.1 Social UI friend tiles (EllesmereUI.FriendsKit.StartTiles);
-- - auto-accepting group invites from friends (FriendsKit.SyncAutoAccept);
-- - the Class Icon Theme choices both settings pages offer.
-- At load this file only defines functions and constant tables: nothing
-- runs, registers or builds until a host starts it.
-------------------------------------------------------------------------------
local Kit = {}
EllesmereUI.FriendsKit = Kit
local MEDIA = "Interface\\AddOns\\EllesmereUI\\media\\friends\\"
-------------------------------------------------------------------------------
-- Realm -> region lookup for friend region detection
-- Mini regions: namerica, samerica, australia, europe, russia, korea, taiwan, china
-- Full regions: NA (namerica+samerica+australia), EU (europe+russia), KR, TW, CN
-------------------------------------------------------------------------------
local MINI_TO_FULL = {
namerica = "NA",
samerica = "NA",
australia = "NA",
europe = "EU",
russia = "EU",
korea = "KR",
taiwan = "TW",
china = "CN",
}
local REGION_ID_TO_FULL = {
[1] = "NA", -- Americas + Oceania
[2] = "KR",
[3] = "EU", -- Europe + Russia
[4] = "TW",
[5] = "CN",
}
-- The realm tables, built on the first lookup (only friends list code reads
-- them, and only while a friends window is painted)
local REALMS_NA, REALMS_EU, REALMS_ASIA
local function LoadRealms()
-- Region 1: Americas & Oceania
REALMS_NA = {
["Azralon"] = "samerica",
["Gallywix"] = "samerica",
["Goldrinn"] = "samerica",
["Nemesis"] = "samerica",
["TolBarad"] = "samerica",
["Drakkari"] = "samerica",
["Quel'Thalas"] = "samerica",
["Ragnaros"] = "samerica",
["Loatheb"] = "samerica",
["Aman'Thul"] = "australia",
["Barthilas"] = "australia",
["Caelestrasz"] = "australia",
["Dath'Remar"] = "australia",
["Dreadmaul"] = "australia",
["Frostmourne"] = "australia",
["Gundrak"] = "australia",
["Jubei'Thos"] = "australia",
["Khaz'goroth"] = "australia",
["Nagrand"] = "australia",
["Saurfang"] = "australia",
["Thaurissan"] = "australia",
["Arugal"] = "australia",
["Yojamba"] = "australia",
["Remulos"] = "australia",
["Felstriker"] = "australia",
["Shadowstrike"] = "australia",
["Penance"] = "australia",
["Aegwynn"] = "namerica",
["AeriePeak"] = "namerica",
["Agamaggan"] = "namerica",
["Aggramar"] = "namerica",
["Akama"] = "namerica",
["Alexstrasza"] = "namerica",
["Alleria"] = "namerica",
["AltarofStorms"] = "namerica",
["AlteracMountains"] = "namerica",
["Andorhal"] = "namerica",
["Anetheron"] = "namerica",
["Antonidas"] = "namerica",
["Anub'arak"] = "namerica",
["Anvilmar"] = "namerica",
["Arathor"] = "namerica",
["Archimonde"] = "namerica",
["Area52"] = "namerica",
["ArgentDawn"] = "namerica",
["Arthas"] = "namerica",
["Arygos"] = "namerica",
["Auchindoun"] = "namerica",
["Azgalor"] = "namerica",
["AzjolNerub"] = "namerica",
["Azshara"] = "namerica",
["Azuremyst"] = "namerica",
["Baelgun"] = "namerica",
["Balnazzar"] = "namerica",
["BlackDragonflight"] = "namerica",
["Blackhand"] = "namerica",
["Blackrock"] = "namerica",
["BlackwaterRaiders"] = "namerica",
["BlackwingLair"] = "namerica",
["Blade'sEdge"] = "namerica",
["Bladefist"] = "namerica",
["BleedingHollow"] = "namerica",
["BloodFurnace"] = "namerica",
["Bloodhoof"] = "namerica",
["Bloodscalp"] = "namerica",
["Bonechewer"] = "namerica",
["BoreanTundra"] = "namerica",
["Boulderfist"] = "namerica",
["Bronzebeard"] = "namerica",
["BurningBlade"] = "namerica",
["BurningLegion"] = "namerica",
["Cairne"] = "namerica",
["CenarionCircle"] = "namerica",
["Cenarius"] = "namerica",
["Cho'gall"] = "namerica",
["Chromaggus"] = "namerica",
["Coilfang"] = "namerica",
["Crushridge"] = "namerica",
["Daggerspine"] = "namerica",
["Dalaran"] = "namerica",
["Dalvengyr"] = "namerica",
["DarkIron"] = "namerica",
["Darkspear"] = "namerica",
["Darrowmere"] = "namerica",
["Dawnbringer"] = "namerica",
["Deathwing"] = "namerica",
["DemonSoul"] = "namerica",
["Dentarg"] = "namerica",
["Destromath"] = "namerica",
["Dethecus"] = "namerica",
["Detheroc"] = "namerica",
["Doomhammer"] = "namerica",
["Draenor"] = "namerica",
["Dragonblight"] = "namerica",
["Dragonmaw"] = "namerica",
["Drenden"] = "namerica",
["Dunemaul"] = "namerica",
["Durotan"] = "namerica",
["Duskwood"] = "namerica",
["EarthenRing"] = "namerica",
["EchoIsles"] = "namerica",
["Eitrigg"] = "namerica",
["Eldre'Thalas"] = "namerica",
["Elune"] = "namerica",
["EmeraldDream"] = "namerica",
["Eonar"] = "namerica",
["Eredar"] = "namerica",
["Executus"] = "namerica",
["Exodar"] = "namerica",
["Farstriders"] = "namerica",
["Feathermoon"] = "namerica",
["Fenris"] = "namerica",
["Firetree"] = "namerica",
["Fizzcrank"] = "namerica",
["Frostmane"] = "namerica",
["Frostwolf"] = "namerica",
["Galakrond"] = "namerica",
["Garithos"] = "namerica",
["Garona"] = "namerica",
["Garrosh"] = "namerica",
["Ghostlands"] = "namerica",
["Gilneas"] = "namerica",
["Gnomeregan"] = "namerica",
["Gorefiend"] = "namerica",
["Gorgonnash"] = "namerica",
["Greymane"] = "namerica",
["GrizzlyHills"] = "namerica",
["Gul'dan"] = "namerica",
["Gurubashi"] = "namerica",
["Hakkar"] = "namerica",
["Haomarush"] = "namerica",
["Hellscream"] = "namerica",
["Hydraxis"] = "namerica",
["Hyjal"] = "namerica",
["Icecrown"] = "namerica",
["Illidan"] = "namerica",
["Jaedenar"] = "namerica",
["Kael'thas"] = "namerica",
["Kalecgos"] = "namerica",
["Kargath"] = "namerica",
["Kel'Thuzad"] = "namerica",
["Khadgar"] = "namerica",
["KhazModan"] = "namerica",
["Kil'jaeden"] = "namerica",
["Kilrogg"] = "namerica",
["KirinTor"] = "namerica",
["Korgath"] = "namerica",
["Korialstrasz"] = "namerica",
["KulTiras"] = "namerica",
["LaughingSkull"] = "namerica",
["Lethon"] = "namerica",
["Lightbringer"] = "namerica",
["Lightning'sBlade"] = "namerica",
["Lightninghoof"] = "namerica",
["Llane"] = "namerica",
["Lothar"] = "namerica",
["Madoran"] = "namerica",
["Maelstrom"] = "namerica",
["Magtheridon"] = "namerica",
["Maiev"] = "namerica",
["Mal'Ganis"] = "namerica",
["Malfurion"] = "namerica",
["Malorne"] = "namerica",
["Malygos"] = "namerica",
["Mannoroth"] = "namerica",
["Medivh"] = "namerica",
["Misha"] = "namerica",
["Mok'Nathal"] = "namerica",
["MoonGuard"] = "namerica",
["Moonrunner"] = "namerica",
["Mug'thol"] = "namerica",
["Muradin"] = "namerica",
["Nathrezim"] = "namerica",
["Nazgrel"] = "namerica",
["Nazjatar"] = "namerica",
["Ner'zhul"] = "namerica",
["Nesingwary"] = "namerica",
["Nordrassil"] = "namerica",
["Norgannon"] = "namerica",
["Onyxia"] = "namerica",
["Perenolde"] = "namerica",
["Proudmoore"] = "namerica",
["Quel'dorei"] = "namerica",
["Ravencrest"] = "namerica",
["Ravenholdt"] = "namerica",
["Rexxar"] = "namerica",
["Rivendare"] = "namerica",
["Runetotem"] = "namerica",
["Sargeras"] = "namerica",
["ScarletCrusade"] = "namerica",
["Scilla"] = "namerica",
["Sen'jin"] = "namerica",
["Sentinels"] = "namerica",
["ShadowCouncil"] = "namerica",
["Shadowmoon"] = "namerica",
["Shadowsong"] = "namerica",
["Shandris"] = "namerica",
["ShatteredHalls"] = "namerica",
["ShatteredHand"] = "namerica",
["Shu'halo"] = "namerica",
["SilverHand"] = "namerica",
["Silvermoon"] = "namerica",
["SistersofElune"] = "namerica",
["Skullcrusher"] = "namerica",
["Skywall"] = "namerica",
["Smolderthorn"] = "namerica",
["Spinebreaker"] = "namerica",
["Spirestone"] = "namerica",
["Staghelm"] = "namerica",
["SteamwheedleCartel"] = "namerica",
["Stonemaul"] = "namerica",
["Stormrage"] = "namerica",
["Stormreaver"] = "namerica",
["Stormscale"] = "namerica",
["Suramar"] = "namerica",
["Tanaris"] = "namerica",
["Terenas"] = "namerica",
["Terokkar"] = "namerica",
["TheForgottenCoast"] = "namerica",
["TheScryers"] = "namerica",
["TheUnderbog"] = "namerica",
["TheVentureCo"] = "namerica",
["ThoriumBrotherhood"] = "namerica",
["Thrall"] = "namerica",
["Thunderhorn"] = "namerica",
["Thunderlord"] = "namerica",
["Tichondrius"] = "namerica",
["Tortheldrin"] = "namerica",
["Trollbane"] = "namerica",
["Turalyon"] = "namerica",
["TwistingNether"] = "namerica",
["Uldaman"] = "namerica",
["Uldum"] = "namerica",
["Undermine"] = "namerica",
["Ursin"] = "namerica",
["Uther"] = "namerica",
["Vashj"] = "namerica",
["Vek'nilash"] = "namerica",
["Velen"] = "namerica",
["Warsong"] = "namerica",
["Whisperwind"] = "namerica",
["Wildhammer"] = "namerica",
["Windrunner"] = "namerica",
["Winterhoof"] = "namerica",
["WyrmrestAccord"] = "namerica",
["Ysera"] = "namerica",
["Ysondre"] = "namerica",
["Zangarmarsh"] = "namerica",
["Zul'jin"] = "namerica",
["Zuluhed"] = "namerica",
["Ashkandi"] = "namerica",
["Atiesh"] = "namerica",
["Benediction"] = "namerica",
["BloodsailBuccaneers"] = "namerica",
["Faerlina"] = "namerica",
["Grobbulus"] = "namerica",
["Mankrik"] = "namerica",
["OldBlanchy"] = "namerica",
["Westfall"] = "namerica",
["Whitemane"] = "namerica",
["ChaosBolt"] = "namerica",
["CrusaderStrike"] = "namerica",
["DefiasPillager"] = "namerica",
["Doomhowl"] = "namerica",
["Dreamscythe"] = "namerica",
["LavaLash"] = "namerica",
["LivingFlame"] = "namerica",
["LoneWolf"] = "namerica",
["Nightslayer"] = "namerica",
["Pagle"] = "namerica",
["SkullRock"] = "namerica",
["WildGrowth"] = "namerica",
["Maladath"] = "australia",
}
-- Region 3: Europe & Russia
REALMS_EU = {
["Aegwynn"] = "europe",
["Alexstrasza"] = "europe",
["Alleria"] = "europe",
["Ambossar"] = "europe",
["Aman'Thul"] = "europe",
["Antonidas"] = "europe",
["Anub'arak"] = "europe",
["Area52"] = "europe",
["Arthas"] = "europe",
["Arygos"] = "europe",
["Azshara"] = "europe",
["Baelgun"] = "europe",
["Blackhand"] = "europe",
["Blackmoore"] = "europe",
["Blackrock"] = "europe",
["Blutkessel"] = "europe",
["Dalvengyr"] = "europe",
["DasKonsortium"] = "europe",
["DasSyndikat"] = "europe",
["DerMithrilorden"] = "europe",
["DerRatvonDalaran"] = "europe",
["Destromath"] = "europe",
["Dethecus"] = "europe",
["DieAldor"] = "europe",
["DieArguswacht"] = "europe",
["DieewigeWacht"] = "europe",
["DieNachtwache"] = "europe",
["DieSilberneHand"] = "europe",
["DieTodeskrallen"] = "europe",
["DunMorogh"] = "europe",
["Echsenkessel"] = "europe",
["Eredar"] = "europe",
["Everlook"] = "europe",
["FestungderSt\195\188rme"] = "europe",
["Forscherliga"] = "europe",
["Frostmourne"] = "europe",
["Frostwolf"] = "europe",
["Garrosh"] = "europe",
["Gilneas"] = "europe",
["Gorgonnash"] = "europe",
["Gul'dan"] = "europe",
["Kargath"] = "europe",
["Kel'Thuzad"] = "europe",
["Khaz'goroth"] = "europe",
["Kil'jaeden"] = "europe",
["Krag'jin"] = "europe",
["Lothar"] = "europe",
["Madmortem"] = "europe",
["Mal'Ganis"] = "europe",
["Malfurion"] = "europe",
["Malorne"] = "europe",
["Malygos"] = "europe",
["Mannoroth"] = "europe",
["Mug'thol"] = "europe",
["Nathrezim"] = "europe",
["Nazjatar"] = "europe",
["Nera'thor"] = "europe",
["Nethersturm"] = "europe",
["Norgannon"] = "europe",
["Nozdormu"] = "europe",
["Onyxia"] = "europe",
["Perenolde"] = "europe",
["Proudmoore"] = "europe",
["Rajaxx"] = "europe",
["Rexxar"] = "europe",
["Sen'jin"] = "europe",
["Shattrath"] = "europe",
["Shen'dralar"] = "europe",
["SteamwheedleCartel"] = "europe",
["Taerar"] = "europe",
["Teldrassil"] = "europe",
["Terrordar"] = "europe",
["Theradras"] = "europe",
["Thrall"] = "europe",
["Tichondrius"] = "europe",
["Tirion"] = "europe",
["Todeswache"] = "europe",
["Ulduar"] = "europe",
["Un'Goro"] = "europe",
["Vek'lor"] = "europe",
["Venoxis"] = "europe",
["Wrathbringer"] = "europe",
["Ysera"] = "europe",
["ZirkeldesCenarius"] = "europe",
["Zuluhed"] = "europe",
["Arak-arahm"] = "europe",
["Arathi"] = "europe",
["Archimonde"] = "europe",
["Auberdine"] = "europe",
["Chants\195\169ternels"] = "europe",
["Cho'gall"] = "europe",
["Chromaggus"] = "europe",
["Confr\195\169rieduThorium"] = "europe",
["ConseildesOmbres"] = "europe",
["CulteDeLaRiveNoire"] = "europe",
["Dalaran"] = "europe",
["Drek'Thar"] = "europe",
["Eitrigg"] = "europe",
["Eldre'Thalas"] = "europe",
["Elune"] = "europe",
["Garona"] = "europe",
["Hyjal"] = "europe",
["Illidan"] = "europe",
["Kael'thas"] = "europe",
["KhazModan"] = "europe",
["KirinTor"] = "europe",
["Krasus"] = "europe",
["LaCroisade\195\169carlate"] = "europe",
["LesClairvoyants"] = "europe",
["LesSentinelles"] = "europe",
["Mar\195\169cagedeZangar"] = "europe",
["Medivh"] = "europe",
["Naxxramas"] = "europe",
["Ner'zhul"] = "europe",
["Rashgarroth"] = "europe",
["Sargeras"] = "europe",
["Sinstralis"] = "europe",
["Suramar"] = "europe",
["Templenoir"] = "europe",
["Throk'Feroth"] = "europe",
["Uldaman"] = "europe",
["Varimathras"] = "europe",
["Vol'jin"] = "europe",
["Ysondre"] = "europe",
["C'Thun"] = "europe",
["ColinasPardas"] = "europe",
["DunModr"] = "europe",
["Exodar"] = "europe",
["LosErrantes"] = "europe",
["Mandokir"] = "europe",
["Minahonda"] = "europe",
["Sanguino"] = "europe",
["Shen'dralar"] = "europe",
["Tyrande"] = "europe",
["Uldum"] = "europe",
["Zul'jin"] = "europe",
["Nemesis"] = "europe",
["Pozzodell'Eternit\195\160"] = "europe",
["Aggra"] = "europe",
["GrimBatol"] = "europe",
["Ashenvale"] = "russia",
["Azuregos"] = "russia",
["Blackscar"] = "russia",
["BootyBay"] = "russia",
["BoreanTundra"] = "russia",
["Chromie"] = "russia",
["Deathguard"] = "russia",
["Deepholm"] = "russia",
["Eversong"] = "russia",
["Flamegor"] = "russia",
["Fordragon"] = "russia",
["Galakrond"] = "russia",
["Goldrinn"] = "russia",
["Gordunni"] = "russia",
["Grommash"] = "russia",
["HowlingFjord"] = "russia",
["LichKing"] = "russia",
["MoltenCore"] = "russia",
["Razuvious"] = "russia",
["Soulflayer"] = "russia",
["Theradras"] = "russia",
["Thermaplugg"] = "russia",
["Wyrmthalak"] = "russia",
["Agamaggan"] = "europe",
["Aggramar"] = "europe",
["Ahn'Qiraj"] = "europe",
["Al'Akir"] = "europe",
["Alonsus"] = "europe",
["Anachronos"] = "europe",
["Arathor"] = "europe",
["ArgentDawn"] = "europe",
["Aszune"] = "europe",
["Auchindoun"] = "europe",
["AzjolNerub"] = "europe",
["Azuremyst"] = "europe",
["Balnazzar"] = "europe",
["Blade'sEdge"] = "europe",
["Bladefist"] = "europe",
["Bloodfeather"] = "europe",
["Bloodhoof"] = "europe",
["Bloodscalp"] = "europe",
["Boulderfist"] = "europe",
["Bronzebeard"] = "europe",
["BronzeDragonflight"] = "europe",
["BurningBlade"] = "europe",
["BurningLegion"] = "europe",
["BurningSteppes"] = "europe",
["ChamberofAspects"] = "europe",
["Chromaggus"] = "europe",
["Crushridge"] = "europe",
["Daggerspine"] = "europe",
["DarkmoonFaire"] = "europe",
["Darksorrow"] = "europe",
["Darkspear"] = "europe",
["Deathwing"] = "europe",
["DefiasBrotherhood"] = "europe",
["Dentarg"] = "europe",
["Doomhammer"] = "europe",
["Draenor"] = "europe",
["Dragonblight"] = "europe",
["Dragonmaw"] = "europe",
["Drak'thul"] = "europe",
["Dunemaul"] = "europe",
["EarthenRing"] = "europe",
["EmeraldDream"] = "europe",
["Emeriss"] = "europe",
["Eonar"] = "europe",
["Executus"] = "europe",
["Frostmane"] = "europe",
["Frostwhisper"] = "europe",
["Genjuros"] = "europe",
["Ghostlands"] = "europe",
["GrimBatol"] = "europe",
["Hakkar"] = "europe",
["Haomarush"] = "europe",
["Hellfire"] = "europe",
["Hellscream"] = "europe",
["Jaedenar"] = "europe",
["Karazhan"] = "europe",
["Kazzak"] = "europe",
["Khadgar"] = "europe",
["Kilrogg"] = "europe",
["Kor'gall"] = "europe",
["KulTiras"] = "europe",
["LaughingSkull"] = "europe",
["Lightbringer"] = "europe",
["Lightning'sBlade"] = "europe",
["Magtheridon"] = "europe",
["Mazrigos"] = "europe",
["Moonglade"] = "europe",
["Nagrand"] = "europe",
["Neptulon"] = "europe",
["Nordrassil"] = "europe",
["Outland"] = "europe",
["Quel'Thalas"] = "europe",
["Ragnaros"] = "europe",
["Ravencrest"] = "europe",
["Ravenholdt"] = "europe",
["Runetotem"] = "europe",
["Saurfang"] = "europe",
["ScarshieldLegion"] = "europe",
["Shadowsong"] = "europe",
["ShatteredHalls"] = "europe",
["ShatteredHand"] = "europe",
["Silvermoon"] = "europe",
["Skullcrusher"] = "europe",
["Spinebreaker"] = "europe",
["Sporeggar"] = "europe",
["Stormrage"] = "europe",
["Stormreaver"] = "europe",
["Stormscale"] = "europe",
["Sunstrider"] = "europe",
["Sylvanas"] = "europe",
["Talnivarr"] = "europe",
["TarrenMill"] = "europe",
["Terenas"] = "europe",
["Terokkar"] = "europe",
["TheMaelstrom"] = "europe",
["TheSha'tar"] = "europe",
["TheVentureCo"] = "europe",
["Thunderhorn"] = "europe",
["Trollbane"] = "europe",
["Turalyon"] = "europe",
["Twilight'sHammer"] = "europe",
["TwistingNether"] = "europe",
["Vashj"] = "europe",
["Vek'nilash"] = "europe",
["Wildhammer"] = "europe",
["Xavius"] = "europe",
["Zenedar"] = "europe",
["Firemaw"] = "europe",
["Gehennas"] = "europe",
["Golemagg"] = "europe",
["MirageRaceway"] = "europe",
["Mograine"] = "europe",
["Nek'Rosh"] = "europe",
["PyrewoodVillage"] = "europe",
["Soulseeker"] = "europe",
["Spineshatter"] = "europe",
["Stitches"] = "europe",
["Thunderstrike"] = "europe",
["WildGrowth"] = "europe",
["ZandalarTribe"] = "europe",
}
-- Regions 2, 4, 5: Korea, Taiwan, China
REALMS_ASIA = {
["AbyssalMaw"] = "china",
["AeriePeakCN"] = "china",
["Akil'zon"] = "china",
["Algalon"] = "china",
["Chronos"] = "china",
["Goldshire"] = "china",
["LichKing"] = "china",
["Onyxia"] = "china",
["SilverHand"] = "china",
["SilvermoonCN"] = "china",
["TitanReforged"] = "china",
["Azshara"] = "korea",
["BurningLegion"] = "korea",
["Cenarius"] = "korea",
["Deathwing"] = "korea",
["Durotan"] = "korea",
["Frostmourne"] = "korea",
["Hellscream"] = "korea",
["Hyjal"] = "korea",
["Ragnaros"] = "korea",
["Windrunner"] = "korea",
["Zul'jin"] = "korea",
["Arthas"] = "taiwan",
["Arygos"] = "taiwan",
["BleedingHollow"] = "taiwan",
["ChillwindPoint"] = "taiwan",
["CrystalpineStinger"] = "taiwan",
["DemonFallCanyon"] = "taiwan",
["Dragonmaw"] = "taiwan",
["Frostmane"] = "taiwan",
["Global"] = "taiwan",
["Icecrown"] = "taiwan",
["KrolBlade"] = "taiwan",
["Light'sHope"] = "taiwan",
["Menethil"] = "taiwan",
["Nightsong"] = "taiwan",
["OldBlanchy"] = "taiwan",
["OrderoftheCloudSerpent"] = "taiwan",
["Quel'dorei"] = "taiwan",
["Shadowmoon"] = "taiwan",
["Skywall"] = "taiwan",
["Spirestone"] = "taiwan",
["Stormscale"] = "taiwan",
["WorldTree"] = "taiwan",
["Whisperwind"] = "taiwan",
["Wrathbringer"] = "taiwan",
["ZealotBlade"] = "taiwan",
}
end
local REGION_ICON_PATH = MEDIA .. "regions\\"
-- Lookup a realm name -> mini region realmName should have spaces removed
local function GetRealmMiniRegion(realmName)
if not realmName or realmName == "" then return nil end
if not REALMS_NA then LoadRealms() end
local clean = realmName:gsub("%s+", "")
-- Check player's own region table first (handles overlapping realm names)
local myRegion = GetCurrentRegion()
local primary, secondary
if myRegion == 3 then
primary, secondary = REALMS_EU, REALMS_NA
elseif myRegion == 2 or myRegion == 4 or myRegion == 5 then
primary, secondary = REALMS_ASIA, REALMS_NA
else
primary, secondary = REALMS_NA, REALMS_EU
end
return primary[clean] or secondary[clean] or REALMS_ASIA[clean]
end
-- Get the mini region for a BNet friend's game account
local function GetFriendMiniRegion(gameAccountInfo)
if not gameAccountInfo then return nil end
-- Try realmName first
local realm = gameAccountInfo.realmName
if realm and realm ~= "" then
local result = GetRealmMiniRegion(realm)
if result then return result end
end
-- Fallback: parse richPresence ("Zone - Realm" format)
-- If realmName was empty, the friend is likely cross-region, so check OTHER tables first
local rich = gameAccountInfo.richPresence
if rich and rich ~= "" then
local realmFromRich = rich:match("%s%-%s(.+)$")
if realmFromRich and realmFromRich ~= "" then
if not REALMS_NA then LoadRealms() end
local clean = realmFromRich:gsub("%s+", "")
local myRegion = GetCurrentRegion()
-- Check the opposite region first since empty realmName = cross-region friend
if myRegion == 1 then
return REALMS_EU[clean] or REALMS_ASIA[clean] or REALMS_NA[clean]
elseif myRegion == 3 then
return REALMS_NA[clean] or REALMS_ASIA[clean] or REALMS_EU[clean]
else
return REALMS_NA[clean] or REALMS_EU[clean] or REALMS_ASIA[clean]
end
end
end
return nil
end
-- Get the full region for a mini region
local function GetFullRegion(miniRegion)
return miniRegion and MINI_TO_FULL[miniRegion]
end
-- Get the player's own full region
local function GetMyFullRegion()
return REGION_ID_TO_FULL[GetCurrentRegion()] or "NA"
end
-- Get the icon path for a mini region
local function GetRegionIcon(miniRegion)
if not miniRegion then return nil end
return REGION_ICON_PATH .. miniRegion .. ".png"
end
-- Public API
EllesmereUI.GetRealmMiniRegion = GetRealmMiniRegion
EllesmereUI.GetFriendMiniRegion = GetFriendMiniRegion
EllesmereUI.GetFullRegion = GetFullRegion
EllesmereUI.GetMyFullRegion = GetMyFullRegion
EllesmereUI.GetRegionIcon = GetRegionIcon
EllesmereUI.MINI_TO_FULL = MINI_TO_FULL
-------------------------------------------------------------------------------
-- Class colour escape per class file (lazy-built cache)
-------------------------------------------------------------------------------
local classColorCodes = {}
function Kit.ClassColorCode(classFile)
local code = classColorCodes[classFile]
if code then return code end
local cc = RAID_CLASS_COLORS and RAID_CLASS_COLORS[classFile]
if not cc then return nil end
code = EllesmereUI.HexColor(cc.r, cc.g, cc.b)
classColorCodes[classFile] = code
return code
end
-- Class Icon Theme: the choices both settings pages list
Kit.ICON_STYLE_VALUES = {
blizzard = "Blizzard",
modern = "Modern",
pixel = "Pixel",
pixelsComic = "Pixels Comic",
glyph = "Glyph",
arcade = "Arcade",
legend = "Legend",
midnight = "Midnight",
runic = "Runic",
}
Kit.ICON_STYLE_ORDER = {
"blizzard", "modern", "pixel", "pixelsComic", "glyph",
"arcade", "legend", "midnight", "runic",
}
-------------------------------------------------------------------------------
-- 12.1 Social UI friend tiles
--
-- DECORATION ONLY. This file never creates a row, never writes element data,
-- and never mutates Blizzard's data provider. That restraint is the entire
-- design, and it is not stylistic caution -- it is the conclusion of a taint
-- bisect run against 12.1:
--
-- overlay off entirely .............................. whispers clean
-- our rows, every decoration disabled .............. whispers TAINTED
-- Blizzard's rows, only MoveNode re-parenting ...... whispers TAINTED
--
-- Any mutation of the friends list data taints the execution that Blizzard's
-- secure OnClick depends on; that reaches SetTellTarget, whose whisper target
-- is a secret value in 12.1, and BNet whispers stop opening. Styling was the
-- one thing the bisect cleared. So we style, and we touch nothing else.
--
-- Blizzard therefore owns: the ScrollBox, the provider, row creation, row
-- population, the click handler and the right-click menu. We own: paint.
--
-- A host starts it once per session (Kit.StartTiles) with its settings,
-- its look and its font; the host's settings page repaints through
-- Kit.RedecorateTiles.
-------------------------------------------------------------------------------
-- External weak-keyed state. Never write custom keys onto a Blizzard frame.
local FFD = setmetatable({}, { __mode = "k" })
local function GetFFD(frame)
local d = FFD[frame]
if not d then d = {}; FFD[frame] = d end
return d
end
-------------------------------------------------------------------------------
-- Tuning
-------------------------------------------------------------------------------
-- ROW HEIGHT IS BLIZZARD'S. DO NOT TRY TO CHANGE IT.
--
-- Their height is 70 (85 with larger text), from
-- FriendsListSocialCardMixin.GetActiveBaseHeight, captured by REFERENCE into the view's
-- extent registration at its OnLoad -- before this addon exists, so replacing the mixin
-- function afterwards cannot reach it. The only lever is overwriting that stored
-- registration, i.e. writing into view's own TemplateRegistrations table.
--
-- That write was TESTED and it TAINTS BNet whispers: the extent calculator is
-- read during layout, layout builds the rows, and a row built from an execution
-- that read our value carries taint into the secure OnClick and on into
-- SetTellTarget (whose whisper target is a secret value in 12.1). With the
-- write disabled and every other decoration below still active, whispers are
-- clean -- so decoration is fine and this one write was the whole problem.
--
-- CLOSED. Two separate in-game tests, both TAINTED:
-- 1. reg.baseHeight = 46 AND reg.baseHeightCalculator = our closure
-- 2. reg.baseHeightCalculator = nil, reg.baseHeight = 46 (plain number,
-- nothing of ours executing inside their layout pass)
-- Test 2 is the decisive one: Blizzard's own code merely READS a number out of
-- its own table, and that is still enough. So it is not about our code running
-- in their path -- reading any value an addon wrote taints the execution, and
-- that execution builds the rows whose secure OnClick opens the whisper menu.
--
-- 70 (85 at larger text) is therefore a hard floor. The only remaining lever on
-- density is the GAME's text-size setting: CalculateScaledHeight runs the base
-- through TextSizeManager:GetScaledValueWeighted with scaleWeight 0.6, so a
-- below-default text size genuinely scales the row under 70.
--
-- So nothing here writes the row height. Do not re-attempt; both shapes are
-- already disproven.
--
-- The tile's icon square: the name starts past it.
local TILE_TARGET_H = 46
-- Kill switch for all tile decoration. Proven taint-free, so this is only a
-- convenience for future bisects -- leave it true.
local TILE_PAINT = true
-- Left inset of the text block, derived rather than fixed: the class icon is a
-- square that spans the row height, so the text starts at rowHeight + a gutter.
-- Resolved per paint from the row's live height.
local TILE_TEXT_GAP = 4
-- Three lines, each its own size: Battle.net name / character name + level / location.
local TILE_NAME_SIZE = 15
local TILE_CHAR_SIZE = 12
local TILE_INFO_SIZE = 12
local TILE_LINE_GAP = -5
-- The row height is Blizzard's now (GetActiveBaseHeight = 70, or 85 in the
-- expanded text-size layout), and we cannot change it without touching their
-- view's extent calculator -- which is provider-adjacent, and provider contact
-- is what taints whispers. So the text block is anchored to the row's vertical
-- CENTRE rather than pinned to the top: it then sits correctly at any height
-- Blizzard picks. The block is centred per paint from its measured height (the
-- line count varies), so there is no fixed vertical offset any more.
local MODERN_BLIZZ_TEX = "Interface\\AddOns\\EllesmereUI\\media\\modern_blizz.png"
local TEX_BASE = "Interface\\AddOns\\EllesmereUI\\media\\textures\\"
local MB_L, MB_R, MB_T, MB_B = 0.25, 1, 0, 0.75
local TILE_ONLINE_MASK_TEX = TEX_BASE .. "gradient-lr.tga"
local TILE_ONLINE_BG_ALPHA = 0.25
local TILE_HOVER_MASK_TEX = TEX_BASE .. "fade-right.tga"
local TILE_HOVER_ALPHA = 0.2
-- Selection reuses the hover treatment and draws on its own layer ABOVE it, so
-- a selected row that is also hovered shows both and reads brighter.
local TILE_SEL_ALPHA = 0.4
local OFFLINE_ICON = MEDIA .. "offline.png"
local FACTION_TEX_ALLIANCE = MEDIA .. "alliance.png"
local FACTION_TEX_HORDE = MEDIA .. "horde.png"
local FACTION_TEX_NEUTRAL = MEDIA .. "neutral.png"
local CLASS_ICON_SPRITE_BASE = "Interface\\AddOns\\EllesmereUI\\media\\icons\\class-full\\"
local CLASS_ICON_SPRITE_TEX = {}
for _, style in ipairs({ "modern", "dark", "light", "clean" }) do
CLASS_ICON_SPRITE_TEX[style] = CLASS_ICON_SPRITE_BASE .. style .. ".tga"
end
local CLASS_SPRITE_COORDS = EllesmereUI.CLASS_ICON_SPRITE_COORDS
-- The class icon sprite sheet of a Class Icon Theme style (the tiles and the
-- Friends module's legacy rows)
function Kit.ClassIconSprite(style)
return CLASS_ICON_SPRITE_TEX[style] or (CLASS_ICON_SPRITE_BASE .. style .. ".tga")
end
local MINI_DISPLAY = {
namerica = "North America", samerica = "South America",
australia = "Australia", europe = "Europe",
russia = "Russia", korea = "Korea",
taiwan = "Taiwan", china = "China",
}
-- The status orb's atlas art, looked up at the first orb painted
local _orbFile, _orbL, _orbR, _orbT, _orbB
local _orbLooked = false
local function LookUpOrb()
_orbLooked = true
local info = C_Texture and C_Texture.GetAtlasInfo and C_Texture.GetAtlasInfo("lootroll-animreveal-a")
if info and info.file then
_orbFile = info.file
local aL, aR = info.leftTexCoord or 0, info.rightTexCoord or 1
local aT, aB = info.topTexCoord or 0, info.bottomTexCoord or 1
_orbL, _orbR, _orbT, _orbB = aL, aL + (aR - aL) / 6, aT, aT + (aB - aT) / 2
end
end
-- Paints the status orb's art (the atlas' first of 6 columns, top of 2 rows)
-- on tex (the tiles and the Friends module's legacy rows)
function Kit.StatusOrbArt(tex)
if not _orbLooked then LookUpOrb() end
if _orbFile then
tex:SetTexture(_orbFile)
tex:SetTexCoord(_orbL, _orbR, _orbT, _orbB)
else
tex:SetAtlas("lootroll-animreveal-a")
tex:SetTexCoord(0, 1 / 6, 0, 0.5)
end
end
-------------------------------------------------------------------------------
-- Helpers
-------------------------------------------------------------------------------
-- The host this session (Kit.StartTiles): its settings table (the Friends
-- List profile's friends table, or the Blizzard Skins+ card's), its look and
-- its font key.
local host
local function Settings()
return host and host.Settings()
end
local function Enabled()
local f = Settings()
return f ~= nil and f.enabled ~= false
end
local function FontPath()
return (EllesmereUI.GetFontPath(host.fontKey)) or STANDARD_TEXT_FONT
end
local function GetClassFile(accountInfo)
local gi = accountInfo and accountInfo.gameAccountInfo
if not gi then return nil end
if gi.classID and gi.classID > 0 then
local _, classFile = GetClassInfo(gi.classID)
if classFile then return classFile end
end
if gi.className then
return EllesmereUI.ClassTokenFromLocalized(gi.className)
end
return nil
end
local function IsSameProjectOnline(gi)
if not (gi and gi.isOnline) then return false end
if gi.clientProgram ~= BNET_CLIENT_WOW then return false end
return gi.wowProjectID == WOW_PROJECT_ID or gi.wowProjectID == nil
end
local function TileState(accountInfo)
local gi = accountInfo and accountInfo.gameAccountInfo
if not (gi and gi.isOnline) then return "offline" end
return IsSameProjectOnline(gi) and "retail" or "other_game"
end
-------------------------------------------------------------------------------
-- One-time structure per pooled card
-------------------------------------------------------------------------------
local function SkinStructure(card)
local d = GetFFD(card)
if d.skinned then return d end
d.skinned = true
d.tileBg = card:CreateTexture(nil, "BACKGROUND", nil, 2)
d.tileBg:SetAllPoints()
d.tileBg:SetColorTexture(0, 0, 0, 0.10)
d.onlineBg = card:CreateTexture(nil, "BACKGROUND", nil, 3)
d.onlineBg:SetTexture(MODERN_BLIZZ_TEX)
d.onlineBg:SetTexCoord(MB_L, MB_R, MB_T, MB_B)
d.onlineBg:SetAllPoints()
d.onlineBg:SetAlpha(TILE_ONLINE_BG_ALPHA)
d.onlineBg:Hide()
d.onlineMask = card:CreateMaskTexture()
d.onlineMask:SetTexture(TILE_ONLINE_MASK_TEX, "CLAMPTOBLACKADDITIVE", "CLAMPTOBLACKADDITIVE")
d.onlineMask:SetAllPoints(d.onlineBg)
d.onlineBg:AddMaskTexture(d.onlineMask)
d.factionBg = card:CreateTexture(nil, "BACKGROUND", nil, 4)
d.hoverBar = card:CreateTexture(nil, "ARTWORK", nil, -7)
d.hoverBar:SetAllPoints()
d.hoverBar:SetTexture(MODERN_BLIZZ_TEX)
d.hoverBar:SetTexCoord(MB_L, MB_R, MB_T, MB_B)
d.hoverBar:SetAlpha(TILE_HOVER_ALPHA)