-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathFriendsFrame.lua
2831 lines (2620 loc) · 99.1 KB
/
FriendsFrame.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
FRIENDS_TO_DISPLAY = 10;
FRIENDS_FRAME_FRIEND_HEIGHT = 34;
IGNORES_TO_DISPLAY = 19;
FRIENDS_FRAME_IGNORE_HEIGHT = 16;
PENDING_INVITES_TO_DISPLAY = 4;
PENDING_BUTTON_MIN_HEIGHT = 92;
FRIENDS_FRIENDS_TO_DISPLAY = 11;
FRIENDS_FRAME_FRIENDS_FRIENDS_HEIGHT = 16;
MAX_INVITE_MESSAGE_LINES = 10;
MAX_INVITE_MESSAGE_HEIGHT = 0; -- automatically set in FriendsFramePendingScrollFrame:OnLoad
WHOS_TO_DISPLAY = 17;
FRIENDS_FRAME_WHO_HEIGHT = 16;
GUILDMEMBERS_TO_DISPLAY = 13;
FRIENDS_FRAME_GUILD_HEIGHT = 14;
MAX_WHOS_FROM_SERVER = 50;
MAX_GUILDCONTROL_OPTIONS = 12;
CURRENT_GUILD_MOTD = "";
GUILD_DETAIL_NORM_HEIGHT = 195
GUILD_DETAIL_OFFICER_HEIGHT = 255
MAX_GUILDBANK_TABS = 6;
MAX_GOLD_WITHDRAW = 1000;
GUILDEVENT_TRANSACTION_HEIGHT = 13;
MAX_EVENTS_SHOWN = 25;
MAX_GOLD_WITHDRAW_DIGITS = 9;
PENDING_GUILDBANK_PERMISSIONS = {};
FRIENDS_BUTTON_HEADER_HEIGHT = 16;
FRIENDS_BUTTON_NORMAL_HEIGHT = 34;
FRIENDS_BUTTON_LARGE_HEIGHT = 48;
FRIENDS_BUTTON_TYPE_HEADER = 1;
FRIENDS_BUTTON_TYPE_BNET = 2;
FRIENDS_BUTTON_TYPE_WOW = 3;
FRIENDS_TEXTURE_ONLINE = "Interface\\FriendsFrame\\StatusIcon-Online";
FRIENDS_TEXTURE_AFK = "Interface\\FriendsFrame\\StatusIcon-Away";
FRIENDS_TEXTURE_DND = "Interface\\FriendsFrame\\StatusIcon-DnD";
FRIENDS_TEXTURE_OFFLINE = "Interface\\FriendsFrame\\StatusIcon-Offline";
FRIENDS_TEXTURE_BROADCAST = "Interface\\FriendsFrame\\BroadcastIcon";
FRIENDS_BNET_NAME_COLOR = {r=0.510, g=0.773, b=1.0};
FRIENDS_BNET_BACKGROUND_COLOR = {r=0, g=0.694, b=0.941, a=0.05};
FRIENDS_WOW_NAME_COLOR = {r=0.996, g=0.882, b=0.361};
FRIENDS_WOW_BACKGROUND_COLOR = {r=1.0, g=0.824, b=0.0, a=0.05};
FRIENDS_GRAY_COLOR = {r=0.486, g=0.518, b=0.541};
FRIENDS_OFFLINE_BACKGROUND_COLOR = {r=0.588, g=0.588, b=0.588, a=0.05};
FRIENDS_PRESENCE_COLOR_CODE = "|cff7c848a";
FRIENDS_BNET_NAME_COLOR_CODE = "|cff82c5ff";
FRIENDS_BROADCAST_TIME_COLOR_CODE = "|cff4381a8"
FRIENDS_WOW_NAME_COLOR_CODE = "|cfffde05c";
FRIENDS_OTHER_NAME_COLOR_CODE = "|cff7b8489";
SQUELCH_TYPE_IGNORE = 1;
SQUELCH_TYPE_BLOCK_INVITE = 2;
SQUELCH_TYPE_MUTE = 3;
SQUELCH_TYPE_BLOCK_TOON = 4;
FRIENDS_FRIENDS_POTENTIAL = 1;
FRIENDS_FRIENDS_MUTUAL = 2;
FRIENDS_FRIENDS_ALL = 3;
BNET_CLIENT_WOW = "WoW";
BNET_CLIENT_SC2 = "S2";
FRIENDS_TOOLTIP_MAX_TOONS = 5;
FRIENDS_TOOLTIP_MAX_WIDTH = 200;
FRIENDS_TOOLTIP_MARGIN_WIDTH = 12;
local FriendButtons = { };
local BNetBroadcasts = { };
local totalScrollHeight = 0;
local numOnlineBroadcasts = 0;
local numOfflineBroadcasts = 0;
local PendingInvitesNew = { };
local playerRealmName;
local playerFactionGroup;
WHOFRAME_DROPDOWN_LIST = {
{name = ZONE, sortType = "zone"},
{name = GUILD, sortType = "guild"},
{name = RACE, sortType = "race"}
};
FRIENDSFRAME_SUBFRAMES = { "FriendsListFrame", "IgnoreListFrame", "PendingListFrame", "WhoFrame", "GuildFrame", "ChannelFrame", "RaidFrame" };
function FriendsFrame_ShowSubFrame(frameName)
for index, value in pairs(FRIENDSFRAME_SUBFRAMES) do
if ( value == frameName ) then
_G[value]:Show()
else
_G[value]:Hide();
end
end
end
function FriendsFrame_SummonButton_OnEvent (self, event, ...)
if ( event == "SPELL_UPDATE_COOLDOWN" and self:GetParent().id ) then
FriendsFrame_SummonButton_Update(self);
end
end
function FriendsFrame_SummonButton_OnShow (self)
FriendsFrame_SummonButton_Update(self);
end
function FriendsFrame_SummonButton_Update (self)
local id = self:GetParent().id;
if ( not id or (self:GetParent().buttonType ~= FRIENDS_BUTTON_TYPE_WOW) or not IsReferAFriendLinked(GetFriendInfo(id)) ) then
self:Hide();
return;
end
self:Show();
local start, duration = GetSummonFriendCooldown();
if ( duration > 0 ) then
self.duration = duration;
self.start = start;
else
self.duration = nil;
self.start = nil;
end
local enable = CanSummonFriend(GetFriendInfo(id));
local icon = _G[self:GetName().."Icon"];
local normalTexture = _G[self:GetName().."NormalTexture"];
if ( enable ) then
icon:SetVertexColor(1.0, 1.0, 1.0);
normalTexture:SetVertexColor(1.0, 1.0, 1.0);
else
icon:SetVertexColor(0.4, 0.4, 0.4);
normalTexture:SetVertexColor(1.0, 1.0, 1.0);
end
CooldownFrame_SetTimer(_G[self:GetName().."Cooldown"], start, duration, ((enable and 0) or 1));
end
function FriendsFrame_ClickSummonButton (self)
local name = GetFriendInfo(self:GetParent().id);
if ( CanSummonFriend(name) ) then
SummonFriend(name);
end
end
function FriendsFrame_ShowDropdown(name, connected, lineID, chatType, chatFrame, friendsList)
HideDropDownMenu(1);
if ( connected or friendsList ) then
if ( connected ) then
FriendsDropDown.initialize = FriendsFrameDropDown_Initialize;
else
FriendsDropDown.initialize = FriendsFrameOfflineDropDown_Initialize;
end
FriendsDropDown.displayMode = "MENU";
FriendsDropDown.name = name;
FriendsDropDown.friendsList = friendsList;
FriendsDropDown.lineID = lineID;
FriendsDropDown.chatType = chatType;
FriendsDropDown.chatTarget = name;
FriendsDropDown.chatFrame = chatFrame;
FriendsDropDown.presenceID = nil;
ToggleDropDownMenu(1, nil, FriendsDropDown, "cursor");
end
end
function FriendsFrame_ShowBNDropdown(name, connected, lineID, chatType, chatFrame, friendsList, presenceID)
if ( connected or friendsList ) then
if ( connected ) then
FriendsDropDown.initialize = FriendsFrameBNDropDown_Initialize;
else
FriendsDropDown.initialize = FriendsFrameBNOfflineDropDown_Initialize;
end
FriendsDropDown.displayMode = "MENU";
FriendsDropDown.name = name;
FriendsDropDown.friendsList = friendsList;
FriendsDropDown.lineID = lineID;
FriendsDropDown.chatType = chatType;
FriendsDropDown.chatTarget = name;
FriendsDropDown.chatFrame = chatFrame;
FriendsDropDown.presenceID = presenceID;
ToggleDropDownMenu(1, nil, FriendsDropDown, "cursor");
end
end
function FriendsFrameDropDown_Initialize()
UnitPopup_ShowMenu(UIDROPDOWNMENU_OPEN_MENU, "FRIEND", nil, FriendsDropDown.name);
end
function FriendsFrameOfflineDropDown_Initialize()
UnitPopup_ShowMenu(UIDROPDOWNMENU_OPEN_MENU, "FRIEND_OFFLINE", nil, FriendsDropDown.name);
end
function FriendsFrameBNDropDown_Initialize()
UnitPopup_ShowMenu(UIDROPDOWNMENU_OPEN_MENU, "BN_FRIEND", nil, FriendsDropDown.name);
end
function FriendsFrameBNOfflineDropDown_Initialize()
UnitPopup_ShowMenu(UIDROPDOWNMENU_OPEN_MENU, "BN_FRIEND_OFFLINE", nil, FriendsDropDown.name);
end
function FriendsFrame_OnLoad(self)
PanelTemplates_SetNumTabs(self, 5);
self.selectedTab = 1;
PanelTemplates_UpdateTabs(self);
self:RegisterEvent("FRIENDLIST_SHOW");
self:RegisterEvent("FRIENDLIST_UPDATE");
self:RegisterEvent("IGNORELIST_UPDATE");
self:RegisterEvent("MUTELIST_UPDATE");
self:RegisterEvent("WHO_LIST_UPDATE");
self:RegisterEvent("GUILD_ROSTER_UPDATE");
self:RegisterEvent("PLAYER_GUILD_UPDATE");
self:RegisterEvent("GUILD_MOTD");
self:RegisterEvent("VOICE_CHAT_ENABLED_UPDATE");
self:RegisterEvent("PARTY_MEMBERS_CHANGED");
self:RegisterEvent("PLAYER_FLAGS_CHANGED");
self:RegisterEvent("BN_FRIEND_LIST_SIZE_CHANGED");
self:RegisterEvent("BN_FRIEND_INFO_CHANGED");
self:RegisterEvent("BN_FRIEND_INVITE_LIST_INITIALIZED");
self:RegisterEvent("BN_FRIEND_INVITE_ADDED");
self:RegisterEvent("BN_FRIEND_INVITE_REMOVED");
self:RegisterEvent("BN_CUSTOM_MESSAGE_CHANGED");
self:RegisterEvent("BN_CUSTOM_MESSAGE_LOADED");
self:RegisterEvent("BN_SELF_ONLINE");
self:RegisterEvent("BN_BLOCK_LIST_UPDATED");
self:RegisterEvent("PLAYER_ENTERING_WORLD");
self:RegisterEvent("BN_CONNECTED");
self:RegisterEvent("BN_DISCONNECTED");
self.playersInBotRank = 0;
self.playerStatusFrame = 1;
self.selectedFriend = 1;
self.selectedIgnore = 1;
self.guildStatus = 0;
GuildFrame.notesToggle = 1;
GuildFrame.selectedGuildMember = 0;
SetGuildRosterSelection(0);
CURRENT_GUILD_MOTD = GetGuildRosterMOTD();
GuildFrameNotesText:SetText(CURRENT_GUILD_MOTD);
GuildMemberDetailRankText:SetPoint("RIGHT", GuildFramePromoteButton, "LEFT");
-- friends list
DynamicScrollFrame_CreateButtons(FriendsFrameFriendsScrollFrame, "FriendsFrameButtonTemplate", FRIENDS_BUTTON_HEADER_HEIGHT, FriendsFrame_SetButton, FriendsFrame_GetTopButton);
FriendsFrameOfflineHeader:SetParent(FriendsFrameFriendsScrollFrameScrollChild);
FriendsFrameBroadcastInputClearButton.icon:SetVertexColor(FRIENDS_BNET_NAME_COLOR.r, FRIENDS_BNET_NAME_COLOR.g, FRIENDS_BNET_NAME_COLOR.b);
if ( not BNFeaturesEnabled() ) then
FriendsTabHeaderTab3:Hide();
FriendsFrameBroadcastInput:Hide();
FriendsFrameBattlenetStatus:Hide();
FriendsFrameStatusDropDown:Show();
end
end
function FriendsFrame_OnShow()
VoiceChat_Toggle();
FriendsList_Update();
FriendsFrame_Update();
UpdateMicroButtons();
PlaySound("igCharacterInfoTab");
GuildFrame.selectedGuildMember = 0;
SetGuildRosterSelection(0);
InGuildCheck();
end
function FriendsFrame_Update()
if ( FriendsFrame.selectedTab == 1 ) then
FriendsTabHeader:Show();
if ( FriendsTabHeader.selectedTab == 1 ) then
ShowFriends();
FriendsFrameTopLeft:SetTexture("Interface\\FriendsFrame\\UI-FriendsFrame-TopLeft-bnet");
FriendsFrameTopRight:SetTexture("Interface\\FriendsFrame\\UI-FriendsFrame-TopRight-bnet");
FriendsFrameBottomLeft:SetTexture("Interface\\FriendsFrame\\UI-FriendsFrameMute-BotLeft-bnet");
FriendsFrameBottomRight:SetTexture("Interface\\FriendsFrame\\UI-FriendsFrameMute-BotRight-bnet");
FriendsFrameTitleText:SetText(FRIENDS_LIST);
FriendsFrame_ShowSubFrame("FriendsListFrame");
elseif ( FriendsTabHeader.selectedTab == 3 ) then
FriendsFrameTopLeft:SetTexture("Interface\\FriendsFrame\\UI-FriendsFrame-TopLeft-bnet");
FriendsFrameTopRight:SetTexture("Interface\\FriendsFrame\\UI-FriendsFrame-TopRight-bnet");
FriendsFrameBottomRight:SetTexture("Interface\\FriendsFrame\\UI-FriendsFrame-Pending-BotRight");
FriendsFrameBottomLeft:SetTexture("Interface\\FriendsFrame\\UI-FriendsFrame-Pending-BotLeft");
FriendsFrameTitleText:SetText(PENDING_INVITE_LIST);
FriendsFrame_ShowSubFrame("PendingListFrame");
else
FriendsFrameTopLeft:SetTexture("Interface\\FriendsFrame\\UI-FriendsFrame-TopLeft-bnet");
FriendsFrameTopRight:SetTexture("Interface\\FriendsFrame\\UI-FriendsFrame-TopRight-bnet");
if ( IsVoiceChatEnabled() ) then
FriendsFrameMutePlayerButton:Show();
FriendsFrameBottomLeft:SetTexture("Interface\\FriendsFrame\\UI-FriendsFrameThree-BotLeft-bnet");
FriendsFrameBottomRight:SetTexture("Interface\\FriendsFrame\\UI-FriendsFrameThree-BotRight-bnet");
FriendsFrameIgnorePlayerButton:SetWidth(110);
FriendsFrameUnsquelchButton:SetWidth(111);
else
FriendsFrameMutePlayerButton:Hide();
FriendsFrameBottomLeft:SetTexture("Interface\\FriendsFrame\\UI-FriendsFrameMute-BotLeft-bnet");
FriendsFrameBottomRight:SetTexture("Interface\\FriendsFrame\\UI-FriendsFrameMute-BotRight-bnet");
FriendsFrameIgnorePlayerButton:SetWidth(131);
FriendsFrameUnsquelchButton:SetWidth(134);
end
FriendsFrameTitleText:SetText(IGNORE_LIST);
FriendsFrame_ShowSubFrame("IgnoreListFrame");
IgnoreList_Update();
end
else
FriendsTabHeader:Hide();
if ( FriendsFrame.selectedTab == 2 ) then
FriendsFrameTopLeft:SetTexture("Interface\\ClassTrainerFrame\\UI-ClassTrainer-TopLeft");
FriendsFrameTopRight:SetTexture("Interface\\ClassTrainerFrame\\UI-ClassTrainer-TopRight");
FriendsFrameBottomLeft:SetTexture("Interface\\FriendsFrame\\WhoFrame-BotLeft");
FriendsFrameBottomRight:SetTexture("Interface\\FriendsFrame\\WhoFrame-BotRight");
FriendsFrameTitleText:SetText(WHO_LIST);
FriendsFrame_ShowSubFrame("WhoFrame");
WhoList_Update();
elseif ( FriendsFrame.selectedTab == 3 ) then
FriendsFrameTopLeft:SetTexture("Interface\\ClassTrainerFrame\\UI-ClassTrainer-TopLeft");
FriendsFrameTopRight:SetTexture("Interface\\ClassTrainerFrame\\UI-ClassTrainer-TopRight");
FriendsFrameBottomLeft:SetTexture("Interface\\FriendsFrame\\GuildFrame-BotLeft");
FriendsFrameBottomRight:SetTexture("Interface\\FriendsFrame\\GuildFrame-BotRight");
local guildName, title, rank = GetGuildInfo("player");
if ( guildName ) then
FriendsFrameTitleText:SetFormattedText(GUILD_TITLE_TEMPLATE, title, guildName);
else
FriendsFrameTitleText:SetText("");
end
GuildStatus_Update();
FriendsFrame_ShowSubFrame("GuildFrame");
elseif ( FriendsFrame.selectedTab == 4 ) then
FriendsFrameTopLeft:SetTexture("Interface\\PaperDollInfoFrame\\UI-Character-General-TopLeft");
FriendsFrameTopRight:SetTexture("Interface\\PaperDollInfoFrame\\UI-Character-General-TopRight");
FriendsFrameBottomLeft:SetTexture("Interface\\FriendsFrame\\UI-ChannelFrame-BotLeft");
FriendsFrameBottomRight:SetTexture("Interface\\FriendsFrame\\UI-ChannelFrame-BotRight");
FriendsFrameTitleText:SetText(CHAT_CHANNELS);
FriendsFrame_ShowSubFrame("ChannelFrame");
elseif ( FriendsFrame.selectedTab == 5 ) then
FriendsFrameTopLeft:SetTexture("Interface\\PaperDollInfoFrame\\UI-Character-General-TopLeft");
FriendsFrameTopRight:SetTexture("Interface\\PaperDollInfoFrame\\UI-Character-General-TopRight");
FriendsFrameBottomLeft:SetTexture("Interface\\PaperDollInfoFrame\\UI-Character-General-BottomLeft");
FriendsFrameBottomRight:SetTexture("Interface\\PaperDollInfoFrame\\UI-Character-General-BottomRight");
FriendsFrameTitleText:SetText(RAID);
FriendsFrame_ShowSubFrame("RaidFrame");
end
end
end
function FriendsFrame_OnHide()
UpdateMicroButtons();
PlaySound("igMainMenuClose");
SetGuildRosterSelection(0);
GuildFrame.selectedGuildMember = 0;
GuildFramePopup_HideAll();
RaidInfoFrame:Hide();
for index, value in pairs(FRIENDSFRAME_SUBFRAMES) do
_G[value]:Hide();
end
end
function FriendsList_Update()
local numBNetTotal, numBNetOnline = BNGetNumFriends();
local numBNetOffline = numBNetTotal - numBNetOnline;
local numWoWTotal, numWoWOnline = GetNumFriends();
local numWoWOffline = numWoWTotal - numWoWOnline;
FriendsMicroButtonCount:SetText(numBNetOnline + numWoWOnline);
if ( not FriendsListFrame:IsShown() ) then
return;
end
local buttonCount = numBNetTotal + numWoWTotal;
local haveHeader;
totalScrollHeight = 0;
if ( numBNetOnline > 0 or numWoWOnline > 0 ) then
totalScrollHeight = totalScrollHeight + (numBNetOnline + numWoWOnline) * FRIENDS_BUTTON_NORMAL_HEIGHT + numOnlineBroadcasts * (FRIENDS_BUTTON_LARGE_HEIGHT - FRIENDS_BUTTON_NORMAL_HEIGHT);
end
if ( numBNetOffline > 0 or numWoWOffline > 0 ) then
totalScrollHeight = totalScrollHeight + (numBNetOffline + numWoWOffline) * FRIENDS_BUTTON_NORMAL_HEIGHT + numOfflineBroadcasts * (FRIENDS_BUTTON_LARGE_HEIGHT - FRIENDS_BUTTON_NORMAL_HEIGHT);
-- use a header if there are online and offline friends
if ( numBNetOnline > 0 or numWoWOnline > 0 ) then
haveHeader = true;
buttonCount = buttonCount + 1;
totalScrollHeight = totalScrollHeight + FRIENDS_BUTTON_HEADER_HEIGHT;
end
end
if ( buttonCount > #FriendButtons ) then
for i = #FriendButtons + 1, buttonCount do
FriendButtons[i] = { };
end
end
local index = 0;
-- online Battlenet friends
for i = 1, numBNetOnline do
index = index + 1;
FriendButtons[index].buttonType = FRIENDS_BUTTON_TYPE_BNET;
FriendButtons[index].id = i;
end
-- online WoW friends
for i = 1, numWoWOnline do
index = index + 1;
FriendButtons[index].buttonType = FRIENDS_BUTTON_TYPE_WOW;
FriendButtons[index].id = i;
end
-- offline header
if ( haveHeader ) then
index = index + 1;
FriendButtons[index].buttonType = FRIENDS_BUTTON_TYPE_HEADER;
end
-- offline Battlenet friends
for i = 1, numBNetOffline do
index = index + 1;
FriendButtons[index].buttonType = FRIENDS_BUTTON_TYPE_BNET;
FriendButtons[index].id = i + numBNetOnline;
end
-- offline WoW friends
for i = 1, numWoWOffline do
index = index + 1;
FriendButtons[index].buttonType = FRIENDS_BUTTON_TYPE_WOW;
FriendButtons[index].id = i + numWoWOnline;
end
-- selection
local selectedFriend = 0;
-- check that we have at least 1 friend
if ( index > 0 ) then
-- get friend
if ( FriendsFrame.selectedFriendType == FRIENDS_BUTTON_TYPE_WOW ) then
selectedFriend = GetSelectedFriend();
elseif ( FriendsFrame.selectedFriendType == FRIENDS_BUTTON_TYPE_BNET ) then
selectedFriend = BNGetSelectedFriend();
end
-- set to first in list if no friend
if ( selectedFriend == 0 ) then
FriendsFrame_SelectFriend(FriendButtons[1].buttonType, 1);
selectedFriend = 1;
end
-- check if friend is online
local isOnline;
if ( FriendsFrame.selectedFriendType == FRIENDS_BUTTON_TYPE_WOW ) then
local name, level, class, area;
name, level, class, area, isOnline = GetFriendInfo(selectedFriend);
elseif ( FriendsFrame.selectedFriendType == FRIENDS_BUTTON_TYPE_BNET ) then
local presenceID, givenName, surname, toonName, toonID, client;
presenceID, givenName, surname, toonName, toonID, client, isOnline = BNGetFriendInfo(selectedFriend);
if ( not givenName or not surname ) then
isOnline = false;
end
end
if ( isOnline ) then
FriendsFrameSendMessageButton:Enable();
else
FriendsFrameSendMessageButton:Disable();
end
else
FriendsFrameSendMessageButton:Disable();
end
FriendsFrame.selectedFriend = selectedFriend;
DynamicScrollFrame_Update(FriendsFrameFriendsScrollFrame);
end
function IgnoreList_Update()
local button;
local numIgnores = GetNumIgnores();
local numBlocks = BNGetNumBlocked();
local numToonBlocks = BNGetNumBlockedToons();
local numMutes = 0;
if ( IsVoiceChatEnabled() ) then
numMutes = GetNumMutes();
end
-- Headers stuff
local ignoredHeader, blockedHeader, mutedHeader, blockedToonHeader;
if ( numIgnores > 0 ) then
ignoredHeader = 1;
else
ignoredHeader = 0;
end
if ( numBlocks > 0 ) then
blockedHeader = 1;
else
blockedHeader = 0;
end
if ( numToonBlocks > 0 ) then
blockedToonHeader = 1;
else
blockedToonHeader = 0;
end
if ( numMutes > 0 ) then
mutedHeader = 1;
else
mutedHeader = 0;
end
local lastIgnoredIndex = numIgnores + ignoredHeader;
local lastBlockedIndex = lastIgnoredIndex + numBlocks + blockedHeader;
local lastBlockedToonIndex = lastBlockedIndex + numToonBlocks + blockedToonHeader;
local lastMutedIndex = lastBlockedToonIndex + numMutes + mutedHeader;
local numEntries = lastMutedIndex;
FriendsFrameIgnoredHeader:Hide();
FriendsFrameBlockedInviteHeader:Hide();
FriendsFrameBlockedToonHeader:Hide();
FriendsFrameMutedHeader:Hide();
-- selection stuff
local selectedSquelchType = FriendsFrame.selectedSquelchType;
local selectedSquelchIndex = 0 ;
if ( selectedSquelchType == SQUELCH_TYPE_IGNORE ) then
selectedSquelchIndex = GetSelectedIgnore();
elseif ( selectedSquelchType == SQUELCH_TYPE_BLOCK_INVITE ) then
selectedSquelchIndex = BNGetSelectedBlock();
elseif ( selectedSquelchType == SQUELCH_TYPE_BLOCK_TOON ) then
selectedSquelchIndex = BNGetSelectedToonBlock();
elseif ( selectedSquelchType == SQUELCH_TYPE_MUTE ) then
selectedSquelchIndex = GetSelectedMute();
end
if ( selectedSquelchIndex == 0 ) then
if ( numIgnores > 0 ) then
FriendsFrame_SelectSquelched(SQUELCH_TYPE_IGNORE, 1);
selectedSquelchType = SQUELCH_TYPE_IGNORE;
selectedSquelchIndex = 1;
elseif ( numBlocks > 0 ) then
FriendsFrame_SelectSquelched(SQUELCH_TYPE_BLOCK_INVITE, 1);
selectedSquelchType = SQUELCH_TYPE_BLOCK_INVITE;
selectedSquelchIndex = 1;
elseif ( numToonBlocks > 0 ) then
FriendsFrame_SelectSquelched(SQUELCH_TYPE_BLOCK_TOON, 1);
selectedSquelchType = SQUELCH_TYPE_BLOCK_TOON;
selectedSquelchIndex = 1;
elseif ( numMutes > 0 ) then
FriendsFrame_SelectSquelched(SQUELCH_TYPE_MUTE, 1);
selectedSquelchType = SQUELCH_TYPE_MUTE;
selectedSquelchIndex = 1;
end
end
if ( selectedSquelchIndex > 0 ) then
FriendsFrameUnsquelchButton:Enable();
else
FriendsFrameUnsquelchButton:Disable();
end
local scrollOffset = FauxScrollFrame_GetOffset(FriendsFrameIgnoreScrollFrame);
local squelchedIndex;
for i = 1, IGNORES_TO_DISPLAY, 1 do
squelchedIndex = i + scrollOffset;
button = _G["FriendsFrameIgnoreButton"..i];
button.type = nil;
if ( squelchedIndex == ignoredHeader ) then
-- ignored header
IgnoreList_SetHeader(FriendsFrameIgnoredHeader, button);
elseif ( squelchedIndex <= lastIgnoredIndex ) then
-- ignored
button.index = squelchedIndex - ignoredHeader;
button.name:SetText(GetIgnoreName(button.index));
button.type = SQUELCH_TYPE_IGNORE;
elseif ( blockedHeader == 1 and squelchedIndex == lastIgnoredIndex + 1 ) then
-- blocked header
IgnoreList_SetHeader(FriendsFrameBlockedInviteHeader, button);
elseif ( squelchedIndex <= lastBlockedIndex ) then
-- blocked
button.index = squelchedIndex - lastIgnoredIndex - blockedHeader;
local blockID, blockName = BNGetBlockedInfo(button.index);
button.name:SetText(blockName);
button.type = SQUELCH_TYPE_BLOCK_INVITE;
elseif ( blockedToonHeader == 1 and squelchedIndex == lastBlockedIndex + 1 ) then
-- blocked TOON header
IgnoreList_SetHeader(FriendsFrameBlockedToonHeader, button);
elseif ( squelchedIndex <= lastBlockedToonIndex ) then
-- blocked TOON
button.index = squelchedIndex - lastBlockedIndex - blockedToonHeader;
local blockID, blockName = BNGetBlockedToonInfo(button.index);
button.name:SetText(blockName);
button.type = SQUELCH_TYPE_BLOCK_TOON;
elseif ( mutedHeader == 1 and squelchedIndex == lastBlockedToonIndex + 1 ) then
-- muted header
IgnoreList_SetHeader(FriendsFrameMutedHeader, button);
elseif ( squelchedIndex <= lastMutedIndex ) then
-- muted
button.index = squelchedIndex - lastBlockedToonIndex - mutedHeader;
button.name:SetText(GetMuteName(button.index));
button.type = SQUELCH_TYPE_MUTE;
end
if ( selectedSquelchType == button.type and selectedSquelchIndex == button.index ) then
button:LockHighlight();
else
button:UnlockHighlight();
end
if ( squelchedIndex > numEntries ) then
button:Hide();
else
button:Show();
end
end
-- ScrollFrame stuff
FauxScrollFrame_Update(FriendsFrameIgnoreScrollFrame, numEntries, IGNORES_TO_DISPLAY, FRIENDS_FRAME_IGNORE_HEIGHT );
end
function IgnoreList_SetHeader(header, parent)
parent.name:SetText("");
header:SetParent(parent);
header:SetPoint("TOPLEFT", parent, 0, 0);
header:Show();
end
function PendingListFrame_OnShow(self)
PendingList_Update();
end
function PendingList_Update(newInvite)
local numPending = BNGetNumFriendInvites();
PendingList_UpdateTab();
if ( numPending > 0 ) then
if ( not GetCVarBool("pendingInviteInfoShown") ) then
PendingListInfoFrame:SetFrameLevel(FriendsFramePendingButton1:GetFrameLevel() + 1);
PendingListInfoFrame:Show();
end
local scrollFrame = FriendsFramePendingScrollFrame;
local buttonHeight, message, _;
local heightLeft = scrollFrame.scrollHeight;
local scrollBar = scrollFrame.scrollBar;
FriendsFramePendingButton1.message:SetHeight(0);
for i = numPending, 1, -1 do
buttonHeight = PENDING_BUTTON_MIN_HEIGHT;
_, _, _, message = BNGetFriendInviteInfo(i);
if ( message and message ~= "" ) then
FriendsFramePendingButton1.message:SetText(message);
local textHeight = min(FriendsFramePendingButton1.message:GetHeight(), MAX_INVITE_MESSAGE_HEIGHT);
buttonHeight = buttonHeight + textHeight;
end
heightLeft = heightLeft - buttonHeight;
if ( heightLeft <= 0 ) then
-- one less notch on the scrollbar if it's a perfect fit
if ( heightLeft == 0 ) then
i = i - 1;
end
local value = scrollBar:GetValue();
scrollFrame.extraHeight = -heightLeft;
scrollFrame.max = i;
scrollBar:Show();
scrollBar:SetMinMaxValues(0, i);
if ( newInvite ) then
-- adjust the scroll if the user is looking at the frame, otherwise jump it to the top
if ( PendingListFrame:IsShown() ) then
scrollBar:SetValue(value + 1);
else
scrollBar:SetValue(0)
end
elseif ( value <= i ) then
scrollBar:SetValue(value);
PendingList_Scroll(value);
end
return;
end
end
-- not enough buttons to have a scrollbar
scrollFrame.extraHeight = 0;
scrollFrame.max = numPending;
scrollBar:Hide();
scrollBar:SetValue(0);
end
PendingList_Scroll(0);
end
function PendingList_Scroll(offset)
local button, buttonHeight;
local name, surname, message;
local heightUsed = 0;
local scrollFrame = FriendsFramePendingScrollFrame;
local scrollHeight = scrollFrame.scrollHeight;
local max = scrollFrame.max;
local numPending = BNGetNumFriendInvites();
offset = offset or scrollFrame.scrollBar:GetValue();
-- if scrolled to the bottom and there would be a button partially showing, start with it and "scroll" it up
if ( offset == max and scrollFrame.extraHeight > 0 ) then
offset = offset - 1;
_G["FriendsFramePendingButton1"]:SetPoint("TOPLEFT", 0, scrollFrame.extraHeight);
heightUsed = heightUsed - scrollFrame.extraHeight;
else
_G["FriendsFramePendingButton1"]:SetPoint("TOPLEFT", 0, 0);
end
for i = 1, PENDING_INVITES_TO_DISPLAY do
button = _G["FriendsFramePendingButton"..i];
offset = offset + 1;
if ( offset > numPending or heightUsed > scrollHeight ) then
button:Hide();
else
inviteID, givenName, surname, message, timeSent, days = BNGetFriendInviteInfo(offset);
button.index = offset;
button.inviteID = inviteID;
buttonHeight = PENDING_BUTTON_MIN_HEIGHT;
if ( givenName and surname ) then
button.name:SetFormattedText(BATTLENET_NAME_FORMAT, givenName, surname);
else
button.name:SetText(UNKNOWN);
end
if ( message ) then
button.message:SetHeight(0);
button.message:SetText(message);
local textHeight = button.message:GetHeight();
if ( textHeight > MAX_INVITE_MESSAGE_HEIGHT ) then
textHeight = MAX_INVITE_MESSAGE_HEIGHT;
button.message:SetHeight(textHeight);
end
buttonHeight = buttonHeight + textHeight;
else
button.message:SetText("");
button.message:SetHeight(0);
end
if ( timeSent and timeSent ~= 0 ) then
button.sent:SetFormattedText(BNET_INVITE_SENT_TIME, FriendsFrame_GetLastOnline(timeSent));
else
button.sent:SetText("");
end
button:SetHeight(buttonHeight);
heightUsed = heightUsed + buttonHeight;
if ( PendingInvitesNew["all"] or PendingInvitesNew[inviteID] ) then
button.highlight:Show();
else
button.highlight:Hide();
end
button:Show();
end
end
end
function FriendsFramePendingScrollFrame_AdjustScroll(delta)
local scrollBar = FriendsFramePendingScrollFrame.scrollBar;
if ( scrollBar:IsShown() ) then
scrollBar:SetValue(scrollBar:GetValue() + delta);
end
end
function PendingListFrame_OnHide()
table.wipe(PendingInvitesNew);
PendingList_UpdateTab();
end
function PendingListFrame_BlockCommunication(self)
local inviteID, name, surname, message = BNGetFriendInviteInfo(self:GetParent().index);
local dialog = StaticPopup_Show("CONFIRM_BLOCK_INVITES", string.format(BATTLENET_NAME_FORMAT, name, surname));
if ( dialog ) then
dialog.data = inviteID;
end
end
function PendingListFrame_ReportSpam(self)
local inviteID, name, surname, message = BNGetFriendInviteInfo(self:GetParent().index);
local dialog = StaticPopup_Show("CONFIRM_REPORT_SPAM_INVITE", string.format(BATTLENET_NAME_FORMAT, name, surname));
if ( dialog ) then
dialog.data = inviteID;
end
end
function PendingListFrame_ReportPlayer(self)
ToggleDropDownMenu(1, self:GetParent().index, PendingListFrameDropDown, "cursor", 3, -3)
end
function PendingListFrameDropDown_OnLoad(self)
UIDropDownMenu_Initialize(self, PendingListFrameDropDown_Initialize, "MENU");
end
function PendingListFrameDropDown_Initialize(self)
UnitPopup_ShowMenu(self, "BN_REPORT", nil, BNET_REPORT);
end
function PendingList_UpdateTab()
local numPending = BNGetNumFriendInvites();
if ( numPending > 0 ) then
FriendsTabHeaderTab3:SetText(PENDING_INVITE.." ("..numPending..")");
if ( next(PendingInvitesNew) and FriendsTabHeader.selectedTab ~= 3 and not FriendsTabHeaderTab3:IsMouseOver() ) then
FriendsTabHeaderInviteAlert:Show();
else
FriendsTabHeaderInviteAlert:Hide();
end
else
FriendsTabHeaderTab3:SetText(PENDING_INVITE);
FriendsTabHeaderInviteAlert:Hide();
end
PanelTemplates_TabResize(FriendsTabHeaderTab3, 0);
end
function WhoList_Update()
local numWhos, totalCount = GetNumWhoResults();
local name, guild, level, race, class, zone;
local button, buttonText, classTextColor, classFileName;
local columnTable;
local whoOffset = FauxScrollFrame_GetOffset(WhoListScrollFrame);
local whoIndex;
local showScrollBar = nil;
if ( numWhos > WHOS_TO_DISPLAY ) then
showScrollBar = 1;
end
local displayedText = "";
if ( totalCount > MAX_WHOS_FROM_SERVER ) then
displayedText = format(WHO_FRAME_SHOWN_TEMPLATE, MAX_WHOS_FROM_SERVER);
end
WhoFrameTotals:SetText(format(WHO_FRAME_TOTAL_TEMPLATE, totalCount).." "..displayedText);
for i=1, WHOS_TO_DISPLAY, 1 do
whoIndex = whoOffset + i;
button = _G["WhoFrameButton"..i];
button.whoIndex = whoIndex;
name, guild, level, race, class, zone, classFileName = GetWhoInfo(whoIndex);
columnTable = { zone, guild, race };
if ( classFileName ) then
classTextColor = RAID_CLASS_COLORS[classFileName];
else
classTextColor = HIGHLIGHT_FONT_COLOR;
end
buttonText = _G["WhoFrameButton"..i.."Name"];
buttonText:SetText(name);
buttonText = _G["WhoFrameButton"..i.."Level"];
buttonText:SetText(level);
buttonText = _G["WhoFrameButton"..i.."Class"];
buttonText:SetText(class);
buttonText:SetTextColor(classTextColor.r, classTextColor.g, classTextColor.b);
local variableText = _G["WhoFrameButton"..i.."Variable"];
variableText:SetText(columnTable[UIDropDownMenu_GetSelectedID(WhoFrameDropDown)]);
-- If need scrollbar resize columns
if ( showScrollBar ) then
variableText:SetWidth(95);
else
variableText:SetWidth(110);
end
-- Highlight the correct who
if ( WhoFrame.selectedWho == whoIndex ) then
button:LockHighlight();
else
button:UnlockHighlight();
end
if ( whoIndex > numWhos ) then
button:Hide();
else
button:Show();
end
end
if ( not WhoFrame.selectedWho ) then
WhoFrameGroupInviteButton:Disable();
WhoFrameAddFriendButton:Disable();
else
WhoFrameGroupInviteButton:Enable();
WhoFrameAddFriendButton:Enable();
WhoFrame.selectedName = GetWhoInfo(WhoFrame.selectedWho);
end
-- If need scrollbar resize columns
if ( showScrollBar ) then
WhoFrameColumn_SetWidth(WhoFrameColumnHeader2, 105);
UIDropDownMenu_SetWidth(WhoFrameDropDown, 80);
else
WhoFrameColumn_SetWidth(WhoFrameColumnHeader2, 120);
UIDropDownMenu_SetWidth(WhoFrameDropDown, 95);
end
-- ScrollFrame update
FauxScrollFrame_Update(WhoListScrollFrame, numWhos, WHOS_TO_DISPLAY, FRIENDS_FRAME_WHO_HEIGHT );
PanelTemplates_SetTab(FriendsFrame, 2);
ShowUIPanel(FriendsFrame);
end
function GuildStatus_Update()
-- Set the tab
PanelTemplates_SetTab(FriendsFrame, 3);
-- Show the frame
ShowUIPanel(FriendsFrame);
-- Number of players in the lowest rank
FriendsFrame.playersInBotRank = 0;
local numGuildMembers = GetNumGuildMembers();
local name, rank, rankIndex, level, class, zone, note, officernote, online, status, classFileName;
local guildName, guildRankName, guildRankIndex = GetGuildInfo("player");
local maxRankIndex = GuildControlGetNumRanks() - 1;
local button, buttonText, classTextColor;
local onlinecount = 0;
local guildIndex;
-- Get selected guild member info
name, rank, rankIndex, level, class, zone, note, officernote, online = GetGuildRosterInfo(GetGuildRosterSelection());
GuildFrame.selectedName = name;
-- If there's a selected guildmember
if ( GetGuildRosterSelection() > 0 ) then
-- Update the guild member details frame
GuildMemberDetailName:SetText(GuildFrame.selectedName);
GuildMemberDetailLevel:SetFormattedText(FRIENDS_LEVEL_TEMPLATE, level, class);
GuildMemberDetailZoneText:SetText(zone);
GuildMemberDetailRankText:SetText(rank);
if ( online ) then
GuildMemberDetailOnlineText:SetText(GUILD_ONLINE_LABEL);
else
GuildMemberDetailOnlineText:SetText(GuildFrame_GetLastOnline(GetGuildRosterSelection()));
end
-- Update public note
if ( CanEditPublicNote() ) then
PersonalNoteText:SetTextColor(1.0, 1.0, 1.0);
if ( (not note) or (note == "") ) then
note = GUILD_NOTE_EDITLABEL;
end
else
PersonalNoteText:SetTextColor(0.65, 0.65, 0.65);
end
GuildMemberNoteBackground:EnableMouse(CanEditPublicNote());
PersonalNoteText:SetText(note);
-- Update officer note
if ( CanViewOfficerNote() ) then
if ( CanEditOfficerNote() ) then
if ( (not officernote) or (officernote == "") ) then
officernote = GUILD_OFFICERNOTE_EDITLABEL;
end
OfficerNoteText:SetTextColor(1.0, 1.0, 1.0);
else
OfficerNoteText:SetTextColor(0.65, 0.65, 0.65);
end
GuildMemberOfficerNoteBackground:EnableMouse(CanEditOfficerNote());
OfficerNoteText:SetText(officernote);
-- Resize detail frame
GuildMemberDetailOfficerNoteLabel:Show();
GuildMemberOfficerNoteBackground:Show();
GuildMemberDetailFrame:SetHeight(GUILD_DETAIL_OFFICER_HEIGHT);
else
GuildMemberDetailOfficerNoteLabel:Hide();
GuildMemberOfficerNoteBackground:Hide();
GuildMemberDetailFrame:SetHeight(GUILD_DETAIL_NORM_HEIGHT);
end
-- Manage guild member related buttons
if ( CanGuildPromote() and ( rankIndex > 1 ) and ( rankIndex > (guildRankIndex + 1) ) ) then
GuildFramePromoteButton:Enable();
else
GuildFramePromoteButton:Disable();
end
if ( CanGuildDemote() and ( rankIndex >= 1 ) and ( rankIndex > guildRankIndex ) and ( rankIndex ~= maxRankIndex ) ) then
GuildFrameDemoteButton:Enable();
else
GuildFrameDemoteButton:Disable();
end
-- Hide promote/demote buttons if both disabled
if ( GuildFrameDemoteButton:IsEnabled() == 0 and GuildFramePromoteButton:IsEnabled() == 0 ) then
GuildFramePromoteButton:Hide();
GuildFrameDemoteButton:Hide();
else
GuildFramePromoteButton:Show();
GuildFrameDemoteButton:Show();
end
if ( CanGuildRemove() and ( rankIndex >= 1 ) and ( rankIndex > guildRankIndex ) ) then
GuildMemberRemoveButton:Enable();
else
GuildMemberRemoveButton:Disable();
end
if ( (UnitName("player") == name) or (not online) ) then
GuildMemberGroupInviteButton:Disable();
else
GuildMemberGroupInviteButton:Enable();
end
GuildFrame.selectedName = GetGuildRosterInfo(GetGuildRosterSelection());
else
GuildMemberDetailFrame:Hide();
end
-- Message of the day stuff
local guildMOTD = GetGuildRosterMOTD();
if ( CanEditMOTD() ) then
if ( (not guildMOTD) or (guildMOTD == "") ) then
guildMOTD = GUILD_MOTD_EDITLABEL;
end
GuildFrameNotesText:SetTextColor(1.0, 1.0, 1.0);
GuildMOTDEditButton:Enable();
else
GuildFrameNotesText:SetTextColor(0.65, 0.65, 0.65);
GuildMOTDEditButton:Disable();
end
GuildFrameNotesText:SetText(CURRENT_GUILD_MOTD);
-- Scrollbar stuff
local showScrollBar = nil;
if ( numGuildMembers > GUILDMEMBERS_TO_DISPLAY ) then
showScrollBar = 1;
end
-- Get number of online members
for i=1, numGuildMembers, 1 do
name, rank, rankIndex, level, class, zone, note, officernote, online = GetGuildRosterInfo(i);
if ( online ) then
onlinecount = onlinecount + 1;
end
if ( rankIndex == maxRankIndex ) then
FriendsFrame.playersInBotRank = FriendsFrame.playersInBotRank + 1;
end
end
GuildFrameTotals:SetFormattedText(GUILD_TOTAL, numGuildMembers);
GuildFrameOnlineTotals:SetFormattedText(GUILD_TOTALONLINE, onlinecount);
-- Update global guild frame buttons
if ( IsGuildLeader() ) then
GuildFrameControlButton:Enable();
else
GuildFrameControlButton:Disable();
end
if ( CanGuildInvite() ) then
GuildFrameAddMemberButton:Enable();
else
GuildFrameAddMemberButton:Disable();
end