This repository has been archived by the owner on Dec 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
GuildGreet.lua
8206 lines (7393 loc) · 317 KB
/
GuildGreet.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
--[[--------------------------------------------------------
-- GuildGreet, a World of Warcraft social guild assistant --
------------------------------------------------------------
]]----------------------------------------------------------
local GLDG = LibStub("AceAddon-3.0"):NewAddon("GuildGreet", "AceConsole-3.0", "AceEvent-3.0", "AceTimer-3.0")
local L = LibStub("AceLocale-3.0"):GetLocale("GuildGreet", false)
-- Binding names
BINDING_HEADER_GUILDGREET = L["GuildGreet"]
BINDING_NAME_GUILDGREETCONFIG = L["Open config window"]
BINDING_NAME_GUILDGREETCLEAR = L["Clear greet list"]
BINDING_NAME_GUILDGREETTESTL = L["Test trigger"]
BINDING_NAME_GUILDGREETGREETGUILD = L["Greet Guild and Channel"]
BINDING_NAME_GUILDGREETBYEGUILD = L["Say goodbye to guild and channel"]
BINDING_NAME_GUILDGREETLATERGUILD = L["Say see you later to guild and channel"]
-- Addon constants
GLDG_NAME = "GuildGreet"
GLDG_GUI = "GuildGreetFrame" -- Name of GUI config window
GLDG_LIST = "GuildGreetList" -- Name of GUI player list
GLDG_COLOUR = "GuildGreetColourFrame" -- Name of colour picker addition
GDLG_VNMBR = 100000 -- Number code for this version
-- Table linking tabs to frames
GLDG_Tab2Frame = {}
GLDG_Tab2Frame.Tab1 = L["Settings"]
GLDG_Tab2Frame.Tab2 = L["Greetings"]
GLDG_Tab2Frame.Tab3 = L["Players"]
GLDG_Tab2Frame.Tab4 = L["Cleanup"]
GLDG_Tab2Frame.Tab5 = L["Colour"]
GLDG_SubTab2Frame = {}
GLDG_SubTab2Frame.Tab1 = L["General"]
GLDG_SubTab2Frame.Tab2 = L["Chat"]
GLDG_SubTab2Frame.Tab3 = L["Greeting"]
--GLDG_SubTab2Frame.Tab4 = "Debug"
GLDG_SubTab2Frame.Tab4 = L["Other"]
-- Strings we look for
GLDG_ONLINE = ".*%[(.+)%]%S*"..string.sub(ERR_FRIEND_ONLINE_SS, 20)
GLDG_ONLINE = ".*%[(.+)%]%S*"..string.sub(string.gsub(ERR_FRIEND_ONLINE_SS, "|cff00ff00online|r", "online"), 20) -- fix for RealUI 8 users
GLDG_OFFLINE = string.format(ERR_FRIEND_OFFLINE_S, "(.+)")
GLDG_JOINED = string.format(ERR_GUILD_JOIN_S, "(.+)")
GLDG_PROMO = string.format(ERR_GUILD_PROMOTE_SSS, "(.+)", "(.+)", "(.+)")
GLDG_DEMOTE = string.format(ERR_GUILD_DEMOTE_SSS, ".+", "(.+)", "(.+)")
GLDG_ACHIEVE = string.format(ACHIEVEMENT_BROADCAST, "(.+)", "(.+)")
GLDG_DEFAULT_ONLINE_COLOUR = "|cFFA0FFA0"
GLDG_DEFAULT_IS_OFFLINE_COLOUR = "|cFFFFFFFF"
GLDG_DEFAULT_GOES_OFFLINE_COLOUR = "|cFF7F7F7F"
GLDG_DEFAULT_HELP_COLOUR = "|cFFFFFF7F"
GLDG_DEFAULT_ALIAS_COLOUR = "|cFFFFA0A0"
GLDG_DEFAULT_HEADER_COLOUR = "|c7FFF0000"
GLDG_DEFAULT_LIST_COLOUR = "|cFFFF7F00"
GLDG_DEFAULT_NEW_COLOUR = "|cFFFF3F3F"
GLDG_DEFAULT_LVL_COLOUR = "|cFF7F7F7F"
GLDG_DEFAULT_RANK_COLOUR = "|cFFCC00CC"
GLDG_DEFAULT_RELOG_COLOUR = "|cFF3FFF3F"
GLDG_DEFAULT_ACHIEVMENT_COLOUR = "|cFF001FFF"
GLDG_ONLINE_COLOUR = GLDG_DEFAULT_ONLINE_COLOUR
GLDG_IS_OFFLINE_COLOUR = GLDG_DEFAULT_IS_OFFLINE_COLOUR
GLDG_GOES_OFFLINE_COLOUR = GLDG_DEFAULT_GOES_OFFLINE_COLOUR
GLDG_ALIAS_COLOUR = GLDG_DEFAULT_ALIAS_COLOUR
GLDG_LEVEL_CAP = 60
GLDG_CONFIG_STRING = nil
GLDG_CONFIG_STRING_A = nil
GLDG_CONFIG_STRING_B = nil
GLDG_CONFIG_STRING_C = nil
GLDG_CONFIG_STRING_D = nil
--------------------------
-- _01_ Addon Variables --
--------------------------
-- Stored data
GLDG_Data = {} -- Data saved between sessions
GLDG_DataGreet = nil -- Pointer to relevant greeting section in GLDG_Data
GLDGL_DataChar = nil -- Pointer to relevant character section in GLDG_Data
-- Initialization
GLDG_Main = nil -- Main program window
GLDG_Realm = nil -- Name of the current realm
GLDG_Player = nil -- Name of the current player
GLDG_shortName = nil -- Playername without Server
GLDG_GuildName = nil -- Name of your guild
GLDG_GuildAlias = nil -- Alias of your guild
GLDG_GuildLeader = nil
GLDG_unique_GuildName = nil
GLDG_ginfotxt = nil
GLDG_config_from_guild = nil
GLDG_corrupted_config_from_guild = nil
GLDG_NewGuild = nil -- Set if initializing a new guild
GLDG_InitialGuildUpdate = nil -- To make sure we get at least one update
GLDG_InitialFriendsUpdate = nil -- To make sure we get at least one update
GLDG_UpdateRequest = 0 -- If set with time, update will be performed
GLDG_UpdateRequestFriends = 0 -- If set with time, update will be performed
GLDG_InitComplete = nil -- Set in initialization is done
GLDG_ReadNotes = 1
GLDG_RosterImportRunning = 0
GLDG_InitCheck = 0 -- Check for changes and display them; 0 = not started, 1 = pending guild, 2 = pending friends, 4 = pending channel, 8 = done guild, 16 = done friends, 32 = done channel
GLDG_ChangesText = {} -- text for popup display
-- Various
GLDG_Debug = false -- Show debugging
-- Core variables
GLDG_Online = {} -- Time of player going online
GLDG_Offline = {} -- Time of player going offline -- todo: make this persistent?
GLDG_RankUpdate = {} -- Set with time for all players getting promoted during the session
GLDG_Queue = {} -- List of players waiting to be greeted
-- Configuration: greetings tab
GLDG_SelColName = nil -- Name of the currently selected collection
GLDG_NumColRows = 5 -- Maximum number of collections that can be displayed
GLDG_ChangeName = nil -- Name of the setting to be changed
GLDG_Selection = "Greet" -- Selected greeting category
GLDG_SelMsgNum = nil -- Number of the currently selected message
GLDG_NumSelRows = 5 -- Maximum number of greetings that can be displayed
GLDG_GreetOffset = 0 -- Offset for displaying greetings
-- Configuration: players tab
GLDG_SelPlrName = nil -- Name of the currently selected player
GLDG_NumPlrRows = 20 -- Maximum number of players that can be displayed
GLDG_SortedList = {} -- Sorted list of members of your guild, excluding your own characters
GLDG_PlayerOffset = 0 -- Offset for displaying players
GLDG_NumMain = 0 -- Number of players defined as main
GLDG_NumAlts = 0 -- Number of players that are alts for current selected player
GLDG_NumSubRows = 9 -- Maximum number of mains that can be displayed on subframe
-- update timer
GLDG_UPDATE_TIME = 10 -- Number of seconds to query guild and friends list (default)
-- channel parse counter
GLDG_unregister = 0 -- Number of pending requests
-- auto greet flag
GLDG_autoGreeted = 0 -- To make sure auto greet is only done once per login
-- auto check consistency
GLDG_autoConsistencyCheckReady = nil
GLDG_autoConsistencyChecked = nil
------------------------
-- _02_ Addon Startup --
------------------------
------------------------------------------------------------
function GLDG_OnLoad(self)
-- Events monitored by Event Handler
GLDG_Main = self
self:RegisterEvent("ADDON_LOADED")
self:RegisterEvent("VARIABLES_LOADED")
self:RegisterEvent("PLAYER_ENTERING_WORLD")
self:RegisterEvent("SAVED_VARIABLES_TOO_LARGE")
-- Slash commands for CLI
SLASH_GLDG1 = "/guildgreet"
SLASH_GLDG2 = "/gg"
SlashCmdList.GLDG = GLDG_SlashHandler
end
------------------------
-- _03_ Event Handler --
------------------------
function GLDG_OnEvent(self, event, ...)
local arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13 = ...
-- Distribute events to appropriate functions
if (event == "ADDON_LOADED") and (arg1 == GLDG_NAME) then
GLDG_Main:UnregisterEvent("ADDON_LOADED")
if GLDG_InitComplete==nil then
-- GLDG_myAddons()
GLDG_Init()
--GLDG_RegisterUrbinAddon(GLDG_NAME, GLDG_About)
end
elseif (event == "VARIABLES_LOADED") then
GLDG_Main:UnregisterEvent("VARIABLES_LOADED")
if GLDG_InitComplete==nil then
-- GLDG_myAddons()
GLDG_Init()
--GLDG_RegisterUrbinAddon(GLDG_NAME, GLDG_About)
end
GLDG_autoConsistencyCheckReady = true
-- add menu to player frame and chat menu
if (GLDG_Data.ExtendPlayerMenu==true) then
GLDG_AddPopUpButtons();
end
elseif (event == "PLAYER_ENTERING_WORLD") then
if GLDG_InitComplete==nil then
GLDG_Init()
end
GLDG_CheckForGuildAlert()
GLDG_InitRoster()
GLDG_Main:UnregisterEvent("PLAYER_ENTERING_WORLD")
GLDG_Main:RegisterEvent("GUILD_ROSTER_UPDATE")
GLDG_Main:RegisterEvent("FRIENDLIST_UPDATE")
GLDG_Main:RegisterEvent("CHAT_MSG_CHANNEL_JOIN")
GLDG_Main:RegisterEvent("CHAT_MSG_CHANNEL_LEAVE")
GLDG_Main:RegisterEvent("CHAT_MSG_CHANNEL_NOTICE")
GLDG_Main:RegisterEvent("CHAT_MSG_ADDON")
GLDG_Main:RegisterEvent("GROUP_ROSTER_UPDATE")
GLDG_Main:RegisterEvent("CHAT_MSG_GUILD_ACHIEVEMENT")
GLDG_Main:RegisterEvent("WHO_LIST_UPDATE")
-- hooking msg events (replacing old ChatFrame_OnEvent handling)
ChatFrame_AddMessageEventFilter("CHAT_MSG_GUILD", GLDG_ChatFilter)
ChatFrame_AddMessageEventFilter("CHAT_MSG_OFFICER", GLDG_ChatFilter)
ChatFrame_AddMessageEventFilter("CHAT_MSG_CHANNEL", GLDG_ChatFilter)
ChatFrame_AddMessageEventFilter("CHAT_MSG_WHISPER", GLDG_ChatFilter)
ChatFrame_AddMessageEventFilter("CHAT_MSG_ACHIEVEMENT", GLDG_ChatFilter)
-- Battle.net events (testing)
GLDG_Main:RegisterEvent("BN_CONNECTED")
GLDG_Main:RegisterEvent("BN_DISCONNECTED")
GLDG_Main:RegisterEvent("BN_FRIEND_ACCOUNT_OFFLINE")
GLDG_Main:RegisterEvent("BN_FRIEND_ACCOUNT_ONLINE")
GLDG_Main:RegisterEvent("BN_FRIEND_INFO_CHANGED")
elseif (event == "GUILD_ROSTER_UPDATE") then
if IsInGuild() then
if (GLDG_unique_GuildName and GLDG_Realm and GLDG_unique_GuildName~="") then
-- guild name known -> treat guild info
if (GLDG_ginfotxt) and (GLDG_ginfotxt ~= GetGuildInfoText()) then GLDG_ginfotxt = GetGuildInfoText(); GLDG_config_from_guild = nil end
if GLDG_Data.GuildSettings.UseGuildDefault==true and GLDG_config_from_guild == nil then
GLDG_ginfotxt = GetGuildInfoText()
if GLDG_ginfotxt >= " " then
if not GLDG_Data[GLDG_unique_GuildName] then GLDG_Data[GLDG_unique_GuildName] = {} end
if not GLDG_Data.GuildSettings then GLDG_Data.GuildSettings = {} end
GLDG_Data.GuildSettings.UseGuildDefault=true
GLDG_readConfigString()
GLDG_SetCheckboxes()
end
end
if GLDG_Data.GuildSettings.UseGuildDefault == false and GLDG_config_from_guild == nil then
GLDG_ginfotxt = GetGuildInfoText()
if GLDG_ginfotxt >= " " then
GLDG_readConfigString()
end
end
if GLDG_RosterImportRunning==0 then
GLDG_RosterImport()
end
else
-- guild name not yet known -> try reinitialisation
GLDG_InitRoster()
end
else
-- nothing to do if not in guild
end
elseif (event == "CHAT_MSG_GUILD_ACHIEVEMENT") then
GLDG_TreatAchievment(arg1, arg2)
elseif (event == "CHAT_MSG_ACHIEVEMENT") then
GLDG_TreatAchievment(arg1, arg2)
-- who response going to social frame
elseif (event == "WHO_LIST_UPDATE") then
GLDG_ParseWho()
-- who responses going to chat
elseif ( event == "CHAT_MSG_SYSTEM" ) and (arg1 and strfind(arg1, WHO_NUM_RESULTS) ) then
GLDG_ParseWho()
-- guild members and/or friends joining/leaving
elseif (event == "CHAT_MSG_SYSTEM") then
GLDG_SystemMsg(arg1)
elseif (event == "FRIENDLIST_UPDATE") then
if (GLDG_Realm and GLDG_Player) then
GLDG_FriendsUpdate()
else
GLDG_InitRoster()
end
-- entering special channel
elseif (event == "CHAT_MSG_CHANNEL_NOTICE") then
if (arg9 and arg9 ~="" and string.lower(arg9) == GLDG_ChannelName) then
if (arg1 and arg1 == "YOU_JOINED") then
GLDG_CheckChannel()
elseif (arg1 and arg1 == "YOU_LEFT") then
GLDG_inChannel = false;
end
end
-- parsing update of special channel
elseif (event == "CHAT_MSG_CHANNEL_LIST") then
if (arg9 and arg9~="" and string.lower(arg9)==GLDG_ChannelName) then
GLDG_InitChannel(arg1)
end
-- catching people entering and leaving channel
elseif (event == "CHAT_MSG_CHANNEL_JOIN") then
if (arg9 and arg9~="" and string.lower(arg9) == GLDG_ChannelName) then
GLDG_UpdateChannel(true, arg2)
end
elseif (event == "CHAT_MSG_CHANNEL_LEAVE") then
if (arg9 and arg9~="" and string.lower(arg9) == GLDG_ChannelName) then
GLDG_UpdateChannel(false, arg2)
end
elseif (event == "CHAT_MSG_ADDON") then
-- arg1 = prefix, arg2 = msg, arg3 = channel, arg4 = sender
if (arg1 == "GLDG") then
--GLDG_Print("--> "..event..": "..arg1.." ["..arg2.."] - "..arg3..": "..arg4)
if (string.sub(arg2, 1, 4)=="VER:") then
if (GLDG_Data.ShowNewerVersions==true) then
local myVersion = GetAddOnMetadata("GuildGreet", "Version")
local hisVersion = string.sub(arg2, 5)
if (not GLDG_HighestVersion) then
GLDG_HighestVersion = myVersion
end
if (GLDG_Data.BigBrother and (arg4 ~= GLDG_Player)) then
if (not GLDG_BigBrother) then
GLDG_BigBrother = {}
end
if (not GLDG_BigBrother[arg4]) then
GLDG_BigBrother[arg4] = hisVersion
GLDG_Print(GLDG_Data.colours.help..GLDG_NAME..":|r "..arg4..L[" is using version "]..hisVersion)
elseif (GLDG_BigBrother[arg4] ~= hisVersion) then
GLDG_Print(GLDG_Data.colours.help..GLDG_NAME..":|r "..arg4..L[" has updated from version "]..GLDG_BigBrother[arg4]..L[" to version "]..hisVersion..L[""])
GLDG_BigBrother[arg4] = hisVersion
end
end
--GLDG_Print(" My Version ["..myVersion.."] - Other Version ["..hisVersion.."]")
if (hisVersion > myVersion) then
if (hisVersion > GLDG_HighestVersion) then
-- to make sure, we only warn once
GLDG_HighestVersion = hisVersion
GLDG_Print(GLDG_Data.colours.help..GLDG_NAME..":|r "..L["A newer Version of the addon is available."])
GLDG_Print(GLDG_Data.colours.help..GLDG_NAME..":|r "..L["You have version "]..myVersion..L["."])
GLDG_Print(GLDG_Data.colours.help..GLDG_NAME..":|r "..L["Player"]..arg4..L[" has version "]..hisVersion..GL["."])
else
--GLDG_Print(" "..arg4.." has version "..hisVersion.." - you have "..myVersion.." - highest seen "..GLDG_HighestVersion)
end
end
end
elseif (string.sub(arg2, 1, 6)=="QUERY:") then
C_ChatInfo.SendAddonMessage("GLDG", "VER:"..GetAddOnMetadata("GuildGreet", "Version"), "GUILD")
local inInstance, instanceType = IsInInstance()
if (instanceType ~= "pvp") and (instanceType ~= "arena") and (GetNumSubgroupMembers() > 0) then
C_ChatInfo.SendAddonMessage("GLDG", "VER:"..GetAddOnMetadata("GuildGreet", "Version"), "PARTY")
end
if (instanceType ~= "pvp") and (instanceType ~= "arena") and (GetNumGroupMembers() > 0) then
C_ChatInfo.SendAddonMessage("GLDG", "VER:"..GetAddOnMetadata("GuildGreet", "Version"), "RAID")
end
if (instanceType == "pvp") then
C_ChatInfo.SendAddonMessage("GLDG", "VER:"..GetAddOnMetadata("GuildGreet", "Version"), "BATTLEGROUND")
end
end
end
-- catching people leaving or entering party/raid
-- it seems that GetNumParty/RaidMembers() returns >0 when in BGs but PARTY and RAID are unavailable in these settings
elseif (event == "GROUP_ROSTER_UPDATE") then
local inInstance, instanceType = IsInInstance()
if (instanceType ~= "pvp") and (instanceType ~= "arena") and (GetNumSubgroupMembers() > 0 ) then
C_ChatInfo.SendAddonMessage("GLDG", "VER:"..GetAddOnMetadata("GuildGreet", "Version"), "PARTY")
end
if (instanceType ~= "pvp") and (instanceType ~= "arena") and (GetNumGroupMembers() > 0) then
C_ChatInfo.SendAddonMessage("GLDG", "VER:"..GetAddOnMetadata("GuildGreet", "Version"), "RAID")
end
if (instanceType == "pvp") then
C_ChatInfo.SendAddonMessage("GLDG", "VER:"..GetAddOnMetadata("GuildGreet", "Version"), "BATTLEGROUND")
end
elseif (event == "BN_CONNECTED") or
(event == "BN_DISCONNECTED") or
(event == "BN_FRIEND_ACCOUNT_OFFLINE") or
(event == "BN_FRIEND_ACCOUNT_ONLINE") or
(event == "BN_FRIEND_INFO_CHANGED") then
if (arg1~=nil) or (arg2~=nil) or (arg3~=nil) or (arg4~=nil) or (arg5~=nil) or (arg6~=nil) or (arg7~=nil) or (arg8~=nil) or (arg9~=nil) or (arg10~=nil) or (arg11~=nil) or (arg12~=nil) or (arg13~=nil) then
--GLDG_Print("[Battle.Net] event ["..tostring(event).."]: arg1: "..tostring(arg1).." - arg2: "..tostring(arg2).." - arg3: "..tostring(arg3).." - arg4: "..tostring(arg4).." - arg5: "..tostring(arg5).." - arg6: "..tostring(arg6).." - arg7: "..tostring(arg7).." - arg8: "..tostring(arg8).." - arg9: "..tostring(arg9).." - arg10: "..tostring(arg10).." - arg11: "..tostring(arg11).." - arg12: "..tostring(arg12).." - arg13: "..tostring(arg13));
end
--GLDG_Test()
end
end
-------------------------------
-- _04_ Addon Initialization --
-------------------------------
function GLDG_Init()
local version = GetAddOnMetadata("GuildGreet", "Version");
if (version == nil) then
version = "unknown";
end
-- store realm and player names
if not GLDG_Realm then GLDG_Realm = GetRealmName() end
if not GLDG_Player then GLDG_Player = UnitName("player") end
-- Clear obsolete options
GLDG_Data.EnableContextMenu = nil
-- Set defaults for missing settings
if GLDG_unique_GuildName then
if not GLDG_Data[GLDG_unique_GuildName] then
GLDG_Data[GLDG_unique_GuildName] = {}
GLDG_Data[GLDG_unique_GuildName].UseGuildDefault = true
end
end
if not GLDG_Data.GuildSettings then GLDG_Data.GuildSettings = {} end
if GLDG_Data[GLDG_unique_GuildName] then
-- convert for API 6.0.2 begin
if GLDG_Data[GLDG_unique_GuildName].GreetAsMain==1 then GLDG_Data[GLDG_unique_GuildName].GreetAsMain=true end
if GLDG_Data[GLDG_unique_GuildName].Randomize==1 then GLDG_Data[GLDG_unique_GuildName].Randomize=true end
if GLDG_Data[GLDG_unique_GuildName].Whisper==1 then GLDG_Data[GLDG_unique_GuildName].Whisper=true end
if GLDG_Data[GLDG_unique_GuildName].WhisperLevelup==1 then GLDG_Data[GLDG_unique_GuildName].WhisperLevelup=true end
if GLDG_Data[GLDG_unique_GuildName].IncludeOwn==1 then GLDG_Data[GLDG_unique_GuildName].IncludeOwn=true end
if GLDG_Data[GLDG_unique_GuildName].AutoAssign==1 then GLDG_Data[GLDG_unique_GuildName].AutoAssign=true end
if GLDG_Data[GLDG_unique_GuildName].AutoAssignEgp==1 then GLDG_Data[GLDG_unique_GuildName].AutoAssignEgp=true end
if GLDG_Data[GLDG_unique_GuildName].AutoAssignAlias==1 then GLDG_Data[GLDG_unique_GuildName].AutoAssignAlias=true end
if GLDG_Data[GLDG_unique_GuildName].ListNames==1 then GLDG_Data[GLDG_unique_GuildName].ListNames=true end
if GLDG_Data[GLDG_unique_GuildName].ListNamesOff==1 then GLDG_Data[GLDG_unique_GuildName].ListNamesOff=true end
if GLDG_Data[GLDG_unique_GuildName].ListLevelUp==1 then GLDG_Data[GLDG_unique_GuildName].ListLevelUp=true end
if GLDG_Data[GLDG_unique_GuildName].ListLevelUpOff==1 then GLDG_Data[GLDG_unique_GuildName].ListLevelUpOff=true end
if GLDG_Data[GLDG_unique_GuildName].ListAchievments==1 then GLDG_Data[GLDG_unique_GuildName].ListAchievments=true end
if GLDG_Data[GLDG_unique_GuildName].ListQuit==1 then GLDG_Data[GLDG_unique_GuildName].ListQuit=true end
if GLDG_Data[GLDG_unique_GuildName].ExtendChat==1 then GLDG_Data[GLDG_unique_GuildName].ExtendChat=true end
if GLDG_Data[GLDG_unique_GuildName].ExtendIgnored==1 then GLDG_Data[GLDG_unique_GuildName].ExtendIgnored=true end
if GLDG_Data[GLDG_unique_GuildName].ExtendMain==1 then GLDG_Data[GLDG_unique_GuildName].ExtendMain=true end
if GLDG_Data[GLDG_unique_GuildName].ExtendAlias==1 then GLDG_Data[GLDG_unique_GuildName].ExtendAlias=true end
if GLDG_Data[GLDG_unique_GuildName].AddPostfix==1 then GLDG_Data[GLDG_unique_GuildName].AddPostfix=true end
if GLDG_Data[GLDG_unique_GuildName].ShowWhoSpam==1 then GLDG_Data[GLDG_unique_GuildName].ShowWhoSpam=true end
if GLDG_Data[GLDG_unique_GuildName].SupressGreet==1 then GLDG_Data[GLDG_unique_GuildName].SupressGreet=true end
if GLDG_Data[GLDG_unique_GuildName].SupressJoin==1 then GLDG_Data[GLDG_unique_GuildName].SupressJoin=true end
if GLDG_Data[GLDG_unique_GuildName].SupressLevel==1 then GLDG_Data[GLDG_unique_GuildName].SupressLevel=true end
if GLDG_Data[GLDG_unique_GuildName].SupressRank==1 then GLDG_Data[GLDG_unique_GuildName].SupressRank=true end
if GLDG_Data[GLDG_unique_GuildName].SupressAchievment==1 then GLDG_Data[GLDG_unique_GuildName].SupressAchievment=true end
if GLDG_Data[GLDG_unique_GuildName].NoGratsOnLogin==1 then GLDG_Data[GLDG_unique_GuildName].NoGratsOnLogin=true end
if GLDG_Data[GLDG_unique_GuildName].DeltaPopup==1 then GLDG_Data[GLDG_unique_GuildName].DeltaPopup=true end
if GLDG_Data[GLDG_unique_GuildName].RelogTime==1 then GLDG_Data[GLDG_unique_GuildName].RelogTime=true end
if GLDG_Data[GLDG_unique_GuildName].MinLevelUp==1 then GLDG_Data[GLDG_unique_GuildName].MinLevelUp=true end
if GLDG_Data[GLDG_unique_GuildName].UseGuildDefault==1 then GLDG_Data[GLDG_unique_GuildName].UseGuildDefault=true end
-- convert for API 6.0.2 end
GLDG_Data.GuildSettings.GreetAsMain = GLDG_Data[GLDG_unique_GuildName].GreetAsMain
GLDG_Data.GuildSettings.Randomize = GLDG_Data[GLDG_unique_GuildName].Randomize
GLDG_Data.GuildSettings.Whisper = GLDG_Data[GLDG_unique_GuildName].Whisper
GLDG_Data.GuildSettings.WhisperLevelup = GLDG_Data[GLDG_unique_GuildName].WhisperLevelup
GLDG_Data.GuildSettings.IncludeOwn = GLDG_Data[GLDG_unique_GuildName].IncludeOwn
GLDG_Data.GuildSettings.AutoAssign = GLDG_Data[GLDG_unique_GuildName].AutoAssign
GLDG_Data.GuildSettings.AutoAssignEgp = GLDG_Data[GLDG_unique_GuildName].AutoAssignEgp
GLDG_Data.GuildSettings.AutoAssignAlias = GLDG_Data[GLDG_unique_GuildName].AutoAssignAlias
GLDG_Data.GuildSettings.ListNames = GLDG_Data[GLDG_unique_GuildName].ListNames
GLDG_Data.GuildSettings.ListNamesOff = GLDG_Data[GLDG_unique_GuildName].ListNamesOff
GLDG_Data.GuildSettings.ListLevelUp = GLDG_Data[GLDG_unique_GuildName].ListLevelUp
GLDG_Data.GuildSettings.ListLevelUpOff = GLDG_Data[GLDG_unique_GuildName].ListLevelUpOff
GLDG_Data.GuildSettings.ListAchievments = GLDG_Data[GLDG_unique_GuildName].ListAchievments
GLDG_Data.GuildSettings.ListQuit = GLDG_Data[GLDG_unique_GuildName].ListQuit
GLDG_Data.GuildSettings.ExtendChat = GLDG_Data[GLDG_unique_GuildName].ExtendChat
GLDG_Data.GuildSettings.ExtendIgnored = GLDG_Data[GLDG_unique_GuildName].ExtendIgnored
GLDG_Data.GuildSettings.ExtendMain = GLDG_Data[GLDG_unique_GuildName].ExtendMain
GLDG_Data.GuildSettings.ExtendAlias = GLDG_Data[GLDG_unique_GuildName].ExtendAlias
GLDG_Data.GuildSettings.AddPostfix = GLDG_Data[GLDG_unique_GuildName].AddPostfix
GLDG_Data.GuildSettings.ShowWhoSpam = GLDG_Data[GLDG_unique_GuildName].ShowWhoSpam
GLDG_Data.GuildSettings.SupressGreet = GLDG_Data[GLDG_unique_GuildName].SupressGreet
GLDG_Data.GuildSettings.SupressJoin = GLDG_Data[GLDG_unique_GuildName].SupressJoin
GLDG_Data.GuildSettings.SupressLevel = GLDG_Data[GLDG_unique_GuildName].SupressLevel
GLDG_Data.GuildSettings.SupressRank = GLDG_Data[GLDG_unique_GuildName].SupressRank
GLDG_Data.GuildSettings.SupressAchievment = GLDG_Data[GLDG_unique_GuildName].SupressAchievment
GLDG_Data.GuildSettings.NoGratsOnLogin = GLDG_Data[GLDG_unique_GuildName].NoGratsOnLogin
GLDG_Data.GuildSettings.DeltaPopup = GLDG_Data[GLDG_unique_GuildName].DeltaPopup
GLDG_Data.GuildSettings.RelogTime = GLDG_Data[GLDG_unique_GuildName].RelogTime
GLDG_Data.GuildSettings.MinLevelUp = GLDG_Data[GLDG_unique_GuildName].MinLevelUp
GLDG_Data.GuildSettings.UseGuildDefault = GLDG_Data[GLDG_unique_GuildName].UseGuildDefault
end
if not GLDG_Data.GuildSettings.RelogTime then GLDG_Data.GuildSettings.RelogTime = 2 end
if not GLDG_Data.GuildSettings.MinLevelUp then GLDG_Data.GuildSettings.MinLevelUp = 0 end
GLDG_Data.UpdateTime = 0
if not GLDG_Data.GuildSettings.UseGuildDefault then GLDG_Data.GuildSettings.UseGuildDefault = false end
if not GLDG_Data.ListSize then GLDG_Data.ListSize = 5 end
if not GLDG_Data.PlayerChatFrame then GLDG_Data.PlayerChatFrame = {} end
if not GLDG_Data.PlayerChatFrame[GLDG_Player.."-"..GLDG_Realm] then GLDG_Data.PlayerChatFrame[GLDG_Player.."-"..GLDG_Realm] = 0 end
if not GLDG_Data.Greet then GLDG_Data.Greet = GLDG_GREET end
if not GLDG_Data.GreetBack then GLDG_Data.GreetBack = GLDG_GREETBACK end
if not GLDG_Data.Welcome then GLDG_Data.Welcome = GLDG_WELCOME end
if not GLDG_Data.NewRank then GLDG_Data.NewRank = GLDG_RANK end
if not GLDG_Data.NewLevel then GLDG_Data.NewLevel = GLDG_LEVEL end
if not GLDG_Data.Bye then GLDG_Data.Bye = GLDG_BYE end
if not GLDG_Data.Night then GLDG_Data.Night = GLDG_NIGHT end
if not GLDG_Data.Guild then GLDG_Data.Guild = GLDG_GUILD end
if not GLDG_Data.Channel then GLDG_Data.Channel = GLDG_CHANNEL end
if not GLDG_Data.ByeGuild then GLDG_Data.ByeGuild = GLDG_BYE_GUILD end
if not GLDG_Data.NightGuild then GLDG_Data.NightGuild = GLDG_NIGHT_GUILD end
if not GLDG_Data.ByeChannel then GLDG_Data.ByeChannel = GLDG_BYE_CHANNEL end
if not GLDG_Data.NightChannel then GLDG_Data.NightChannel = GLDG_NIGHT_CHANNEL end
if not GLDG_Data.LaterGuild then GLDG_Data.LaterGuild = GLDG_LATER_GUILD end
if not GLDG_Data.LaterChannel then GLDG_Data.LaterChannel = GLDG_LATER_CHANNEL end
if not GLDG_Data.Achievment then GLDG_Data.Achievment = GLDG_ACHIEVMENT end
if not GLDG_Data.Collections then GLDG_Data.Collections = {} end
if not GLDG_Data.Custom then GLDG_Data.Custom = {} end
if not GLDG_Data.Ranks then GLDG_Data.Ranks = {} end
if not GLDG_Data.ChannelNames then GLDG_Data.ChannelNames = {} end
if not GLDG_Data.Frameopts then GLDG_Data.Frameopts = {} end
if not GLDG_Data.GuildAlias then GLDG_Data.GuildAlias = {} end
if not GLDG_Data.CheckedGuildAlert then GLDG_Data.CheckedGuildAlert = false end
if not GLDG_Data.GuildSettings.GreetAsMain then GLDG_Data.GuildSettings.GreetAsMain = false end
if not GLDG_Data.GuildSettings.Randomize then GLDG_Data.GuildSettings.Randomize = false end
if not GLDG_Data.GuildSettings.Whisper then GLDG_Data.GuildSettings.Whisper = false end
if not GLDG_Data.GuildSettings.WhisperLevelup then GLDG_Data.GuildSettings.WhisperLevelup = false end
if not GLDG_Data.GuildSettings.IncludeOwn then GLDG_Data.GuildSettings.IncludeOwn = false end
if not GLDG_Data.GuildSettings.ListNames then GLDG_Data.GuildSettings.ListNames = false end
if not GLDG_Data.GuildSettings.ListNamesOff then GLDG_Data.GuildSettings.ListNamesOff = false end
if not GLDG_Data.GuildSettings.ListLevelUp then GLDG_Data.GuildSettings.ListLevelUp = false end
if not GLDG_Data.GuildSettings.ListLevelUpOff then GLDG_Data.GuildSettings.ListLevelUpOff = false end
if not GLDG_Data.GuildSettings.ListQuit then GLDG_Data.GuildSettings.ListQuit = false end
if not GLDG_Data.GuildSettings.ExtendChat then GLDG_Data.GuildSettings.ExtendChat = false end
if not GLDG_Data.GuildSettings.ExtendIgnored then GLDG_Data.GuildSettings.ExtendIgnored = false end
if not GLDG_Data.GuildSettings.ExtendAlias then GLDG_Data.GuildSettings.ExtendAlias = false end
if not GLDG_Data.GuildSettings.ExtendMain then GLDG_Data.GuildSettings.ExtendMain = false end
if not GLDG_Data.GuildSettings.AutoAssign then GLDG_Data.GuildSettings.AutoAssign = false end
if not GLDG_Data.GuildSettings.AutoAssignEgp then GLDG_Data.GuildSettings.AutoAssignEgp = false end
if not GLDG_Data.GuildSettings.AutoAssignAlias then GLDG_Data.GuildSettings.AutoAssignAlias = false end
if not GLDG_Data.UseFriends then GLDG_Data.UseFriends = false end
if not GLDG_Data.ListUp then GLDG_Data.ListUp = false end
if not GLDG_Data.ListVisible then GLDG_Data.ListVisible = false end
if not GLDG_Data.GuildSettings.AddPostfix then GLDG_Data.GuildSettings.AddPostfix = false end
if not GLDG_Data.GuildSettings.ShowWhoSpam then GLDG_Data.GuildSettings.ShowWhoSpam = false end
if not GLDG_Data.GuildSettings.ListAchievments then GLDG_Data.GuildSettings.ListAchievments = false end
-- convert for API 6.0.2 begin
if GLDG_Data.GuildSettings.GreetAsMain==1 then GLDG_Data.GuildSettings.GreetAsMain=true end
if GLDG_Data.GuildSettings.Randomize==1 then GLDG_Data.GuildSettings.Randomize=true end
if GLDG_Data.GuildSettings.Whisper==1 then GLDG_Data.GuildSettings.Whisper=true end
if GLDG_Data.GuildSettings.WhisperLevelup==1 then GLDG_Data.GuildSettings.WhisperLevelup=true end
if GLDG_Data.GuildSettings.IncludeOwn==1 then GLDG_Data.GuildSettings.IncludeOwn=true end
if GLDG_Data.GuildSettings.AutoAssign==1 then GLDG_Data.GuildSettings.AutoAssign=true end
if GLDG_Data.GuildSettings.AutoAssignEgp==1 then GLDG_Data.GuildSettings.AutoAssignEgp=true end
if GLDG_Data.GuildSettings.AutoAssignAlias==1 then GLDG_Data.GuildSettings.AutoAssignAlias=true end
if GLDG_Data.GuildSettings.ListNames==1 then GLDG_Data.GuildSettings.ListNames=true end
if GLDG_Data.GuildSettings.ListNamesOff==1 then GLDG_Data.GuildSettings.ListNamesOff=true end
if GLDG_Data.GuildSettings.ListLevelUp==1 then GLDG_Data.GuildSettings.ListLevelUp=true end
if GLDG_Data.GuildSettings.ListLevelUpOff==1 then GLDG_Data.GuildSettings.ListLevelUpOff=true end
if GLDG_Data.GuildSettings.ListAchievments==1 then GLDG_Data.GuildSettings.ListAchievments=true end
if GLDG_Data.GuildSettings.ListQuit==1 then GLDG_Data.GuildSettings.ListQuit=true end
if GLDG_Data.GuildSettings.ExtendChat==1 then GLDG_Data.GuildSettings.ExtendChat=true end
if GLDG_Data.GuildSettings.ExtendIgnored==1 then GLDG_Data.GuildSettings.ExtendIgnored=true end
if GLDG_Data.GuildSettings.ExtendMain==1 then GLDG_Data.GuildSettings.ExtendMain=true end
if GLDG_Data.GuildSettings.ExtendAlias==1 then GLDG_Data.GuildSettings.ExtendAlias=true end
if GLDG_Data.GuildSettings.AddPostfix==1 then GLDG_Data.GuildSettings.AddPostfix=true end
if GLDG_Data.GuildSettings.ShowWhoSpam==1 then GLDG_Data.GuildSettings.ShowWhoSpam=true end
if GLDG_Data.GuildSettings.SupressGreet==1 then GLDG_Data.GuildSettings.SupressGreet=true end
if GLDG_Data.GuildSettings.SupressJoin==1 then GLDG_Data.GuildSettings.SupressJoin=true end
if GLDG_Data.GuildSettings.SupressLevel==1 then GLDG_Data.GuildSettings.SupressLevel=true end
if GLDG_Data.GuildSettings.SupressRank==1 then GLDG_Data.GuildSettings.SupressRank=true end
if GLDG_Data.GuildSettings.SupressAchievment==1 then GLDG_Data.GuildSettings.SupressAchievment=true end
if GLDG_Data.GuildSettings.NoGratsOnLogin==1 then GLDG_Data.GuildSettings.NoGratsOnLogin=true end
if GLDG_Data.GuildSettings.DeltaPopup==1 then GLDG_Data.GuildSettings.DeltaPopup=true end
if GLDG_Data.GuildSettings.RelogTime==1 then GLDG_Data.GuildSettings.RelogTime=true end
if GLDG_Data.GuildSettings.MinLevelUp==1 then GLDG_Data.GuildSettings.MinLevelUp=true end
if GLDG_Data.GuildSettings.UseGuildDefault==1 then GLDG_Data.GuildSettings.UseGuildDefault=true end
-- convert for API 6.0.2 end
if not GLDG_Data.GreetGuild then GLDG_Data.GreetGuild = {} end
if not GLDG_Data.GreetChannel then GLDG_Data.GreetChannel = {} end
if not GLDG_Data.AutoGreet then GLDG_Data.AutoGreet = {} end
if not GLDG_Data.GuildSettings.SupressGreet then GLDG_Data.GuildSettings.SupressGreet = false end
if not GLDG_Data.GuildSettings.SupressJoin then GLDG_Data.GuildSettings.SupressJoin = false end
if not GLDG_Data.GuildSettings.SupressLevel then GLDG_Data.GuildSettings.SupressLevel = false end
if not GLDG_Data.GuildSettings.SupressRank then GLDG_Data.GuildSettings.SupressRank = false end
if not GLDG_Data.GuildSettings.SupressAchievment then GLDG_Data.GuildSettings.SupressAchievment = false end
if not GLDG_Data.GuildSettings.NoGratsOnLogin then GLDG_Data.GuildSettings.NoGratsOnLogin = false end
if not GLDG_Data.UseLocalTime then GLDG_Data.UseLocalTime = false end
if not GLDG_Data.ShowNewerVersions then GLDG_Data.ShowNewerVersions = false end
if not GLDG_Data.AutoWho then GLDG_Data.AutoWho = false end
if not GLDG_Data.GuildSettings.DeltaPopup then GLDG_Data.GuildSettings.DeltaPopup = false end
if not GLDG_Data.ExtendPlayerMenu then GLDG_Data.ExtendPlayerMenu = false end
-- convert for API 6.0.2 begin
if GLDG_Data.GuildSettings.SupressGreet==1 then GLDG_Data.GuildSettings.SupressGreet = true end
if GLDG_Data.GuildSettings.SupressJoin==1 then GLDG_Data.GuildSettings.SupressJoin = true end
if GLDG_Data.GuildSettings.SupressLevel==1 then GLDG_Data.GuildSettings.SupressLevel = true end
if GLDG_Data.GuildSettings.SupressRank==1 then GLDG_Data.GuildSettings.SupressRank = true end
if GLDG_Data.GuildSettings.SupressAchievment==1 then GLDG_Data.GuildSettings.SupressAchievment = true end
if GLDG_Data.GuildSettings.NoGratsOnLogin==1 then GLDG_Data.GuildSettings.NoGratsOnLogin = true end
if GLDG_Data.UseLocalTime==1 then GLDG_Data.UseLocalTime = true end
if GLDG_Data.ShowNewerVersions==1 then GLDG_Data.ShowNewerVersions = true end
if GLDG_Data.AutoWho==1 then GLDG_Data.AutoWho = true end
if GLDG_Data.GuildSettings.DeltaPopup==1 then GLDG_Data.GuildSettings.DeltaPopup = true end
if GLDG_Data.ExtendPlayerMenu==1 then GLDG_Data.ExtendPlayerMenu = true end
-- convert for API 6.0.2 end
if not GLDG_Data.GuildFilter or GLDG_Data.GuildFilter==nil or GLDG_Data.GuildFilter==1 or GLDG_Data.GuildFilter==true then GLDG_Data.GuildFilter = "" end
if not GLDG_Data.RankFilter then GLDG_Data.RankFilter = "" end
GLDG_Data.FilterGuild = false
GLDG_Data.GuildSort = false
if not GLDG_Data.ShowIgnore then GLDG_Data.ShowIgnore = false end
if not GLDG_Data.ShowAlt then GLDG_Data.ShowAlt = false end
if not GLDG_Data.GroupAlt then GLDG_Data.GroupAlt = false end
if not GLDG_Data.FilterUnassigned then GLDG_Data.FilterUnassigned = false end
if not GLDG_Data.FilterOnline then GLDG_Data.FilterOnline = false end
if not GLDG_Data.FilterMyFriends then GLDG_Data.FilterMyFriends = false end
if not GLDG_Data.FilterWithFriends then GLDG_Data.FilterWithFriends = false end
if not GLDG_Data.FilterCurrentChannel then GLDG_Data.FilterCurrentChannel = false end
if not GLDG_Data.FilterWithChannel then GLDG_Data.FilterWithChannel = false end
if GLDG_Data.WARRIORFilter == nil then GLDG_Data.WARRIORFilter = true end
if GLDG_Data.DEATHKNIGHTFilter == nil then GLDG_Data.DEATHKNIGHTFilter = true end
if GLDG_Data.DRUIDFilter == nil then GLDG_Data.DRUIDFilter = true end
if GLDG_Data.HUNTERFilter == nil then GLDG_Data.HUNTERFilter = true end
if GLDG_Data.MAGEFilter == nil then GLDG_Data.MAGEFilter = true end
if GLDG_Data.PALADINFilter == nil then GLDG_Data.PALADINFilter = true end
if GLDG_Data.PRIESTFilter == nil then GLDG_Data.PRIESTFilter = true end
if GLDG_Data.ROGUEFilter == nil then GLDG_Data.ROGUEFilter = true end
if GLDG_Data.SHAMANFilter == nil then GLDG_Data.SHAMANFilter = true end
if GLDG_Data.DEMONHUNTERFilter == nil then GLDG_Data.DEMONHUNTERFilter = true end
if GLDG_Data.WARLOCKFilter == nil then GLDG_Data.WARLOCKFilter = true end
if GLDG_Data.MONKFilter == nil then GLDG_Data.MONKFilter = true end
if GLDG_Data.EVOKERFilter == nil then GLDG_Data.EVOKERFilter = true end
if GLDG_Data.ShowIgnore == 1 then GLDG_Data.ShowIgnore = true end
if GLDG_Data.ShowAlt == 1 then GLDG_Data.ShowAlt = true end
if GLDG_Data.GroupAlt == 1 then GLDG_Data.GroupAlt = true end
if GLDG_Data.FilterUnassigned == 1 then GLDG_Data.FilterUnassigned = true end
if GLDG_Data.FilterOnline == 1 then GLDG_Data.FilterOnline = true end
if GLDG_Data.FilterMyFriends == 1 then GLDG_Data.FilterMyFriends = true end
if GLDG_Data.FilterWithFriends == 1 then GLDG_Data.FilterWithFriends = true end
if GLDG_Data.FilterCurrentChannel == 1 then GLDG_Data.FilterCurrentChannel = true end
if GLDG_Data.FilterWithChannel == 1 then GLDG_Data.FilterWithChannel = true end
if not GLDG_Data.colours then GLDG_Data.colours = {} end
if not GLDG_Data.colours.guild then GLDG_Data.colours.guild = {} end
if not GLDG_Data.colours.friends then GLDG_Data.colours.friends = {} end
if not GLDG_Data.colours.channel then GLDG_Data.colours.channel = {} end
if not GLDG_Data.colours.help then GLDG_Data.colours.help = GLDG_DEFAULT_HELP_COLOUR end
if not GLDG_Data.colours.header then GLDG_Data.colours.header = GLDG_DEFAULT_HEADER_COLOUR end
if not GLDG_Data.colours.guild.online then GLDG_Data.colours.guild.online = GLDG_DEFAULT_ONLINE_COLOUR end
if not GLDG_Data.colours.guild.isOff then GLDG_Data.colours.guild.isOff = GLDG_DEFAULT_IS_OFFLINE_COLOUR end
if not GLDG_Data.colours.guild.goOff then GLDG_Data.colours.guild.goOff = GLDG_DEFAULT_GOES_OFFLINE_COLOUR end
if not GLDG_Data.colours.guild.alias then GLDG_Data.colours.guild.alias = GLDG_DEFAULT_ALIAS_COLOUR end
if not GLDG_Data.colours.guild.list then GLDG_Data.colours.guild.list = GLDG_DEFAULT_LIST_COLOUR end
if not GLDG_Data.colours.guild.new then GLDG_Data.colours.guild.new = GLDG_DEFAULT_NEW_COLOUR end
if not GLDG_Data.colours.guild.lvl then GLDG_Data.colours.guild.lvl = GLDG_DEFAULT_LVL_COLOUR end
if not GLDG_Data.colours.guild.rank then GLDG_Data.colours.guild.rank = GLDG_DEFAULT_RANK_COLOUR end
if not GLDG_Data.colours.guild.relog then GLDG_Data.colours.guild.relog = GLDG_DEFAULT_RELOG_COLOUR end
if not GLDG_Data.colours.guild.achievment then GLDG_Data.colours.guild.achievment = GLDG_DEFAULT_ACHIEVMENT_COLOUR end
if not GLDG_Data.colours.friends.online then GLDG_Data.colours.friends.online = GLDG_DEFAULT_ONLINE_COLOUR end
if not GLDG_Data.colours.friends.isOff then GLDG_Data.colours.friends.isOff = GLDG_DEFAULT_IS_OFFLINE_COLOUR end
if not GLDG_Data.colours.friends.goOff then GLDG_Data.colours.friends.goOff = GLDG_DEFAULT_GOES_OFFLINE_COLOUR end
if not GLDG_Data.colours.friends.alias then GLDG_Data.colours.friends.alias = GLDG_DEFAULT_ALIAS_COLOUR end
if not GLDG_Data.colours.friends.list then GLDG_Data.colours.friends.list = GLDG_DEFAULT_LIST_COLOUR end
if not GLDG_Data.colours.friends.new then GLDG_Data.colours.friends.new = GLDG_DEFAULT_NEW_COLOUR end
if not GLDG_Data.colours.friends.lvl then GLDG_Data.colours.friends.lvl = GLDG_DEFAULT_LVL_COLOUR end
if not GLDG_Data.colours.friends.rank then GLDG_Data.colours.friends.rank = GLDG_DEFAULT_RANK_COLOUR end
if not GLDG_Data.colours.friends.relog then GLDG_Data.colours.friends.relog = GLDG_DEFAULT_RELOG_COLOUR end
if not GLDG_Data.colours.friends.achievment then GLDG_Data.colours.friends.achievment = GLDG_DEFAULT_ACHIEVMENT_COLOUR end
if not GLDG_Data.colours.channel.online then GLDG_Data.colours.channel.online = GLDG_DEFAULT_ONLINE_COLOUR end
if not GLDG_Data.colours.channel.isOff then GLDG_Data.colours.channel.isOff = GLDG_DEFAULT_IS_OFFLINE_COLOUR end
if not GLDG_Data.colours.channel.goOff then GLDG_Data.colours.channel.goOff = GLDG_DEFAULT_GOES_OFFLINE_COLOUR end
if not GLDG_Data.colours.channel.alias then GLDG_Data.colours.channel.alias = GLDG_DEFAULT_ALIAS_COLOUR end
if not GLDG_Data.colours.channel.list then GLDG_Data.colours.channel.list = GLDG_DEFAULT_LIST_COLOUR end
if not GLDG_Data.colours.channel.new then GLDG_Data.colours.channel.new = GLDG_DEFAULT_NEW_COLOUR end
if not GLDG_Data.colours.channel.lvl then GLDG_Data.colours.channel.lvl = GLDG_DEFAULT_LVL_COLOUR end
if not GLDG_Data.colours.channel.rank then GLDG_Data.colours.channel.rank = GLDG_DEFAULT_RANK_COLOUR end
if not GLDG_Data.colours.channel.relog then GLDG_Data.colours.channel.relog = GLDG_DEFAULT_RELOG_COLOUR end
if not GLDG_Data.colours.channel.achievment then GLDG_Data.colours.channel.achievment = GLDG_DEFAULT_ACHIEVMENT_COLOUR end
-- Set initial pointers to avoid errors (hack!)
GLDG_DataChar = {}
GLDG_DataGreet = {}
GLDG_ChannelName = ""
-- Keep version in configuration file
-- GLDG_Data.Version = GDLG_VNMBR
-- Prepare popup dialogs
GLDG_PrepareReloadQuestion()
GLDG_PrepareAlertQuestion()
-- Initialize the list GUI
_G[GLDG_LIST.."TitleText"]:SetText(GLDG_NAME.." "..version)
-- Initialize the config GUI
_G[GLDG_GUI.."Title"]:SetText(GLDG_NAME.." "..version)
-- Initialize the colour picker frame
_G[GLDG_COLOUR.."RedText"]:SetText(L["Red"])
_G[GLDG_COLOUR.."GreenText"]:SetText(L["Green"])
_G[GLDG_COLOUR.."BlueText"]:SetText(L["Blue"])
_G[GLDG_COLOUR.."OpacityText"]:SetText(L["Opacity"])
-- Make GUI close on escape
tinsert(UISpecialFrames, GLDG_GUI)
-- Initialize tabs and set the first one active
local frame = _G[GLDG_GUI]
PanelTemplates_SetNumTabs(frame, GLDG_TableSize(GLDG_Tab2Frame))
PanelTemplates_SetTab(frame, 1)
-- Set tab names and initialize tabframes
for tabNum = 1, GLDG_TableSize(GLDG_Tab2Frame) do
local tab = _G[GLDG_GUI.."Tab"..tabNum]
local frameName = GLDG_Tab2Frame["Tab"..tabNum]
if frameName then
local label = L["Tab"..frameName]
if label then
-- tab has label: initialize frame
tab:SetText(label)
tab:Show()
GLDG_InitFrame(frameName)
end
end
end
-- Initialize subtabs and set the first one active
local frame = _G[GLDG_GUI.."Settings"]
PanelTemplates_SetNumTabs(frame, GLDG_TableSize(GLDG_SubTab2Frame))
PanelTemplates_SetTab(frame, 1)
-- Set subtab names and initialize tabframes
for tabNum = 1, GLDG_TableSize(GLDG_SubTab2Frame) do
local tab = _G[GLDG_GUI.."SettingsTab"..tabNum]
local subFrame = GLDG_SubTab2Frame["Tab"..tabNum]
local frameName = "Settings"..subFrame
if frameName then
local label = L["SubTab"..subFrame]
if label then
-- tab has label: initialize frame
tab:SetText(label)
tab:Show()
GLDG_InitFrame(frameName)
end
end
end
-- initialize the option frame
_G["GuildGreetOptionsHeader"]:SetText(L["optionHeader"])
GLDG_InitComplete = true
GLDG_InitCheck = 0
--GLDG_Print("InitCheck is ["..tostring(GLDG_InitCheck).."]")
end
------------------------------------------------------------
function GLDG_InitFrame(frameName)
-- Set full name for frame
local name = GLDG_GUI..frameName
-- Configure the frames
if (frameName == "Settings") then
-- nothing to set
elseif (frameName == "Greetings") then
_G[name.."Header"]:SetText(L["Manage the messages you want to use for greeting"])
_G[name.."CollectHeader"]:SetText(L["Custom collections"])
_G[name.."ColRealm"]:SetText(L["Set realm collection"])
_G[name.."ColGuild"]:SetText(L["Set guild collection"])
_G[name.."ColPlayer"]:SetText(L["Set character collection"])
_G[name.."SubCustomHeader"]:SetText(L["Current value"])
_G[name.."SubNewHeader"]:SetText(L["Create new collection"])
_G[name.."SubNewAdd"]:SetText(L["add"])
_G[name.."SubNewCancel"]:SetText(L["cancel"])
_G[name.."SubChangeSelection"]:SetText(L["Selected collection"])
_G[name.."SubChangeGlobal"]:SetText(L["Global defaults"])
_G[name.."SubChangeClear"]:SetText(L["not defined"])
_G[name.."SubChangeCancel"]:SetText(L["cancel"])
_G[name.."SelDefault"]:SetText(L["coming online"])
_G[name.."SelRelog"]:SetText(L["relogging"])
_G[name.."SelJoin"]:SetText(L["joining guild"])
_G[name.."SelRank"]:SetText(L["promotion"])
_G[name.."SelLevel"]:SetText(L["leveling"])
_G[name.."SelBye"]:SetText(L["bye char"])
_G[name.."SelNight"]:SetText(L["night char"])
_G[name.."SelGuild"]:SetText(L["greet guild"])
_G[name.."SelChannel"]:SetText(L["greet channel"])
_G[name.."SelByeGuild"]:SetText(L["bye guild"])
_G[name.."SelNightGuild"]:SetText(L["night guild"])
_G[name.."SelByeChannel"]:SetText(L["bye channel"])
_G[name.."SelNightChannel"]:SetText(L["night channel"])
_G[name.."SelLaterGuild"]:SetText(L["later guildl"])
_G[name.."SelLaterChannel"]:SetText(L["later channel"])
_G[name.."SelAchievment"]:SetText(L["achievment"])
elseif (frameName == "Players") then
-- Header and option texts
_G[name.."Header"]:SetText(L["Configure settings for characters: ignore them, set main/alt and enter alias"])
_G[name.."IgnoreText"]:SetText(L["Include ignored players in the list"])
_G[name.."AltText"]:SetText(L["Always show alts"])
_G[name.."Alt2Text"]:SetText(L["Keep with main"])
_G[name.."UnassignedText"]:SetText(L["Show only unassigned characters"])
_G[name.."OnlineText"]:SetText(L["Online only"])
_G[name.."MyFriendsText"]:SetText(L["My friends only"])
_G[name.."WithFriendsText"]:SetText(L["With friends only"])
_G[name.."CurrentChannelText"]:SetText(L["Current channel only"])
_G[name.."WithChannelText"]:SetText(GL["With channel only"])
_G[name.."WARRIORFilterText"]:SetText(LOCALIZED_CLASS_NAMES_MALE["WARRIOR"])
_G[name.."DEATHKNIGHTFilterText"]:SetText(LOCALIZED_CLASS_NAMES_MALE["DEATHKNIGHT"])
_G[name.."DRUIDFilterText"]:SetText(LOCALIZED_CLASS_NAMES_MALE["DRUID"])
_G[name.."HUNTERFilterText"]:SetText(LOCALIZED_CLASS_NAMES_MALE["HUNTER"])
_G[name.."MAGEFilterText"]:SetText(LOCALIZED_CLASS_NAMES_MALE["MAGE"])
_G[name.."PALADINFilterText"]:SetText(LOCALIZED_CLASS_NAMES_MALE["PALADIN"])
_G[name.."PRIESTFilterText"]:SetText(LOCALIZED_CLASS_NAMES_MALE["PRIEST"])
_G[name.."ROGUEFilterText"]:SetText(LOCALIZED_CLASS_NAMES_MALE["ROGUE"])
_G[name.."SHAMANFilterText"]:SetText(LOCALIZED_CLASS_NAMES_MALE["SHAMAN"])
_G[name.."DEMONHUNTERFilterText"]:SetText(LOCALIZED_CLASS_NAMES_MALE["DEMONHUNTER"])
_G[name.."WARLOCKFilterText"]:SetText(LOCALIZED_CLASS_NAMES_MALE["WARLOCK"])
_G[name.."MONKFilterText"]:SetText(LOCALIZED_CLASS_NAMES_MALE["MONK"])
_G[name.."EVOKERFilterText"]:SetText(LOCALIZED_CLASS_NAMES_MALE["EVOKER"])
-- list header
_G[name.."HeaderLineName"]:SetText(L["Name"])
_G[name.."HeaderLineType"]:SetText(L["Type"])
_G[name.."HeaderLineAlias"]:SetText(L["Alias/Main"])
_G[name.."HeaderLineGuild"]:SetText(L["Guild"])
_G[name.."HeaderLineRankname"]:SetText(L["Rank"])
_G[name.."HeaderLinePnote"]:SetText(L["Player Note"])
_G[name.."HeaderLineOnote"]:SetText(L["Officer Note"])
_G[name.."HeaderLineChannel"]:SetText(L["{c}"])
_G[name.."HeaderLineFriend"]:SetText(L["{f}"])
_G[name.."HeaderLineNumFriends"]:SetText(L["#"])
-- Button text
_G[name.."ActionButtonsCheck"]:SetText(L["Check consistency"])
_G[name.."ActionButtonsAlias"]:SetText(L["Set alias"])
_G[name.."ActionButtonsGuild"]:SetText(L["Set guild"])
_G[name.."ActionButtonsWho"]:SetText(L["Who query"])
_G[name.."ActionButtonsRemove"]:SetText(L["Remove char"])
_G[name.."ActionButtonsNote"]:SetText(L["Set note"])
_G[name.."ActionButtonsPublicNote"]:SetText(L["Edit public note"])
_G[name.."ActionButtonsOfficerNote"]:SetText(L["Edit officer note"])
-- Set value for option checkboxes
GLDG_UpdatePlayerCheckboxes()
elseif (frameName == "Cleanup") then
-- Header and option texts
_G[name.."Header"]:SetText(L["Data cleanup"])
_G[name.."Info"]:SetText(L["As you switch between characters in different guilds, as you add and remove characters from your friend lists and as characters join and leave channels, a lot of character information assembles. Some of these characters may no longer be played, they may be deleted, renamed or transferred to the opposite faction or other servers.\r\nThis tab helps you to clean up stale characters."])
_G[name.."GuildHeader"]:SetText(L["Guild cleanup"])
_G[name.."GuildInfo"]:SetText(L["This button allows you to choose any guild (except the one you belong to), it will then remove this guild from any character that had it assigned. If it is a guild one of your characters belongs to, this information will automatically be added again for all guild members of that guild."])
_G[name.."FriendsHeader"]:SetText(L["Friends cleanup"])
_G[name.."FriendsInfo"]:SetText(L["This button allows you to choose any of your characters that has managed characters on their friend list and to remove this character from all friend references. If this character still exists, it will again be added automatically to those characters which are on its friend list."])
_G[name.."ChannelHeader"]:SetText(L["Channel cleanup"])
_G[name.."ChannelInfo"]:SetText(L["This button allows you to remove a channel from all characters that belong to it. The next time they revisit the channel, it will again be added to them automatically."])
_G[name.."OrphanHeader"]:SetText(L["Orphan cleanup"])
_G[name.."OrphanInfo"]:SetText(L["This button removes all characters that are not main or alt, have no friends and belong to no channel."])
_G[name.."GuildlessHeader"]:SetText(L["Guildless cleanup"])
_G[name.."GuildlessInfo"]:SetText(L["This button removes all characters that do NOT belong to a Guild."])
_G[name.."DisplayGuildlessHeader"]:SetText(L["Guildless display"])
_G[name.."DisplayGuildlessInfo"]:SetText(L["This button displays all characters that do NOT belong to a Guild and displays final counts for both guildless and with a guild."])
_G[name.."Guild"]:SetText(L["Choose guild to clean up"])
_G[name.."Friends"]:SetText(L["Choose friend to clean up"])
_G[name.."Channel"]:SetText(L["Choose channel to clean up"])
_G[name.."Orphan"]:SetText(L["Cleanup orphans"])
_G[name.."Guildless"]:SetText(L["Cleanup Guildless"])
_G[name.."DisplayGuildless"]:SetText(L["Display Guildless"])
elseif (frameName == "Colour") then
-- Column header
_G[name.."ColHeaderGuild"]:SetText(L["Guild"])
_G[name.."ColHeaderFriends"]:SetText(L["Friends"])
_G[name.."ColHeaderChannel"]:SetText(L["Channel"])
-- Chat header and options
_G[name.."HeaderChat"]:SetText(L["Chat"])
_G[name.."ComingOnline"]:SetText(L["Coming online"])
_G[name.."GoingOffline"]:SetText(L["Going offline"])
_G[name.."IsOffline"]:SetText(L["Is offline"])
_G[name.."Alias"]:SetText(L["Alias"])
-- List header and options
_G[name.."HeaderList"]:SetText(L["Greet list"])
_G[name.."List"]:SetText(L["Coming online"])
_G[name.."Relog"]:SetText(L["Relogging"])
_G[name.."New"]:SetText(L["New member"])
_G[name.."Level"]:SetText(L["Level up"])
_G[name.."Rank"]:SetText(L["Promotion"])
_G[name.."Achievment"]:SetText(L["Achievment"])
-- Common header and options
_G[name.."HeaderCommon"]:SetText(L["Common"])
_G[name.."Help"]:SetText(L["Output"])
_G[name.."Header"]:SetText(L["Greet list header"])
-- Default button
_G[name.."DefaultButton"]:SetText(L["Default colours"])
-- Hide unused colours
_G[name.."FriendsNewButton"]:Hide()
_G[name.."FriendsNewColour"]:Hide()
_G[name.."FriendsRankButton"]:Hide()
_G[name.."FriendsRankColour"]:Hide()
_G[name.."FriendsLevelButton"]:Hide()
_G[name.."FriendsLevelColour"]:Hide()
_G[name.."FriendsAchievmentButton"]:Hide()
_G[name.."FriendsAchievmentColour"]:Hide()
_G[name.."ChannelNewButton"]:Hide()
_G[name.."ChannelNewColour"]:Hide()
_G[name.."ChannelRankButton"]:Hide()
_G[name.."ChannelRankColour"]:Hide()
_G[name.."ChannelLevelButton"]:Hide()
_G[name.."ChannelLevelColour"]:Hide()
_G[name.."ChannelAchievmentButton"]:Hide()
_G[name.."ChannelAchievmentColour"]:Hide()
elseif (frameName == "SettingsGeneral") then
-- Greeting options texts
_G[name.."Header"]:SetText(L["Configuration options to determine who, when and how to greet"])
_G[name.."UseGuildDefaultText"]:SetText(L["Read the guildsettings from the guild info |cFFFF0000You must reload your interface after change this manually!"])
_G[name.."WriteGuildStringText"]:SetText(L["Write the config string"])
_G[name.."WriteGuildString"]:Disable()
_G[name.."GreetAsMainText"]:SetText(L["Greet alts with the same name as main by default"].."*")
_G[name.."RandomizeText"]:SetText(L["Randomly use alias and or main and alt names"].."*")
_G[name.."WhisperText"]:SetText(L["Whisper greetings and grats to players"].."*")
_G[name.."WhisperLevelupText"]:SetText(L["Whisper level up messages"].."*")
_G[name.."IncludeOwnText"]:SetText(L["Display your own characters"].."*")
_G[name.."AutoAssignText"]:SetText(L["Automatically assign main/alt based on guild note"].."*")
_G[name.."AutoAssignEgpText"]:SetText(L["(include EGP officer notes)"].."*")
_G[name.."AutoAssignAliasText"]:SetText(L["(Automatically assign Alias)"].."*")
_G[name.."UseFriendsText"]:SetText(L["Manage friend's list"])
_G[name.."ChannelNameText"]:SetText(L["Channel name to monitor"])
-- Queued greetings list texts
_G[name.."ListHeader"]:SetText(L["Configuration options for displaying the players waiting for a greeting"])
_G[name.."ListdirectText"]:SetText(L["List grows upwards instead of downwards"])
_G[name.."ListheaderText"]:SetText(L["List header is always visible"])
-- Set value for checkboxes
_G[name.."UseGuildDefaultBox"]:SetChecked(GLDG_Data.GuildSettings.UseGuildDefault)
_G[name.."GreetAsMainBox"]:SetChecked(GLDG_Data.GuildSettings.GreetAsMain)
_G[name.."RandomizeBox"]:SetChecked(GLDG_Data.GuildSettings.Randomize)
_G[name.."WhisperBox"]:SetChecked(GLDG_Data.GuildSettings.Whisper)
_G[name.."WhisperLevelupBox"]:SetChecked(GLDG_Data.GuildSettings.WhisperLevelup)
_G[name.."IncludeOwnBox"]:SetChecked(GLDG_Data.GuildSettings.IncludeOwn)
_G[name.."AutoAssignBox"]:SetChecked(GLDG_Data.GuildSettings.AutoAssign)
_G[name.."AutoAssignEgpBox"]:SetChecked(GLDG_Data.GuildSettings.AutoAssignEgp)
_G[name.."AutoAssignAliasBox"]:SetChecked(GLDG_Data.GuildSettings.AutoAssignAlias)
_G[name.."UseFriendsBox"]:SetChecked(GLDG_Data.UseFriends)
_G[name.."ListdirectBox"]:SetChecked(GLDG_Data.ListUp)
_G[name.."ListheaderBox"]:SetChecked(GLDG_Data.ListVisible)
-- Set values for Relog and Listsize sliders
_G[name.."RelogSlider"]:SetValue(GLDG_Data.GuildSettings.RelogTime)
_G[name.."MinLevelUpSlider"]:SetValue(GLDG_Data.GuildSettings.MinLevelUp)
-- _G[name.."UpdateTimeSlider"]:SetValue(GLDG_Data.UpdateTime/10)
_G[name.."ListsizeSlider"]:SetValue(GLDG_Data.ListSize)
elseif (frameName == "SettingsChat") then
-- List settings
_G[name.."Header"]:SetText(L["Printing information to chat"])
_G[name.."ChatFrameSlider"]:SetValue(GLDG_Data.PlayerChatFrame[GLDG_Player.."-"..GLDG_Realm])
_G[name.."ListNamesBox"]:SetChecked(GLDG_Data.GuildSettings.ListNames)
_G[name.."ListNamesOffBox"]:SetChecked(GLDG_Data.GuildSettings.ListNamesOff)
_G[name.."ListLevelUpBox"]:SetChecked(GLDG_Data.GuildSettings.ListLevelUp)
_G[name.."ListLevelUpOffBox"]:SetChecked(GLDG_Data.GuildSettings.ListLevelUpOff)
_G[name.."ListQuitBox"]:SetChecked(GLDG_Data.GuildSettings.ListQuit)
_G[name.."ExtendChatBox"]:SetChecked(GLDG_Data.GuildSettings.ExtendChat)
_G[name.."ExtendIgnoredBox"]:SetChecked(GLDG_Data.GuildSettings.ExtendIgnored)
_G[name.."ExtendAliasBox"]:SetChecked(GLDG_Data.GuildSettings.ExtendAlias)
_G[name.."ExtendMainBox"]:SetChecked(GLDG_Data.GuildSettings.ExtendMain)
_G[name.."ListNamesText"]:SetText(L["List alt and main names when player logs in"].."*")
_G[name.."ListNamesOffText"]:SetText(L["List alt and main names when player logs off"].."*")
_G[name.."ListLevelUpText"]:SetText(L["List to chat when a player levels up (online only)"].."*")
_G[name.."ListLevelUpOffText"]:SetText(L["List to chat when a player levels up (offline players, printed when you log in)"].."*")
_G[name.."ListQuitText"]:SetText(L["List to chat when a player leaves the guild"].."*")
_G[name.."ExtendChatText"]:SetText(L["Add main name to chat when an alt sends a message"].."*")
_G[name.."ExtendIgnoredText"]:SetText(L["Add main name to chat when an alt sends a message, even if alt is ignored"].."*")
_G[name.."ExtendAliasText"]:SetText(L["Add main's alias to chat (if it exists and the above option is enabled)"].."*")
_G[name.."ExtendMainText"]:SetText(L["Even re-add main name for main char (if the above option is enabled)"].."*")
_G[name.."AddPostfixText"]:SetText(L["Show source of character info in curly braces when printing names to chat"].."*")
_G[name.."AddPostfixBox"]:SetChecked(GLDG_Data.GuildSettings.AddPostfix)
_G[name.."ShowWhoSpamText"]:SetText(L["Show /who request and response text in chat"].."*")
_G[name.."ShowWhoSpamBox"]:SetChecked(GLDG_Data.GuildSettings.ShowWhoSpam)
_G[name.."ListAchievmentsText"]:SetText(L["Show achievments of guild members with main/alt in chat"].."*")
_G[name.."ListAchievmentsBox"]:SetChecked(GLDG_Data.GuildSettings.ListAchievments)
elseif (frameName == "SettingsGreeting") then
-- header
_G[name.."Header"]:SetText(L["Greeting the guild and channel (per character setting)"])
_G[name.."SubHeader"]:SetText(L["Temporarily suppress greeting players"])
-- greet options
_G[name.."GreetGuildBox"]:SetChecked(GLDG_Data.GreetGuild[GLDG_Realm.." - "..GLDG_Player])
_G[name.."GreetChannelBox"]:SetChecked(GLDG_Data.GreetChannel[GLDG_Realm.." - "..GLDG_Player])
_G[name.."AutoGreetBox"]:SetChecked(GLDG_Data.AutoGreet[GLDG_Realm.." - "..GLDG_Player])
_G[name.."GreetGuildText"]:SetText(L["Greet guild when 'Greet Key' is pressed (also applies to saying bye)"])
_G[name.."GreetChannelText"]:SetText(L["Greet channel when 'Greet Key' is pressed (also applies to saying bye)"])
_G[name.."AutoGreetText"]:SetText(L["Automatically greet guild and/or channel when logging in (depends on settings above). |cFFFF0000Use carefully (see tooltip)."])
-- suppress options
GLDG_UpdateSupressed()
_G[name.."SupressAll"]:SetText(L["Supress all"])
_G[name.."SupressNone"]:SetText(L["Supress none"])