-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathFrame.lua
1904 lines (1639 loc) · 66.2 KB
/
Frame.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 _, addon = ...
local L = addon.L
-- MixIns
AstralKeysCharacterMixin = {}
AstralKeysListMixin = {}
-- Red color code
-- #C72329
-- Background
-- Left #000000 ALPHA 0.8
-- Right #212121 ALPHA 0.8
local COLOR_GRAY = 'ff9d9d9d'
local COLOR_BLUE_BNET = 'ff82c5ff'
-- Scroll bar texture alpha settings
local SCROLL_TEXTURE_ALPHA_MIN = 0.25
local SCROLL_TEXTURE_ALPHA_MAX = 0.6
local FRAME_WIDTH_MINIMIZED = 575
local CHARACTER_INFO_FRAME_SIZE = 275
local FRAME_WIDTH_EXPANDED = FRAME_WIDTH_MINIMIZED + CHARACTER_INFO_FRAME_SIZE
local FILTER_FIELDS = {}
FILTER_FIELDS['key_level'] = ''
FILTER_FIELDS['mapID'] = ''
FILTER_FIELDS['character_name'] = ''
local BACKDROPBUTTON = {
bgFile = nil,
edgeFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 16, edgeSize = 1,
insets = {left = 0, right = 0, top = 0, bottom = 0}
}
-- Used for filtering, sorting, and displaying units on lists
local sortTable = {}
sortTable.num_shown = 0
local selectedUnits = {}
local CreateNewTab, UpdateTabs, RemoveTab, tabFrame
local function ClearSelectedUnits()
wipe(selectedUnits)
end
function AstralKeysCharacterMixin:UpdateUnit(characterID)
local unit = addon.CharacterName(characterID)
local realm = addon.CharacterRealm(characterID)
local unitClass = addon.GetCharacterClass(characterID)
local bestKey = addon.GetCharacterBestLevel(characterID)
local currentMapID = addon.GetCharacterMapID(unit .. '-' .. realm)
local currentKeyLevel = addon.GetCharacterKeyLevel(unit .. '-' .. realm)
if addon.CharacterRealm(characterID) ~= addon.PlayerRealm() then
unit = unit .. ' (*)'
end
self.nameString:SetText(WrapTextInColorCode(unit, select(4, GetClassColor(unitClass))))
if bestKey ~= 0 then
self.weeklyStringValue:SetText(bestKey)
else
self.weeklyStringValue:SetText(WrapTextInColorCode(L['CHARACTER_DUNGEON_NOT_RAN'], COLOR_GRAY))
end
if currentMapID then
self.keyStringValue:SetFormattedText('%d %s', currentKeyLevel, addon.GetMapName(currentMapID, true))
else
self.keyStringValue:SetFormattedText('|c%s%s|r', COLOR_GRAY, L['CHARACTER_KEY_NOT_FOUND'])
end
end
function AstralKeysCharacterMixin:OnEnter()
local scrollBar = self:GetParent():GetParent().scrollBar
local scrollButton = _G[scrollBar:GetName() .. 'ThumbTexture']
scrollButton:SetAlpha(SCROLL_TEXTURE_ALPHA_MAX)
end
function AstralKeysCharacterMixin:OnLeave()
local scrollBar = self:GetParent():GetParent().scrollBar
local scrollButton = _G[scrollBar:GetName() .. 'ThumbTexture']
scrollButton:SetAlpha(SCROLL_TEXTURE_ALPHA_MIN)
end
function AstralKeysCharacterMixin:OnLoad()
self.weeklyString:SetText(L['WEEKLY_BEST'])
self.keyString:SetText(L['CURRENT_KEY'])
end
function AstralKeysListMixin:SetUnit(unit, class, mapID, keyLevel, weekly_best, faction, btag)
self.unitID = addon.UnitID(unit)
self.levelString:SetText(keyLevel)
self.dungeonString:SetText(addon.GetMapName(mapID))
self.dungeonString:SetWidth(200)
if weekly_best and weekly_best > 1 then
local color_code = addon.GetDifficultyColour(weekly_best)
self.bestString:SetText(WrapTextInColorCode(weekly_best, color_code))
self.bestString:SetWidth(self.bestString:GetUnboundedStringWidth() + 15)
else
self.bestString:SetText(nil)
end
if addon.FrameListShown() == 'GUILD' then
self.nameString:SetText(WrapTextInColorCode(Ambiguate(unit, 'GUILD'), select(4, GetClassColor(class))))
else
if btag then
if tonumber(faction) == addon.FACTION then
self.nameString:SetText( string.format('%s (%s)', WrapTextInColorCode(btag:sub(1, btag:find('#') - 1), COLOR_BLUE_BNET), WrapTextInColorCode(unit:sub(1, unit:find('-') - 1), select(4, GetClassColor(class)))))
else
self.nameString:SetText( string.format('%s (%s)', WrapTextInColorCode(btag:sub(1, btag:find('#') - 1), COLOR_BLUE_BNET), WrapTextInColorCode(unit:sub(1, unit:find('-') - 1), 'ff9d9d9d')))
end
else
self.nameString:SetText(WrapTextInColorCode(unit:sub(1, unit:find('-') - 1), select(4, GetClassColor(class))))
end
end
if addon.IsUnitOnline(unit) then
self:SetAlpha(1)
else
self:SetAlpha(0.4)
end
end
function AstralKeysListMixin:OnClick(button)
if not IsModifierKeyDown() and button == 'RightButton' then
wipe(selectedUnits)
if AstralMenuFrameUnit1.unit == self.unitID then
ToggleFrame(AstralMenuFrameUnit1)
else
AstralMenuFrameReport1:Hide()
AstralMenuFrameTabs1:Hide()
AstralMenuFrameUnit1:ClearAllPoints()
local uiScale = UIParent:GetScale()
local cursorX, cursorY = GetCursorPosition()
cursorX = cursorX/uiScale
cursorY = cursorY/uiScale
xOffset, yOffset = 20, 0
xOffset = cursorX + xOffset
yOffset = cursorY + yOffset
AstralMenuFrameUnit1:SetUnit(self.unitID)
AstralMenuFrameUnit1:SetTitle(WrapTextInColorCode(addon.UnitName(self.unitID), select(4, GetClassColor(addon.UnitClass(self.unitID)))))
AstralMenuFrameUnit1:SetPoint('TOPLEFT', UIParent, 'BOTTOMLEFT', xOffset, yOffset)
AstralMenuFrameUnit1:Show()
selectedUnits[addon.Unit(self.unitID)] = true
end
elseif IsModifierKeyDown() then
self.Highlight:SetShown(not self.Highlight:IsShown())
if self.Highlight:IsShown() then
selectedUnits[addon.Unit(self.unitID)] = true
else
selectedUnits[addon.Unit(self.unitID)] = nil
end
end
end
function AstralKeysListMixin:OnEnter()
local scrollBar = self:GetParent():GetParent().scrollBar
local scrollButton = _G[scrollBar:GetName() .. 'ThumbTexture']
scrollButton:SetAlpha(SCROLL_TEXTURE_ALPHA_MAX)
end
function AstralKeysListMixin:OnLeave()
local scrollBar = self:GetParent():GetParent().scrollBar
local scrollButton = _G[scrollBar:GetName() .. 'ThumbTexture']
scrollButton:SetAlpha(SCROLL_TEXTURE_ALPHA_MIN)
end
-- Unit dropdown mneu items, whisper and invite
local unitPopup = addon.CreateDropDownFrame('Unit', 1, UIParent)
local subUnitPopup = addon.CreateDropDownFrame('Unit', 2, UIParent)
subUnitPopup:SetTitle(L['LIST'])
unitPopup:SetScript('OnHide', function(self)
wipe(selectedUnits)
self:SetUnit(nil)
local buttons = AstralKeyFrameListContainer.buttons
for _, button in pairs(buttons) do
button.Highlight:Hide()
end
end)
local function Whisper_OnShow(self)
if not addon.IsUnitOnline(addon.Unit(AstralMenuFrameUnit1.unit)) then
self:SetText(WrapTextInColorCode(self:GetText(), 'ff9d9d9d'))
else
self:SetText(L['Whisper'])
end
end
local function SendWhisper()
if not addon.IsUnitOnline(addon.Unit(AstralMenuFrameUnit1.unit)) then return end
if addon.UnitBTag(AstralMenuFrameUnit1.unit) then
ChatFrame_SendBNetTell(addon.FriendPresName(addon.Unit(AstralMenuFrameUnit1.unit)))
else
ChatFrame_SendTell(addon.Unit(AstralMenuFrameUnit1.unit))
end
end
unitPopup:AddButton(L['Whisper'], SendWhisper, Whisper_OnShow)
local function Invite_OnShow(self)
local inviteType = GetDisplayedInviteType(addon.UnitGUID(addon.Unit(AstralMenuFrameUnit1.unit)))
self:SetText(L[inviteType])
self:GetParent():AdjustWidth()
if not addon.IsUnitOnline(addon.Unit(AstralMenuFrameUnit1.unit)) then
self:SetText(WrapTextInColorCode(self:GetText(), 'ff9d9d9d'))
end
self.inviteType = inviteType
end
local function InviteUnit(self)
if not addon.IsUnitOnline(addon.Unit(AstralMenuFrameUnit1.unit)) then return end
if addon.UnitBTag(AstralMenuFrameUnit1.unit) then
if self.inviteType == 'INVITE' then
BNInviteFriend(addon.GetFriendGaID(addon.Unit(AstralMenuFrameUnit1.unit)))
elseif self.inviteType == 'REQUEST_INVITE' then
BNRequestInviteFriend(addon.GetFriendGaID(addon.Unit(AstralMenuFrameUnit1.unit)))
elseif self.inviteType == 'SUGGEST_INVITE' then
BNInviteFriend(addon.GetFriendGaID(addon.Unit(AstralMenuFrameUnit1.unit)))
end
else
if self.inviteType == 'INVITE' then
InviteToGroup(addon.Unit(AstralMenuFrameUnit1.unit))
elseif self.inviteType == 'REQUEST_INVITE' then
RequestInviteFromUnit(addon.Unit(AstralMenuFrameUnit1.unit))
elseif self.inviteType == 'SUGGEST_INVITE' then
InviteToGroup(addon.Unit(AstralMenuFrameUnit1.unit))
end
end
end
unitPopup:AddButton(L['INVITE'],InviteUnit, Invite_OnShow)
local function CreateList_OnEnter(self)
local text = self:GetText()
if text == '' then return end
local list = addon.CreateNewList(text)
CreateNewTab(text, tabFrame)
UpdateTabs()
if list then
for unit in pairs(selectedUnits) do
addon.AddUnitToList(unit, text)
end
end
self:Hide()
self.buttonParent:Show()
unitPopup:Hide()
subUnitPopup:Hide()
AstralMenuFrameTabs1:Hide()
end
local AstralKeyFrame = CreateFrame('FRAME', 'AstralKeyFrame', UIParent)
AstralKeyFrame:SetFrameStrata('DIALOG')
AstralKeyFrame:SetWidth(FRAME_WIDTH_EXPANDED)
AstralKeyFrame:SetHeight(490)
AstralKeyFrame:SetPoint('CENTER', UIParent, 'CENTER')
AstralKeyFrame:EnableMouse(true)
AstralKeyFrame:SetMovable(true)
AstralKeyFrame:RegisterForDrag('LeftButton')
AstralKeyFrame:EnableKeyboard(true)
AstralKeyFrame:SetPropagateKeyboardInput(true)
AstralKeyFrame:SetClampedToScreen(true)
AstralKeyFrame:Hide()
AstralKeyFrame.updateDelay = 0
AstralKeyFrame.background = AstralKeyFrame:CreateTexture(nil, 'BACKGROUND')
AstralKeyFrame.background:SetAllPoints(AstralKeyFrame)
AstralKeyFrame.background:SetColorTexture(0, 0, 0, 0.8)
local createListEditBox = CreateFrame('EditBox', nil, UIParent, "BackdropTemplate")
createListEditBox:SetFrameStrata('TOOLTIP')
createListEditBox:SetFrameLevel(25)
createListEditBox:Hide()
createListEditBox:SetSize(150, 20)
createListEditBox:SetFontObject(InterUIRegular_Normal)
createListEditBox:SetAutoFocus(true)
createListEditBox:SetMaxLetters(50)
createListEditBox:SetBackdrop(BACKDROPBUTTON)
createListEditBox:SetBackdropBorderColor(33/255, 33/255, 33/255, 0.8)
createListEditBox.description = createListEditBox:CreateFontString(nil, 'OVERLAY', 'InterUIMedium_Normal')
createListEditBox.description:SetHeight(20)
createListEditBox.description:SetJustifyH('LEFT')
createListEditBox.description:SetText(L['NEW_LIST_DESCRIPTION'])
createListEditBox.description:SetTextColor(99/255, 99/255, 99/255, 1)
createListEditBox.description:SetPoint('LEFT', createListEditBox, 'LEFT', 3, 0)
createListEditBox.description:Hide()
local createListOkayButton = CreateFrame('BUTTON', nil, createListEditBox, "BackdropTemplate")
createListOkayButton:SetNormalFontObject(InterUIMedium_Normal)
createListOkayButton:SetBackdrop(BACKDROPBUTTON)
createListOkayButton:SetBackdropBorderColor(33/255, 33/255, 33/255, 0.8)
createListOkayButton:SetHeight(20)
createListOkayButton:SetText(L['OKAY'])
createListOkayButton:GetFontString():SetTextColor(198/255, 198/255, 198/255, 1)
createListOkayButton:SetWidth(createListOkayButton:GetFontString():GetUnboundedStringWidth() + 5)
createListOkayButton:SetPoint('LEFT', createListEditBox, 'RIGHT', 5, 0)
createListOkayButton:SetScript('OnClick', function()
CreateList_OnEnter(createListEditBox)
end)
createListEditBox:SetScript('OnTextChanged', function(self)
if not self:GetText() or self:GetText() ~= '' then
self.description:Hide()
else
self.description:Show()
end
end)
createListEditBox:SetScript('OnShow', function(self)
self:SetText('')
self.description:Show()
self.description:SetWidth(self.description:GetUnboundedStringWidth())
self:SetWidth(self.description:GetUnboundedStringWidth() + 5)
end)
createListEditBox:SetScript('OnEscapePressed', function(self)
self:Hide()
self.buttonParent:Show()
self.buttonParent:GetParent():AdjustWidth()
end)
local listHelperText = AstralKeyFrame:CreateFontString('$parentListHelperText', 'OVERLAY', 'InterUIBlack_ExtraLarge')
listHelperText:SetWidth(300)
listHelperText:SetJustifyH('CENTER')
listHelperText:SetPoint('TOP', AstralKeyFrameListContainer, 'TOP', 20, 100)
listHelperText:SetText(L['LIST_ADD_HELPER_TEXT'])
listHelperText:SetTextColor(1, 1, 1, 0.5)
listHelperText:Hide()
createListEditBox:SetScript('OnEnterPressed', CreateList_OnEnter)
local function CreateList(self)
createListEditBox:Hide()
createListEditBox.buttonParent = self
createListEditBox:ClearAllPoints()
createListEditBox:SetPoint('LEFT', self, 'LEFT')
createListEditBox:Show()
self:GetParent():AdjustWidth(math.max(createListEditBox:GetWidth(), createListEditBox.description:GetUnboundedStringWidth()) + createListOkayButton:GetWidth())
self:Hide()
end
local function BuildLists(frame)
frame:ClearButtons()
for i = 1, #AstralLists do
if AstralLists[i].name ~= 'GUILD' and AstralLists[i].name ~= 'FRIENDS' then
frame:AddButton(AstralLists[i].name, function(self)
for unit in pairs(selectedUnits) do
local unit = unit
local btag addon.UnitBTag(addon.UnitID(unit))
local list = self:GetText()
addon.AddUnitToList(unit, list, btag)
end
end, nil, nil, nil)
end
end
local newListButton = frame:AddButton(L['CREATE_NEW_LIST'], CreateList)
newListButton:SetScript('OnClick', function(self)
CreateList(self)
end)
end
unitPopup:AddButton(L['ADD_TO_LIST'], nil, nil, function() BuildLists(subUnitPopup) end, true, subUnitPopup)
local function RemoveUnitsFromList()
if addon.FrameListShown() == 'GUILD' or addon.FrameListShown() == 'FRIENDS' then return end
local list = addon.FrameListShown()
for unit in pairs(selectedUnits) do
addon.RemoveUnitFromList(unit, list)
end
addon.UpdateSortTable()
addon.UpdateFrames()
end
local function RemoveUnit_OnShow(self)
if addon.FrameListShown() == 'GUILD' or addon.FrameListShown() == 'FRIENDS' then
self:SetText(WrapTextInColorCode(self:GetText(), 'ff9d9d9d'))
else
self:SetText(L['REMOVE_UNIT_FROM_LIST'])
end
end
unitPopup:AddButton(L['REMOVE_UNIT_FROM_LIST'], RemoveUnitsFromList, RemoveUnit_OnShow)
unitPopup:AddButton(L['CANCEL'])
local AstralKeyToolTip = CreateFrame( "GameTooltip", "AstralKeyToolTip", AAFrame, "BackdropTemplate,GameTooltipTemplate" )
AstralKeyToolTip:SetOwner(AstralKeyFrame, "ANCHOR_CURSOR")
AstralKeyToolTip:SetScript('OnShow', function(self)
self:SetBackdrop({
bgFile = "Interface/Tooltips/UI-Tooltip-Background",
edgeFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 16, edgeSize = 1,
insets = {left = 0, right = 0, top = 0, bottom = 0}
})
self:SetBackdropColor(0, 0, 0, 1)
self:SetBackdropBorderColor(0, 0, 0)
end)
-- Skin the tooltip.
for i = 1, 2 do
_G['AstralKeyToolTipTextRight' .. i]:SetFontObject(InterUIBold_Tiny)
_G['AstralKeyToolTipTextLeft' .. i]:SetFontObject(InterUIBold_Tiny)
end
local offLineButton = addon.CreateCheckBox(AstralKeyFrame, SHOW_OFFLINE_MEMBERS, 150)
offLineButton:SetNormalFontObject(InterUIRegular_Small)
offLineButton:SetPoint('BOTTOMRIGHT', AstralKeyFrame, 'BOTTOMRIGHT', -15, 10)
offLineButton:SetAlpha(0.5)
offLineButton:SetScript('OnClick', function(self)
AstralKeysSettings.frame.show_offline.isEnabled = self:GetChecked()
HybridScrollFrame_SetOffset(AstralKeyFrameListContainer, 0)
addon.UpdateFrames()
end)
local menuBar = CreateFrame('FRAME', '$parentMenuBar', AstralKeyFrame)
menuBar:SetSize(50, 490)
menuBar:SetPoint('TOPLEFT', AstralKeyFrame, 'TOPLEFT')
menuBar.texture = menuBar:CreateTexture(nil, 'BACKGROUND')
menuBar.texture:SetAllPoints(menuBar)
menuBar.texture:SetColorTexture(33/255, 33/255, 33/255, 0.8)
local logo_Key = menuBar:CreateTexture(nil, 'ARTWORK')
logo_Key:SetSize(32, 32)
logo_Key:SetTexture('Interface\\AddOns\\AstralKeys\\Media\\Texture\\key-white@2x')
logo_Key:SetVertexColor(0.8, 0.8, 0.8, 0.8)
logo_Key:SetPoint('TOPLEFT', menuBar, 'TOPLEFT', 10, -10)
local divider = menuBar:CreateTexture(nil, 'ARTWORK')
divider:SetSize(20, 1)
divider:SetColorTexture(.6, .6, .6, .8)
divider:SetPoint('TOP', logo_Key, 'BOTTOM', 0, -20)
-- Report Key(s) to party/guild popup menu
local reportFrame = addon.CreateDropDownFrame('Report', 1, UIParent)
reportFrame:SetTitle(L['REPORT_TO'])
reportFrame:AddButton(L['PARTY'], function() addon.AnnounceCharacterKeys('PARTY') end)
reportFrame:AddButton(L['GUILD'], function() addon.AnnounceCharacterKeys('GUILD') end)
reportFrame:AddButton(L['CANCEL'])
local reportButton = CreateFrame('BUTTON', '$parentReportButton', menuBar)
reportButton:SetNormalTexture('Interface\\AddOns\\AstralKeys\\Media\\Texture\\baseline-volume_up-24px@2x')
reportButton:SetSize(20, 20)
reportButton:GetNormalTexture():SetVertexColor(.8, .8, .8, 0.8)
reportButton:SetPoint('TOP', divider, 'BOTTOM', 0, -20)
reportButton:SetScript('OnEnter', function(self)
self:GetNormalTexture():SetVertexColor(126/255, 126/255, 126/255, 0.8)
AstralKeyToolTip:SetOwner(self, 'ANCHOR_BOTTOMLEFT', 7, -2)
AstralKeyToolTip:AddLine('Report', 1, 1, 1)
AstralKeyToolTip:Show()
end)
reportButton:SetScript('OnLeave', function(self)
self:GetNormalTexture():SetVertexColor(0.8, 0.8, 0.8, 0.8)
AstralKeyToolTip:Hide()
end)
reportButton:SetScript('OnClick', function(self)
AstralMenuFrameUnit1:Hide()
AstralMenuFrameTabs1:Hide()
AstralMenuFrameReport1:SetPoint('TOPLEFT', self, 'TOPRIGHT', 10, -3)
AstralMenuFrameReport1:SetShown( not AstralMenuFrameReport1:IsShown())
end)
local settingsButton = CreateFrame('BUTTON', '$parentSettingsButton', menuBar)
settingsButton:SetNormalTexture('Interface\\AddOns\\AstralKeys\\Media\\Texture\\baseline-settings-20px@2x')
settingsButton:SetSize(24, 24)
settingsButton:GetNormalTexture():SetVertexColor(.8, .8, .8, 0.8)
settingsButton:SetPoint('TOP', reportButton, 'BOTTOM', 0, -20)
settingsButton:SetScript('OnEnter', function(self)
self:GetNormalTexture():SetVertexColor(126/255, 126/255, 126/255, 0.8)
AstralKeyToolTip:SetOwner(self, 'ANCHOR_BOTTOMLEFT', 7, -2)
AstralKeyToolTip:AddLine(L['Settings'], 1, 1, 1)
AstralKeyToolTip:Show()
end)
settingsButton:SetScript('OnLeave', function(self)
self:GetNormalTexture():SetVertexColor(0.8, 0.8, 0.8, 0.8)
AstralKeyToolTip:Hide()
end)
settingsButton:SetScript('OnClick', function()
AstralMenuFrameUnit1:Hide()
AstralOptionsFrame:SetShown( not AstralOptionsFrame:IsShown())
end)
local greatVaultButton = CreateFrame('BUTTON', '$parentGreatVaultButton', menuBar)
greatVaultButton:SetNormalTexture('Interface\\AddOns\\AstralKeys\\Media\\Texture\\great-vault@2x')
greatVaultButton:SetSize(24, 24)
greatVaultButton:GetNormalTexture():SetVertexColor(.8, .8, .8, 0.8)
greatVaultButton:SetPoint('TOP', settingsButton, 'BOTTOM', 0, -20)
greatVaultButton:SetScript('OnEnter', function(self)
self:GetNormalTexture():SetVertexColor(126/255, 126/255, 126/255, 0.8)
AstralKeyToolTip:SetOwner(self, 'ANCHOR_BOTTOMLEFT', 7, -2)
AstralKeyToolTip:AddLine(L['Vault'], 1, 1, 1)
AstralKeyToolTip:Show()
end)
greatVaultButton:SetScript('OnLeave', function(self)
self:GetNormalTexture():SetVertexColor(0.8, 0.8, 0.8, 0.8)
AstralKeyToolTip:Hide()
end)
greatVaultButton:SetScript('OnClick', function()
ToggleGreatVault()
end)
function ToggleGreatVault()
C_AddOns.LoadAddOn("Blizzard_WeeklyRewards")
WeeklyRewardExpirationWarningDialog:Hide()
if WeeklyRewardsFrame:IsShown() then
WeeklyRewardsFrame:Hide()
else WeeklyRewardsFrame:Show()
end
end
local refreshButton = CreateFrame('BUTTON', '$parentRefreshButton', menuBar)
refreshButton:SetNormalTexture('Interface\\AddOns\\AstralKeys\\Media\\Texture\\sync')
refreshButton:SetSize(24, 24)
refreshButton:GetNormalTexture():SetVertexColor(.6, .6, .6, .8)
refreshButton:SetPoint('TOP', greatVaultButton, 'BOTTOM', 0, -20)
refreshButton:SetScript('OnEnter', function(self)
self:GetNormalTexture():SetVertexColor(126/255, 126/255, 126/255, 0.8)
AstralKeyToolTip:SetOwner(self, 'ANCHOR_BOTTOMLEFT', 7, -2)
AstralKeyToolTip:AddLine(L['Refresh'], 1, 1, 1)
AstralKeyToolTip:Show()
end)
refreshButton:SetScript('OnLeave', function(self)
self:GetNormalTexture():SetVertexColor(.6, .6, .6, .8)
AstralKeyToolTip:Hide()
end)
refreshButton:SetScript('OnClick', function()
StaticPopup_Show('ASTRAL_KEYS_REFRESH_CONFIRM_DIALOG')
end)
local logo_Astral = CreateFrame('BUTTON', nil, menuBar)
logo_Astral:SetSize(32, 32)
logo_Astral:SetPoint('BOTTOMLEFT', menuBar, 'BOTTOMLEFT', 10, 10)
logo_Astral:SetAlpha(0.8)
logo_Astral:SetNormalTexture('Interface\\AddOns\\AstralKeys\\Media\\Texture\\Logo@2x')
logo_Astral:SetScript('OnClick', function()
astralGuildInfo:SetShown(not astralGuildInfo:IsShown())
end)
logo_Astral:SetScript('OnEnter', function(self)
self:SetAlpha(1)
end)
logo_Astral:SetScript('OnLeave', function(self)
self:SetAlpha(0.8)
end)
local collapseButton = CreateFrame('BUTTON', '$parentCollapseButton', menuBar)
collapseButton:SetNormalTexture('Interface\\AddOns\\AstralKeys\\Media\\Texture\\baseline-last_page-24px@2x')
collapseButton:SetSize(20, 20)
collapseButton:GetNormalTexture():SetVertexColor(.8, .8, .8, 0.8)
collapseButton:SetPoint('BOTTOM', logo_Astral, 'TOP', 0, 20)
collapseButton:SetScript('OnEnter', function(self)
self:GetNormalTexture():SetVertexColor(126/255, 126/255, 126/255, 0.8)
end)
collapseButton:SetScript('OnLeave', function(self)
self:GetNormalTexture():SetVertexColor(0.8, 0.8, 0.8, 0.8)
end)
---- List Buttons
-----------------------------------
local closeButton = CreateFrame('BUTTON', '$parentCloseButton', AstralKeyFrame)
closeButton:SetNormalTexture('Interface\\AddOns\\AstralKeys\\Media\\Texture\\baseline-close-24px@2x')
closeButton:SetSize(12, 12)
closeButton:GetNormalTexture():SetVertexColor(.8, .8, .8, 0.8)
closeButton:SetScript('OnClick', function()
AstralKeyFrame:Hide()
end)
closeButton:SetPoint('TOPRIGHT', AstralKeyFrame, 'TOPRIGHT', -10, -10)
closeButton:SetScript('OnEnter', function(self)
self:GetNormalTexture():SetVertexColor(126/255, 126/255, 126/255, 0.8)
end)
closeButton:SetScript('OnLeave', function(self)
self:GetNormalTexture():SetVertexColor(0.8, 0.8, 0.8, 0.8)
end)
-- Tab bar at the top, only show 5 and then start scrolling
-- MenuBar 50px
-- CENTER Frame CHARACTER_INFO_FRAME_SIZEpx
tabFrame = CreateFrame('FRAME', '$parentTabFrame', AstralKeyFrame)
tabFrame.offSet = 0
tabFrame:SetSize(460, 45)
tabFrame:SetPoint('TOPRIGHT', AstralKeyFrame, 'TOPRIGHT', -60, 10)
tabFrame.buttons = {}
local newTabButton = CreateFrame('BUTTON', '$parentNewListButton', tabFrame)
newTabButton:SetSize(17, 17)
newTabButton:SetNormalTexture('Interface\\AddOns\\AstralKeys\\Media\\Texture\\baseline_add_white_18dp')
newTabButton:GetNormalTexture():SetVertexColor(0.8, 0.8, 0.8, 0.8)
newTabButton:SetPoint('RIGHT', tabFrame, 'RIGHT')
newTabButton:SetScript('OnClick', function(self)
AstralMenuFrameUnit1:Hide()
AstralMenuFrameReport1:Hide()
AstralMenuFrameTabs1:SetPoint('TOPLEFT', self, 'TOPRIGHT', 10, -3)
AstralMenuFrameTabs1:SetShown(not AstralMenuFrameTabs1:IsShown())
end)
-- Use arrows to display lists are on either side of curent offset
local tabFrameLeftButton = CreateFrame('BUTTON', '$parentLeftButton', tabFrame)
tabFrameLeftButton:SetNormalTexture('Interface\\AddOns\\AstralKeys\\Media\\Texture\\baseline_keyboard_arrow_left_white_18dp')
tabFrameLeftButton:SetSize(12, 12)
tabFrameLeftButton:SetPoint('LEFT', tabFrame, 'LEFT', 10, -2)
tabFrameLeftButton:GetNormalTexture():SetVertexColor(0.8, 0.8, 0.8, 0.8)
tabFrameLeftButton:SetScript('OnClick', function(self)
if self:GetParent().offSet < 1 then
return
else
self:GetParent().offSet = self:GetParent().offSet - 1
UpdateTabs()
end
end)
local tabFrameRightButton = CreateFrame('BUTTON', '$parentLeftButton', tabFrame)
tabFrameRightButton:SetNormalTexture('Interface\\AddOns\\AstralKeys\\Media\\Texture\\baseline_keyboard_arrow_right_white_24dp')
tabFrameRightButton:SetSize(12, 12)
tabFrameRightButton:SetPoint('RIGHT', tabFrame, 'RIGHT', 3, -2)
tabFrameRightButton:GetNormalTexture():SetVertexColor(0.8, 0.8, 0.8, 0.8)
tabFrameRightButton:SetScript('OnClick', function(self)
if self:GetParent().buttons[#self:GetParent().buttons]:IsShown() then
--if self:GetParent().offSet >= #self:GetParent().buttons then
return
else
self:GetParent().offSet = self:GetParent().offSet + 1
UpdateTabs()
end
end)
function UpdateTabs()
local buttons = AstralKeyFrameTabFrame.buttons
local offSet = AstralKeyFrameTabFrame.offSet
local maxPossibleWidth = 450 - 15 - 20 -- Tab frame, close button, new tab button width
local usedWidth = 0 -- initialize at 10 for padding on the left
local buttonsUsed = 0
for i = 1, #buttons do
buttons[i]:ClearAllPoints()
buttons[i]:Hide()
end
for i = 1 + offSet, #buttons do
if addon.FrameListShown() == buttons[i].listName then
buttons[i].underline:Show()
buttons[i]:SetAlpha(1)
else
buttons[i].underline:Hide()
buttons[i]:SetAlpha(0.5)
end
if i == 1 + offSet then
usedWidth = usedWidth + buttons[i]:GetWidth() + 10 -- Padding between buttons
buttons[i]:SetPoint('TOPLEFT', AstralKeyFrameTabFrame, 'TOPLEFT', 25, -17)
buttons[i]:Show()
else
usedWidth = usedWidth + buttons[i]:GetWidth() + 10 -- Padding between buttons
if usedWidth <= maxPossibleWidth then
buttons[i]:SetPoint('LEFT', buttons[i-1], 'RIGHT', 10, 0)
buttons[i]:Show()
buttonsUsed = i
end
end
end
newTabButton:ClearAllPoints()
newTabButton:SetPoint('LEFT', buttons[buttonsUsed], 'RIGHT', 5, 0)
end
local function Tab_OnClick(self, button)
local next = next
if button == 'LeftButton' then
C_FriendList.ShowFriends()
if addon.FrameListShown() ~= self.listName then
ClearSelectedUnits()
addon.SetFrameListShown(self.listName)
HybridScrollFrame_SetOffset(AstralKeyFrameListContainer, 0)
UpdateTabs()
addon.UpdateSortTable()
addon.UpdateFrames()
AstralKeyFrameListContainer.scrollBar:SetValue(0)
-- enable if GetListCount is fixed
--[[ if (self.listName ~= "GUILD" and self.listName ~= "FRIENDS") and addon.GetListCount(self.listName) == 0 then
listHelperText:Show()
else
listHelperText:Hide()
end ]]
end
end
end
function CreateNewTab(name, parent, ...)
if not name or type(name) ~= 'string' then
error('CreateNewTab(name, parent, ...) name: string expected, received ' .. type(name))
end
local buttons = parent.buttons
local tab = CreateFrame('BUTTON', '$parentTab' .. name, parent)
tab:RegisterForClicks('LeftButtonUp', 'RightButtonUp')
tab.listName = name
tab:SetNormalFontObject(InterUIBlack_Small)
tab:SetText(L[name])
tab:GetFontString():SetJustifyH('CENTER')
tab:SetWidth(50)
tab:SetHeight(15)
tab:SetScript('OnClick', function(self, button) Tab_OnClick(self, button) end)
local textWidth = tab:GetFontString():GetUnboundedStringWidth()
tab:SetWidth(textWidth + 10)
tab.underline = tab:CreateTexture(nil, 'ARTWORK')
tab.underline:SetSize(textWidth, 2)
tab.underline:SetColorTexture(214/255, 38/255, 38/255)
tab.underline:SetPoint('BOTTOM', tab, 'BOTTOM', 0, -1)
tab.underline:Hide()
table.insert(buttons, tab)
end
function RemoveTab(name)
if not name or type(name) ~= 'string' then
error('RemoveTab(name) name: string expected, received ' .. type(name))
end
local buttons = AstralKeyFrameTabFrame.buttons
local targetName = 'AstralKeyFrameTabFrameTab' .. name
for i = 1, #buttons do
if buttons[i]:GetName() == targetName then
local btn = table.remove(buttons, i)
btn:Hide()
btn:SetParent(nil)
break
end
end
end
local tabPopup = addon.CreateDropDownFrame('Tabs', 1, UIParent)
tabPopup:SetTitle(L['ADD_REMOVE_LIST'])
local subTabPopup = addon.CreateDropDownFrame('Tabs', 2, UIParent)
subTabPopup:SetTitle(L['DELETE_LIST'])
local tabFrameNewListButton = tabPopup:AddButton(L['CREATE_NEW_LIST'], CreateList)
tabFrameNewListButton:SetScript('OnClick', CreateList)
local function RemoveList(frame)
frame:ClearButtons()
for i = 1, #AstralLists do
if AstralLists[i].name ~= 'GUILD' and AstralLists[i].name ~= 'FRIENDS' then
frame:AddButton(AstralLists[i].name, function(self)
addon.DeleteList(self:GetText())
RemoveTab(self:GetText(), tabFrame)
UpdateTabs()
end)
end
end
end
tabPopup:AddButton(L['DELETE_LIST'], nil, nil, function () RemoveList(subTabPopup) end, true, subTabPopup)
-- CENTER panel construction, Affixe info, character info, guild/version string
local characterFrame = CreateFrame('FRAME', '$parentCharacterFrame', AstralKeyFrame)
characterFrame:SetSize(CHARACTER_INFO_FRAME_SIZE, 490)
characterFrame:SetPoint('TOPLEFT', AstralKeyFrame, 'TOPLEFT', 51, 0)
characterFrame.collapse = characterFrame:CreateAnimationGroup()
local characterCollapse = characterFrame.collapse:CreateAnimation('Alpha')
characterCollapse:SetFromAlpha(1)
characterCollapse:SetToAlpha(0)
characterCollapse:SetDuration(.12)
characterCollapse:SetSmoothing('IN_OUT')
characterCollapse:SetScript('OnFinished', function(self)
self:GetRegionParent():Hide()
end)
characterCollapse:SetScript('OnUpdate', function(self)
self:GetRegionParent():SetAlpha(self:GetSmoothProgress()/2)
local left, bottom, width = AstralKeyFrame:GetRect()
local newWidth = FRAME_WIDTH_EXPANDED - (self:GetProgress() * CHARACTER_INFO_FRAME_SIZE) -- CHARACTER_INFO_FRAME_SIZE:: Character Frame Width
AstralKeyFrame:ClearAllPoints()
AstralKeyFrame:SetPoint('BOTTOMLEFT', UIParent, 'BOTTOMLEFT', left + width - newWidth, bottom)
AstralKeyFrame:SetWidth(newWidth)
end)
characterFrame.expand = characterFrame:CreateAnimationGroup()
local characterExpand = characterFrame.expand:CreateAnimation('Alpha')
characterExpand:SetFromAlpha(0)
characterExpand:SetToAlpha(1)
characterExpand:SetDuration(.12)
characterExpand:SetSmoothing('IN_OUT')
characterExpand:SetScript('OnPlay', function(self)
self:GetRegionParent():Show()
end)
characterExpand:SetScript('OnUpdate', function(self)
local left, bottom, width = AstralKeyFrame:GetRect()
local newWidth = FRAME_WIDTH_MINIMIZED + (self:GetProgress() * CHARACTER_INFO_FRAME_SIZE) -- CHARACTER_INFO_FRAME_SIZE:: Character Frame Width
AstralKeyFrame:ClearAllPoints()
AstralKeyFrame:SetPoint('BOTTOMLEFT', UIParent, 'BOTTOMLEFT', left + width - newWidth, bottom)
AstralKeyFrame:SetWidth(newWidth)
end)
collapseButton:SetScript('OnClick', function(self)
if not AstralKeysSettings.frame.isCollapsed.isEnabled then
if AstralKeyFrameCharacterFrame.expand:IsPlaying() then
AstralKeyFrameCharacterFrame.expand:Stop()
end
AstralKeyFrameCharacterFrame.collapse:Play()
AstralKeysSettings.frame.isCollapsed.isEnabled = true
self:SetNormalTexture('Interface\\AddOns\\AstralKeys\\Media\\Texture\\baseline-first_page-24px@2x')
else
if AstralKeyFrameCharacterFrame.collapse:IsPlaying() then
AstralKeyFrameCharacterFrame.collapse:Stop()
end
AstralKeyFrameCharacterFrame.expand:Play()
AstralKeysSettings.frame.isCollapsed.isEnabled = false
self:SetNormalTexture('Interface\\AddOns\\AstralKeys\\Media\\Texture\\baseline-last_page-24px@2x')
end
end)
local affixTitle = characterFrame:CreateFontString('$parentAffixTitle', 'OVERLAY', 'InterUIBlack_Small')
affixTitle:SetPoint('TOPLEFT', characterFrame, 'TOPLEFT', 20, -20)
affixTitle:SetText(L['AFFIXES'])
-- Affix Frames
-----------------------------------------------------
do
for i = 1, addon.NUM_AFFIXES do
local frame = CreateFrame('FRAME', '$parentAffix' .. i, characterFrame)
frame.id = i
frame.affixID = 0
frame:SetSize(32, 32)
frame.icon = frame:CreateTexture(nil, 'ARTWORK')
if i == 1 then
frame:SetPoint('TOPLEFT', affixTitle, 'BOTTOMLEFT', 0, -15)
else
local offset = 20
if i % addon.NUM_AFFIXES == 0 then
offset = 5
end
frame:SetPoint('LEFT', '$parentAffix' .. (i -1), 'RIGHT', offset, 0)
end
frame.icon:SetAllPoints(frame)
function frame:UpdateInfo(affixID)
if affixID and affixID ~= 0 then
self.affixID = affixID
local _, _, texture = C_ChallengeMode.GetAffixInfo(affixID)
self.icon:SetTexture(texture)
end
end
frame:SetScript('OnEnter', function(self)
if not self.affixID then return end
AstralKeyToolTip:SetOwner(self, 'ANCHOR_BOTTOMLEFT', 7, -2)
AstralKeyToolTip:AddLine(addon.AffixName(self.affixID), 1, 1, 1)
if AstralKeysSettings.general.expanded_tooltip.isEnabled then
AstralKeyToolTip:AddLine(addon.AffixDescription(self.affixID), 1, 1, 1, true)
end
AstralKeyToolTip:Show()
end)
frame:SetScript('OnLeave', function()
AstralKeyToolTip:Hide()
end)
end
end
-- Affix frame for coming week's affixes
----------------------------------------------------
AstralKeyFrame.affixesExpanded = false
local affixFrame = CreateFrame('FRAME', '$parentAffixFrame', AstralKeyFrameCharacterFrame)
affixFrame:SetSize(185, 15)
affixFrame:SetPoint('TOPLEFT', AstralKeyFrameCharacterFrameAffix1, 'BOTTOMLEFT', 0 , -10)
local affixExpandButton = CreateFrame('BUTTON', '$parentAffixExpandButton', characterFrame)
affixExpandButton:SetNormalTexture('Interface\\AddOns\\AstralKeys\\Media\\Texture\\baseline_keyboard_arrow_down_white_18dp')
affixExpandButton:SetSize(24, 14)
affixExpandButton:GetNormalTexture():SetVertexColor(0.8, 0.8, 0.8, 0.8)
affixExpandButton:SetPoint('BOTTOM', affixFrame, 'BOTTOM', 0, 0)
do
for i = 1, (2 * addon.NUM_AFFIXES) do
local frame = CreateFrame('FRAME', '$parentAffix' .. i, affixFrame)
frame.id = (i % addon.NUM_AFFIXES) == 0 and addon.NUM_AFFIXES or i % addon.NUM_AFFIXES
if i < (addon.NUM_AFFIXES + 1) then
frame.weekOffset = 1
else
frame.weekOffset = 2
end
frame.affixID = 0
frame:SetSize(32, 32)
frame.texture = frame:CreateTexture(nil, 'ARTWORK')
if i == 1 then
frame:SetPoint('TOPLEFT', affixFrame, 'TOPLEFT', 0, 0)
elseif i == (addon.NUM_AFFIXES + 1) then
frame:SetPoint('TOPLEFT', '$parentAffix1', 'BOTTOMLEFT', 0, -15)
else
local offset = 20
if i % addon.NUM_AFFIXES == 0 then
offset = 5
end
frame:SetPoint('LEFT', '$parentAffix' .. (i -1), 'RIGHT', offset, 0)
end
frame.texture:SetPoint('TOPLEFT', frame, 'TOPLEFT')
frame.texture:SetAllPoints(frame)
function frame:UpdateInfo()
self.affixID = addon.GetAffixID(self.id, self.weekOffset)
if self.affixID and self.affixID ~= 0 then
local _, _, texture = C_ChallengeMode.GetAffixInfo(self.affixID)
self.texture:SetTexture(texture)
end
end
frame:SetScript('OnEnter', function(self)
if not self.affixID then return end
AstralKeyToolTip:SetOwner(self, 'ANCHOR_BOTTOMLEFT', 7, -2)
AstralKeyToolTip:AddLine(addon.AffixName(self.affixID), 1, 1, 1)
if AstralKeysSettings.general.expanded_tooltip.isEnabled then
AstralKeyToolTip:AddLine(addon.AffixDescription(self.affixID), 1, 1, 1, true)
end
AstralKeyToolTip:Show()
end)
frame:SetScript('OnLeave', function()
AstralKeyToolTip:Hide()
end)
frame:Hide()
end
end
affixFrame.expand = affixFrame:CreateAnimationGroup()
local affixExpand = affixFrame.expand:CreateAnimation('Alpha')
affixExpand:SetFromAlpha(0)
affixExpand:SetToAlpha(1)
affixExpand:SetDuration(.12)
affixExpand:SetSmoothing('IN_OUT')
affixExpand:SetScript('OnPlay', function()
affixExpandButton:SetNormalTexture('Interface\\AddOns\\AstralKeys\\Media\\Texture\\baseline_keyboard_arrow_up_white_18dp')
affixExpandButton:GetNormalTexture():SetVertexColor(0.8, 0.8, 0.8, 0.8)
AstralKeyFrame.affixesExpanded = true
end)
affixExpand:SetScript('OnUpdate', function(self)
local progress = self:GetProgress()
AstralKeyFrameCharacterFrameAffixFrame:SetHeight((progress * 85) + 15)
AstralKeyFrameCharacterFrameCharacterContainer:SetHeight(((1-progress) * 85) + 230)
AstralKeyFrameCharacterFrameCharacterTitle:SetPoint('TOPLEFT', affixFrame, 'BOTTOMLEFT', 0, -10)
affixExpandButton:SetPoint('BOTTOM', affixFrame, 'BOTTOM', 0, 0)
end)
local affixIconsExpand = affixFrame.expand:CreateAnimation('Alpha')
affixIconsExpand:SetDuration(0.08)
affixIconsExpand:SetFromAlpha(0)
affixIconsExpand:SetToAlpha(1)
affixIconsExpand:SetSmoothing('IN_OUT')
affixIconsExpand:SetStartDelay(0.1)
affixIconsExpand:SetScript('OnPlay', function()
for i = 1, (addon.NUM_AFFIXES * 2) do
_G['AstralKeyFrameCharacterFrameAffixFrameAffix' .. i]:Show()
end
end)
affixIconsExpand:SetScript('OnUpdate', function(self)
local alpha = self:GetSmoothProgress()
for i = 1, (addon.NUM_AFFIXES * 2) do
_G['AstralKeyFrameCharacterFrameAffixFrameAffix' .. i]:SetAlpha(alpha)
end
end)
affixIconsExpand:SetScript('OnFinished', function()
end)
affixFrame.collapse = affixFrame:CreateAnimationGroup()
local affixIconsCollapse = affixFrame.collapse:CreateAnimation('Alpha')
affixIconsCollapse:SetDuration(0.08)
affixIconsCollapse:SetFromAlpha(1)
affixIconsCollapse:SetToAlpha(0)
affixIconsCollapse:SetSmoothing('IN_OUT')
affixIconsCollapse:SetStartDelay(0.1)