-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathtest.lua
1651 lines (1553 loc) · 72.3 KB
/
test.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
local _, private = ...
--[[ Lua Globals ]]
-- luacheck: globals next table unpack random
if private.Aurora then
private.isDev = true
end
local commands = private.commands
local function CopyTable(oldTable)
local newTable = {}
for k, v in next, oldTable do
newTable[k] = v
end
return newTable
end
local function GetItem(itemID, isCurrency)
local data = {
id = itemID,
isCurrency = isCurrency,
}
if not isCurrency then
local item = _G.Item:CreateFromItemID(itemID)
item:ContinueOnItemLoad(function(...)
local itemName, itemLink, itemRarity, _, _, _, _, itemStackCount, _, itemIcon, _, itemClassID = _G.GetItemInfo(itemID)
data.link = itemLink
data.name = itemName
data.texture = itemIcon
data.quality = itemRarity
data.locked = false
data.count = random(1, itemStackCount)
data.isQuestItem = itemClassID == _G.LE_ITEM_CLASS_QUESTITEM
data.isQuestActive = data.isQuestItem and (itemID % 2) == 1
end)
end
return data
end
local function GetBoolen()
return random(1, 10) > 5
end
local testItem = GetItem(14551)
local GetDungeonTypeIDs, GetDungeonTypeID, SetDungeonTypeID
local GetDungeonSubTypeIDs, GetDungeonSubTypeID, SetDungeonSubTypeID
local SetHasResponded, GetDungeonID
local function LoadLFGFunctions()
if private.isClassic then return end
local dungeonId, hasResponded, totalEncounters, completedEncounters, numMembers = 1778, true, 4, 2, 5
local icon = [[Interface\Icons\Achievement_Dungeon_TolDagor]]
local lfgBG = [[Interface\LFGFrame\UI-LFG-BACKGROUND-TolDagor]]
local typeIDs, typeID = {
"TYPEID_DUNGEON",
"TYPEID_RANDOM_DUNGEON",
}, 1
local subTypeIDs, subTypeID = {
"LFG_SUBTYPEID_DUNGEON",
"LFG_SUBTYPEID_HEROIC",
"LFG_SUBTYPEID_RAID",
"LFG_SUBTYPEID_SCENARIO",
"LFG_SUBTYPEID_FLEXRAID",
"LFG_SUBTYPEID_WORLDPVP",
}, 1
-- Overrides --
function _G.GetLFGCompletionReward()
return subTypeIDs[subTypeID], typeID, subTypeID, icon, 10, 2, 10, 3, 4, 3
end
function _G.GetLFGDungeonRewards()
return false, 123, typeID, 456, subTypeIDs[subTypeID], 1
end
function _G.GetLFGProposalEncounter(index)
return "Boss "..index, nil, (index % 2) == 0
end
function _G.GetLFGProposal()
return true, dungeonId, typeID, subTypeID, subTypeIDs[subTypeID], lfgBG, "DAMAGER", hasResponded, totalEncounters, completedEncounters, numMembers, true, false, nil, false
end
function _G.GetLFGCompletionRewardItem(rewardIndex)
-- texture, quantity, isBonus, bonusQuantity, name, quality, id, objectType
return testItem.texture, 1, false, 1, testItem.name, 4, testItem.id, "item"
end
function _G.GetLFGCompletionRewardItemLink(rewardIndex)
return testItem.link
end
local members = {
{role = "TANK", responded = true, accepted = false},
{role = "HEALER", responded = true, accepted = true},
{role = "DAMAGER", responded = false, accepted = false},
{role = "DAMAGER", responded = false, accepted = true},
{role = "DAMAGER", responded = true, accepted = true},
}
function _G.GetLFGProposalMember(index)
local member = members[index]
return false, member.role, 1, member.responded, member.accepted, "Name"
end
local LfgSearchResultData = {
searchResultID = dungeonId,
activityID = dungeonId,
leaderName = "leaderName",
name = subTypeIDs[subTypeID],
comment = "comment",
voiceChat = "voiceChat",
requiredItemLevel = 123,
requiredHonorLevel = 456,
numMembers = numMembers,
numBNetFriends = 2,
numCharFriends = 1,
numGuildMates = 3,
isDelisted = false,
autoAccept = true,
age = 0,
questID = 65143,
}
function _G.C_LFGList.GetSearchResultInfo(searchResultID)
LfgSearchResultData.name = subTypeIDs[subTypeID]
local info = CopyTable(LfgSearchResultData)
return info
end
function _G.C_LFGList.GetApplicationInfo(searchResultID)
return dungeonId, "invited", nil, nil, "TANK"
end
function _G.C_Scenario.GetInfo()
-- scenarioName, currentStage, numStages, flags, hasBonusStep, isBonusStepComplete, completed, xp, money
return "LFG_SUBTYPEID_SCENARIO", 1, 3, nil, GetBoolen(), true, GetBoolen(), 123, 456
end
-- Accessors --
function GetDungeonTypeIDs()
return typeIDs
end
function GetDungeonTypeID()
return typeID
end
function SetDungeonTypeID(info, value)
typeID = value
end
function GetDungeonSubTypeIDs()
return subTypeIDs
end
function GetDungeonSubTypeID()
return subTypeID
end
function SetDungeonSubTypeID(info, value)
subTypeID = value
end
function SetHasResponded(value)
hasResponded = value
end
function GetDungeonID()
return dungeonId
end
end
local test, container
function commands.test()
local Aurora = _G.Aurora
local Base, Skin, Color
if Aurora then
Base = Aurora.Base
Skin = Aurora.Skin
Color = Aurora.Color
Aurora.isDev = true
end
LoadLFGFunctions()
local AceConfig = _G.LibStub("AceConfig-3.0", true)
if AceConfig then
if not test then
container = _G.LibStub("AceGUI-3.0"):Create("Frame")
local optionsFrame = container.frame
test = {
type = "group",
args = {}
}
do -- Alert Frames
test.args.alert = {
name = "Alert Frames",
type = "group",
args = {
}
}
local alertArgs = test.args.alert.args
if private.isRetail then -- achievementAlerts
local guild, toon = 4989, 7520
local achievementID, isGuild, isEarned = toon, false, false
alertArgs.achievementAlerts = {
name = "Achievement Alerts",
type = "group",
args = {
isGuild = {
name = "Guild Achievement",
type = "toggle",
get = function() return isGuild end,
set = function(info, value)
isGuild = value
if isGuild then
achievementID = guild
else
achievementID = toon
end
end,
order = 10,
},
isEarned = {
name = "Already Earned",
type = "toggle",
get = function() return isEarned end,
set = function(info, value)
isEarned = value
end,
order = 10,
},
achievementGet = {
name = "Achievement",
desc = "AchievementAlertSystem",
type = "execute",
func = function()
if not _G.AchievementFrame then _G.UIParentLoadAddOn("Blizzard_AchievementUI") end
_G.AchievementAlertSystem:AddAlert(achievementID, isEarned)
end,
},
achievementCrit = {
name = "Achievement Criteria",
desc = "CriteriaAlertSystem",
type = "execute",
func = function()
if not _G.AchievementFrame then _G.UIParentLoadAddOn("Blizzard_AchievementUI") end
local criteriaString = _G.GetAchievementCriteriaInfo(achievementID, 1)
_G.CriteriaAlertSystem:AddAlert(achievementID, criteriaString)
end,
},
},
}
end
if private.isRetail then -- lfgAlerts
alertArgs.lfgAlerts = {
name = "LFG Alerts",
type = "group",
args = {
subTypeID = {
name = "subTypeID",
type = "select",
values = GetDungeonSubTypeIDs,
get = GetDungeonSubTypeID,
set = SetDungeonSubTypeID,
order = 1,
},
scenario = {
name = "Scenario",
desc = "ScenarioAlertSystem",
type = "execute",
func = function()
SetDungeonSubTypeID(nil, _G.LFG_SUBTYPEID_SCENARIO)
_G.ScenarioAlertSystem:AddAlert(_G.AlertFrameMixin:BuildScenarioRewardData())
end,
},
invasion = {
name = "Invasion",
desc = "InvasionAlertSystem",
type = "execute",
func = function()
local rewardQuestID, alertName, showBonusCompletion, xp, money = 45812, "Alert Name", GetBoolen(), 123, 456
_G.InvasionAlertSystem:AddAlert(rewardQuestID, alertName, showBonusCompletion, xp, money)
end,
},
dungeon = {
name = "Dungeon",
desc = "DungeonCompletionAlertSystem",
type = "execute",
func = function()
_G.DungeonCompletionAlertSystem:AddAlert(_G.AlertFrameMixin:BuildLFGRewardData())
end,
},
guildDungeon = {
name = "Guild Dungeon",
desc = "GuildChallengeAlertSystem",
type = "execute",
func = function()
_G.GuildChallengeAlertSystem:AddAlert(1, 2, 5)
end,
},
},
}
end
do -- lootAlerts
-- _G.LootAlertSystem:AddAlert(itemLink, quantity, rollType, roll, specID, isCurrency, showFactionBG, lootSource, lessAwesome, isUpgraded)
-- _G.LootUpgradeAlertSystem:AddAlert(itemLink, quantity, specID, baseQuality)
-- _G.MoneyWonAlertSystem:AddAlert(amount)
local rollType, lootSpec = _G.LOOT_ROLL_TYPE_NEED, 268 --[[ Brewmaster ]]
local currencyID = 823 -- Apexis Crystals
local bonusPrompt, bonusDuration = 244782, 10
local rewardType, rewardQuantity = "item", 1
local bonusResults = {
"item",
"currency",
"money",
"artifact_power",
}
alertArgs.lootAlerts = {
name = "Loot Alerts",
type = "group",
args = {
header1 = {
name = "Items",
type = "header",
order = 0,
},
lootWon = {
name = "Loot Roll Won",
desc = "LootAlertSystem",
type = "execute",
func = function()
_G.LootAlertSystem:AddAlert(testItem.id, 1, rollType, 98, lootSpec)
end,
order = 1,
},
lootWonUpgrade = {
name = "Loot Roll Won (Upgrade)",
desc = "LootAlertSystem",
type = "execute",
func = function()
_G.LootAlertSystem:AddAlert(testItem.id, 1, rollType, 98, lootSpec, nil, nil, nil, nil, true)
end,
order = 1,
},
lootGiven = {
name = "Loot Given",
desc = "LootAlertSystem",
type = "execute",
func = function()
_G.LootAlertSystem:AddAlert(testItem.id, 1, nil, nil, lootSpec, nil, nil, nil, true)
end,
order = 1,
},
lootUpgrade = {
name = "Loot Upgrade",
desc = "LootUpgradeAlertSystem",
type = "execute",
func = function()
_G.LootUpgradeAlertSystem:AddAlert(testItem.id, 1, lootSpec, 3)
end,
order = 1,
},
header2 = {
name = "Bonus Roll",
type = "header",
order = 2,
},
bonusResultType = {
name = "Result Type",
type = "select",
values = bonusResults,
get = function()
for i, resultType in _G.ipairs(bonusResults) do
if resultType == rewardType then
return i
end
end
end,
set = function(info, value)
rewardType = bonusResults[value]
if rewardType == "item" then
rewardQuantity = 1
elseif rewardType == "money" then
rewardQuantity = 123456
elseif rewardType == "artifact_power" then
rewardQuantity = 123456
end
end,
order = 3,
},
bonusPrompt = {
name = "Bonus Roll Prompt",
desc = "LootAlertSystem",
type = "execute",
func = function()
_G.BonusRollFrame_StartBonusRoll(bonusPrompt, "Woah! A bonus roll!", bonusDuration, currencyID, 2)
_G.C_Timer.After(bonusDuration, _G.BonusRollFrame_CloseBonusRoll)
end,
order = 3,
},
bonusStart = {
name = "Bonus Roll Start",
desc = "LootAlertSystem",
type = "execute",
func = function()
_G.BonusRollFrame_OnEvent(_G.BonusRollFrame, "BONUS_ROLL_STARTED")
end,
order = 3,
},
bonusResult = {
name = "Bonus Roll Result",
desc = "LootAlertSystem",
type = "execute",
func = function()
_G.BonusRollFrame_OnEvent(_G.BonusRollFrame, "BONUS_ROLL_RESULT", rewardType, testItem.link, rewardQuantity, lootSpec)
end,
order = 3,
},
header3 = {
name = "Currency",
type = "header",
order = 4,
},
lootMoney = {
name = "Loot Money",
desc = "MoneyWonAlertSystem",
type = "execute",
func = function()
_G.MoneyWonAlertSystem:AddAlert(123456)
end,
order = 5,
},
lootCurrency = {
name = "Loot Currency",
desc = "LootAlertSystem",
type = "execute",
func = function()
_G.LootAlertSystem:AddAlert(currencyID, 100, nil, nil, lootSpec, true)
end,
order = 5,
},
lootGarrisonCache = {
name = "Loot Garrison Cache",
desc = "LootAlertSystem",
type = "execute",
func = function()
_G.LootAlertSystem:AddAlert(824, 100, nil, nil, lootSpec, true, nil, 10)
end,
order = 5,
},
honor = {
name = "Loot Honor",
desc = "HonorAwardedAlertSystem",
type = "execute",
func = function()
_G.HonorAwardedAlertSystem:AddAlert(123)
end,
order = 5,
},
header4 = {
name = "Misc",
type = "header",
order = 6,
},
store = {
name = "Store Purchase",
desc = "StorePurchaseAlertSystem",
type = "execute",
func = function()
_G.StorePurchaseAlertSystem:AddAlert(testItem.texture, testItem.name, testItem.id)
end,
order = 7,
},
legendary = {
name = "Legion Legendary",
desc = "LegendaryItemAlertSystem",
type = "execute",
func = function()
_G.LegendaryItemAlertSystem:AddAlert(testItem.id)
end,
order = 7,
},
},
}
end
if private.isRetail then -- garrisonAlerts
local isUpgraded, talentID = false, 370 --[[ Hunter: Long Range ]]
local function hasGarrison()
return _G.C_Garrison.GetLandingPageGarrisonType() > 0
end
local function isDraenorGarrison()
return _G.C_Garrison.GetLandingPageGarrisonType() == _G.LE_GARRISON_TYPE_6_0
end
alertArgs.garrisonAlerts = {
name = "Garrison Alerts",
disabled = not hasGarrison(),
type = "group",
args = {
header1 = {
name = "Followers",
type = "header",
order = 0,
},
isUpgraded = {
name = "Follower is upgraded",
type = "toggle",
get = function() return isUpgraded end,
set = function(info, value)
isUpgraded = value
end,
order = 1,
},
follower = {
name = "Garrison Follower",
desc = "GarrisonFollowerAlertSystem",
type = "execute",
func = function()
local follower = _G.C_Garrison.GetFollowers(_G.LE_FOLLOWER_TYPE_GARRISON_7_0)[1]
_G.GarrisonFollowerAlertSystem:AddAlert(follower.followerID, follower.name, follower.level, follower.quality, isUpgraded, follower)
end,
order = 1,
},
followerShip = {
name = "Garrison Ship Follower",
desc = "GarrisonShipFollowerAlertSystem",
disabled = not isDraenorGarrison(),
type = "execute",
func = function()
local follower = _G.C_Garrison.GetFollowers(_G.LE_FOLLOWER_TYPE_SHIPYARD_6_2)[1]
_G.GarrisonShipFollowerAlertSystem:AddAlert(follower.followerID, follower.name, follower.className, follower.texPrefix, follower.level, follower.quality, isUpgraded, follower)
end,
order = 1,
},
header2 = {
name = "Missions",
type = "header",
order = 2,
},
mission = {
name = "Garrison Mission",
desc = "GarrisonMissionAlertSystem",
type = "execute",
func = function()
local mission = _G.C_Garrison.GetAvailableMissions(_G.LE_FOLLOWER_TYPE_GARRISON_7_0)[1]
_G.GarrisonMissionAlertSystem:AddAlert(mission)
end,
order = 3,
},
missionRandom = {
name = "Garrison Random Mission",
desc = "GarrisonRandomMissionAlertSystem",
type = "execute",
func = function()
local mission = _G.C_Garrison.GetAvailableMissions(_G.LE_FOLLOWER_TYPE_GARRISON_7_0)[1]
_G.GarrisonRandomMissionAlertSystem:AddAlert(mission)
end,
order = 3,
},
missionShip = {
name = "Garrison Ship Mission",
desc = "GarrisonShipMissionAlertSystem",
disabled = not isDraenorGarrison(),
type = "execute",
func = function()
local mission = _G.C_Garrison.GetAvailableMissions(_G.LE_FOLLOWER_TYPE_SHIPYARD_6_2)[1]
_G.GarrisonShipMissionAlertSystem:AddAlert(mission.missionID)
end,
order = 3,
},
header3 = {
name = "Misc",
type = "header",
order = 4,
},
building = {
name = "Garrison Building",
desc = "GarrisonBuildingAlertSystem",
type = "execute",
func = function()
_G.GarrisonBuildingAlertSystem:AddAlert("Barn")
end,
order = 5,
},
talent = {
name = "Garrison Talent",
desc = "GarrisonTalentAlertSystem",
type = "execute",
func = function()
_G.GarrisonTalentAlertSystem:AddAlert(_G.LE_GARRISON_TYPE_7_0, _G.C_Garrison.GetTalent(talentID))
end,
order = 5,
},
},
}
end
do -- bnetAlerts
local toastType, toastInfo = 1
local toastTypes = {
"online",
"offline",
"broadcast",
"pending",
"new",
--"club invite",
--"finder invite",
}
if private.isRetail then
local BNetAccountInfo = {
bnetAccountID = "number",
accountName = "string",
battleTag = "string",
isFriend = GetBoolen(),
isBattleTagFriend = GetBoolen(),
lastOnlineTime = "number",
isAFK = GetBoolen(),
isDND = GetBoolen(),
isFavorite = GetBoolen(),
appearOffline = GetBoolen(),
customMessage = "string",
customMessageTime = "number",
note = "string",
rafLinkType = "RafLinkType",
gameAccountInfo = "BNetGameAccountInfo",
}
function _G.C_BattleNet.GetAccountInfoByID(bnetAccountID, wowAccountGUID)
local info = CopyTable(BNetAccountInfo)
return info
end
end
alertArgs.bnetAlerts = {
name = "Battle.net Alerts",
type = "group",
args = {
toastType = {
name = "Result Type",
type = "select",
values = toastTypes,
get = function() return toastType end,
set = function(info, value)
toastType = value
local _, online = _G.BNGetNumFriends()
if toastTypes[toastType] == "online" then
toastInfo = _G.BNGetFriendInfo(online + 1)
elseif toastTypes[toastType] == "offline" then
toastInfo = _G.BNGetFriendInfo(online + 1)
elseif toastTypes[toastType] == "broadcast" then
toastInfo = _G.BNGetFriendInfo(online + 1)
elseif toastTypes[toastType] == "pending" then
toastInfo = 4
elseif toastTypes[toastType] == "new" then
toastInfo = nil
end
end,
order = 3,
},
toast = {
name = "Battle.net Toast",
desc = "BNToastFrame_Show",
type = "execute",
func = function()
if private.isRetail then
_G.BNToastFrame:AddToast(toastType, toastInfo)
else
_G.BNToastFrame_AddToast(toastType, toastInfo)
end
end,
},
},
}
end
do -- miscAlerts
local recipeID, questID, archRace = 42141 --[[]], 42114 --[[]], 1 --[[ Dwarf ]]
alertArgs.miscAlerts = {
name = "Misc Alerts",
type = "group",
args = {
digsite = {
name = "Digsite Complete",
desc = "DigsiteCompleteAlertSystem",
type = "execute",
func = function()
_G.DigsiteCompleteAlertSystem:AddAlert(archRace)
end,
},
newRecipe = {
name = "New Recipe Learned",
desc = "NewRecipeLearnedAlertSystem",
type = "execute",
func = function()
_G.NewRecipeLearnedAlertSystem:AddAlert(recipeID)
end,
},
worldQuest = {
name = "World Quest Complete",
desc = "WorldQuestCompleteAlertSystem",
type = "execute",
func = function()
_G.WorldQuestCompleteAlertSystem:AddAlert(_G.AlertFrameMixin:BuildQuestData(questID))
end,
},
},
}
end
end
do -- Popup Frames
test.args.popup = {
name = "Popup Frames",
type = "group",
args = {
}
}
local popupArgs = test.args.popup.args
if private.isRetail then -- helpTips
local buttonStyleType do
buttonStyleType = {}
for name, index in next, _G.HelpTip.ButtonStyle do
buttonStyleType[index] = name
end
end
local targetPointType do
targetPointType = {}
for name, index in next, _G.HelpTip.Point do
targetPointType[index] = name
end
end
local alignmentType do
alignmentType = {}
for name, index in next, _G.HelpTip.Alignment do
alignmentType[index] = name
end
end
local textFormat = "%s-%s-%s"
local infoTable = {
text = "text", -- also acts as a key for various API, MUST BE SET
textColor = _G.HIGHLIGHT_FONT_COLOR,
textJustifyH = "LEFT",
buttonStyle = _G.HelpTip.ButtonStyle.None, -- button to close the helptip, or no button at all
targetPoint = _G.HelpTip.Point.TopEdgeCenter, -- where at the parent the helptip should point
alignment = _G.HelpTip.Alignment.Center, -- alignment of the helptip relative to the parent (basically where the arrow is located)
hideArrow = false, -- whether to hide the arrow
offsetX = 0,
offsetY = 0,
}
popupArgs.helpTips = {
name = "Help Tips",
type = "group",
args = {
buttonStyle = {
name = "buttonStyle",
type = "select",
values = buttonStyleType,
get = function()
return infoTable.buttonStyle
end,
set = function(info, value)
infoTable.buttonStyle = value
end,
order = 1,
},
targetPoint = {
name = "targetPoint",
type = "select",
values = targetPointType,
get = function()
return infoTable.targetPoint
end,
set = function(info, value)
infoTable.targetPoint = value
end,
order = 1,
},
alignment = {
name = "alignment",
type = "select",
values = alignmentType,
get = function()
return infoTable.alignment
end,
set = function(info, value)
infoTable.alignment = value
end,
order = 1,
},
helpTip = {
name = "helpTip",
desc = "HelpTip:Show()",
type = "execute",
func = function(self, ...)
local text = textFormat:format(targetPointType[infoTable.targetPoint], alignmentType[infoTable.alignment], buttonStyleType[infoTable.buttonStyle])
if not _G.HelpTip:IsShowing(optionsFrame, text) then
local info = CopyTable(infoTable)
info.text = text
_G.HelpTip:Show(optionsFrame, info)
end
end,
}
}
}
end
do -- staticPopups
local addedFrameType, addedFrame = {
"none",
"hasEditBox",
"hasMoneyFrame",
"hasMoneyInputFrame",
"hasItemFrame",
}, 1
_G.StaticPopupDialogs.TESTPOPUP1 = {
text = "This is the main popup text",
button1 = _G.YES,
button2 = _G.NO,
timeout = 0,
closeButton = true,
hideOnEscape = true,
OnShow = function(self)
if addedFrame == 3 then
_G.MoneyFrame_Update(self.moneyFrame, 123456)
end
end,
}
popupArgs.staticPopups = {
name = "Static Popups",
type = "group",
args = {
closeButtonIsHide = {
name = "closeButtonIsHide",
type = "toggle",
get = function() return _G.StaticPopupDialogs.TESTPOPUP1.closeButtonIsHide end,
set = function(info, value)
_G.StaticPopupDialogs.TESTPOPUP1.closeButtonIsHide = value
end,
order = 1,
},
addedFrame = {
name = "addedFrame",
type = "select",
values = addedFrameType,
get = function()
return addedFrame
end,
set = function(info, value)
addedFrame = value
local popup = _G.StaticPopupDialogs.TESTPOPUP1
-- Blzz assumes these are mutually exclusive, so we put them on the same option
for i, option in next, addedFrameType do
if option ~= "none" then
popup[option] = i == value
end
end
end,
order = 1,
},
subText = {
name = "subText",
type = "toggle",
get = function() return _G.StaticPopupDialogs.TESTPOPUP1.subText end,
set = function(info, value)
_G.StaticPopupDialogs.TESTPOPUP1.subText = value and "Here is some subText"
end,
order = 1,
},
staticPopup = {
name = "staticPopup",
desc = "LFGDungeonReadyDialog",
type = "execute",
func = function()
_G.StaticPopup_Show("TESTPOPUP1", "Text Arg1", "Text Arg2", testItem)
end,
},
},
}
end
if private.isRetail then -- lfgPopups
popupArgs.lfgPopups = {
name = "Group Finder Popups",
type = "group",
args = {
header1 = {
name = "LFG",
type = "header",
order = 0,
},
typeID = {
name = "typeID",
type = "select",
values = GetDungeonTypeIDs,
get = GetDungeonTypeID,
set = SetDungeonTypeID,
order = 1,
},
subTypeID = {
name = "subTypeID",
type = "select",
values = GetDungeonSubTypeIDs,
get = GetDungeonSubTypeID,
set = SetDungeonSubTypeID,
order = 1,
},
proposal = {
name = "LFG Proposal",
desc = "LFGDungeonReadyDialog",
type = "execute",
func = function()
SetHasResponded(false)
if _G.LFGDungeonReadyPopup:IsShown() then
_G.LFGEventFrame_OnEvent(_G.LFGDungeonReadyPopup, "LFG_PROPOSAL_UPDATE")
else
_G.LFGEventFrame_OnEvent(_G.LFGDungeonReadyPopup, "LFG_PROPOSAL_SHOW")
end
end,
order = 2,
},
lfgReadyCheck = {
name = "LFG Ready Check",
desc = "LFGDungeonReadyStatus",
type = "execute",
func = function()
SetHasResponded(true)
if _G.LFGDungeonReadyPopup:IsShown() then
_G.LFGEventFrame_OnEvent(_G.LFGDungeonReadyPopup, "LFG_PROPOSAL_UPDATE")
else
_G.LFGEventFrame_OnEvent(_G.LFGDungeonReadyPopup, "LFG_PROPOSAL_SHOW")
end
end,
order = 2,
},
invite = {
name = "LFG Invite",
desc = "LFGInvitePopup",
type = "execute",
func = function()
_G.LFGInvitePopup.timeOut = 1000000
_G.StaticPopupSpecial_Show(_G.LFGInvitePopup)
end,
order = 3,
},
listApp = {
name = "LFG List Application",
desc = "LFGListApplicationDialog",
type = "execute",
func = function()
_G.LFGListApplicationDialog.timeOut = 1000000
_G.LFGListApplicationDialog_Show(_G.LFGListApplicationDialog, GetDungeonID())
end,
order = 3,
},
listInvite = {
name = "LFG List Invite",
desc = "LFGListInviteDialog",
type = "execute",
func = function()
_G.LFGListInviteDialog.timeOut = 1000000
_G.LFGListInviteDialog_Show(_G.LFGListInviteDialog, GetDungeonID())
end,
order = 3,
},
header2 = {
name = "LFD",
type = "header",
order = 4,
},
lfdRollCheck = {
name = "LFD Roll Check",
desc = "LFDRoleCheckPopup",
type = "execute",
func = function()
_G.LFDFrame_OnEvent(_G.LFDParentFrame, "LFG_ROLE_CHECK_SHOW")
end,
order = 4,
},
lfdReadyCheck = {
name = "LFD Ready Check",
desc = "LFDReadyCheckPopup",
type = "execute",
func = function()
_G.LFDFrame_OnEvent(_G.LFDParentFrame, "LFG_READY_CHECK_SHOW")
end,
order = 4,
},
},
}
end
do -- helpPopups
local ticketStatuses, ticketStatus = {
"LE_TICKET_STATUS_OPEN",
"LE_TICKET_STATUS_SURVEY",
"LE_TICKET_STATUS_NMI",
"LE_TICKET_STATUS_RESPONSE",
}, 1
local hasTicket = true
local event = "UPDATE_WEB_TICKET"
popupArgs.helpPopups = {