-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathCore.lua
More file actions
1365 lines (1317 loc) · 58.4 KB
/
Core.lua
File metadata and controls
1365 lines (1317 loc) · 58.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
local addonName, addon = ...
local addonTitle = C_AddOns.GetAddOnMetadata(addonName, "Title")
local addonIcon = C_AddOns.GetAddOnMetadata(addonName, "IconTexture")
local PREFIX = "|cff4cc9f0SACI|r: "
local LSM = LibStub("LibSharedMedia-3.0")
local LDS = LibStub("LibDualSpec-1.0")
local LDB = LibStub("LibDataBroker-1.1")
local Masque = LibStub("Masque",true)
local AceAddon = LibStub("AceAddon-3.0")
local AceConfig = LibStub("AceConfig-3.0")
local AceConfigDialog = LibStub("AceConfigDialog-3.0")
local AceConfigRegistry = LibStub("AceConfigRegistry-3.0")
local AceDB = LibStub("AceDB-3.0")
local DB_VERSION = 5
addon = AceAddon:NewAddon(addon, addonName, "AceConsole-3.0", "AceEvent-3.0")
local defaults = {
profile = {
enabled = true,
locked = false,
checkForVisibleButton = false,
display = {
HideInVehicle = false,
HideInHealerRole = false,
HideOnMount = false,
HOSTILE_TARGET = false,
IN_COMBAT = false,
ALWAYS = true,
ONLY_ALL_CONDITIONS = false,
},
cooldown = {
edge = true,
bling = true,
HideNumbers = false,
showSwipe = true,
chargeCooldown = {
showCount = false,
showSwipe = false,
edge = true,
text = {
font = "Friz Quadrata TT",
fontSize = 14,
fontOutline = true,
fontColor = { r = 1, g = 1, b = 1, a = 1 },
point = "BOTTOMRIGHT",
X = -5,
Y = 5,
},
},
},
iconSize = 48,
alpha = 1,
icon = {
alpha = 1,
size = 48,
scale = 1,
ratio = 1,
},
fadeOutAlpha = 0.25,
fadeOutHide = false,
border = {
show = true,
thickness = 2,
color = { r = 0, g = 0, b = 0},
},
position = {
strata = 3,
parent = "UIParent",
parentFrame = "UIParent",
InheritFrameVisibility = true,
point = "CENTER",
relativePoint = "CENTER",
X = 0,
Y = 0
},
Keybind = {
show = true,
font = "Friz Quadrata TT",
fontSize = 14,
fontOutline = true,
fontColor = { r = 1, g = 1, b = 1, a = 1 },
point = "TOPRIGHT",
X = -4,
Y = -4,
ConsolePort = false,
overrides = {},
}
}
}
local BuiltinParentFrames = {
PlayerFrame = "Player Unit Frame",
TargetFrame = "Target Unit Frame",
EssentialCooldownViewer = "Essential Cooldown Viewer",
UtilityCooldownViewer = "Utility Cooldown Viewer",
PersonalResourceDisplayFrame = "Personal Resource Display",
UIParent = "Screen",
__nameplate = "Target Nameplate",
__cursor = "Mouse Cursor",
__other = "Other",
}
function addon:OnInitialize()
self.db = AceDB:New("SCAIDB", defaults, true)
LDS:EnhanceDatabase(self.db, addonName)
AssistedCombatIconFrame:OnAddonLoaded()
self.db.RegisterCallback(self, "OnNewProfile", "OnProfileChanged")
self.db.RegisterCallback(self, "OnProfileChanged", "OnProfileChanged")
self.db.RegisterCallback(self, "OnProfileCopied", "OnProfileChanged")
self.db.RegisterCallback(self, "OnProfileReset", "OnProfileChanged")
self:SetupOptions()
self:UpdateDB()
end
function addon:UpdateDB()
local profile = self.db.profile
profile.DBVERSION = profile.DBVERSION or 1
if profile.DBVERSION < 2 then
local oldMode = profile.displayMode
if oldMode then
profile.display[oldMode] = true
profile.displayMode = nil
end
if profile.display.ALWAYS then
-- Clear everything except ALWAYS
for k, v in pairs(profile.display) do
if k ~= "ALWAYS" and v then
profile.display[k] = false
end
end
end
profile.DBVERSION = 2
end
if profile.DBVERSION < 3 then
local oldMode = profile.showCooldownSwipe
if oldMode ~= nil then
profile.cooldown.showSwipe = oldMode
profile.showCooldownSwipe = nil
end
profile.DBVERSION = 3
end
if profile.DBVERSION < 4 then
local points = {
["TOPLEFT"] = "TOPLEFT",
["TOP"] = "TOP",
["TOPRIGHT"] = "TOPRIGHT",
["LEFT"] = "LEFT",
["CENTER"] = "CENTER",
["RIGHT"] = "RIGHT",
["BOTTOMLEFT"] = "BOTTOMLEFT",
["BOTTOM"] = "BOTTOM",
["BOTTOMRIGHT"] = "BOTTOMRIGHT",
}
if not points[profile.position.point] then
profile.position.point = "CENTER"
end
if not points[profile.position.relativePoint] then
profile.position.relativePoint = "CENTER"
end
profile.DBVERSION = 4
end
if profile.DBVERSION < 5 then
local parent = profile.position.parent
if BuiltinParentFrames[parent] ~= nil then
profile.position.parentFrame = parent
else
profile.position.parentFrame = "__other"
end
profile.DBVERSION = 5
end
profile.DBVERSION = DB_VERSION
end
function addon:NormalizeDisplayOptions(key, val)
local display = self.db.profile.display
if not display then return end
if key == "ALWAYS" and val then
for k in pairs(display) do
if k ~= "ALWAYS" and k ~= "ONLY_ALL_CONDITIONS" then
display[k] = false
end
end
return
end
if key ~= "ALWAYS" and k ~= "ONLY_ALL_CONDITIONS" and val then
display.ALWAYS = false
return
end
if not val then
for k, v in pairs(display) do
if v and k ~= "ONLY_ALL_CONDITIONS" then
return
end
end
display.ALWAYS = true
end
end
function addon:SetupOptions()
local profileOptions = LibStub("AceDBOptions-3.0"):GetOptionsTable(addon.db)
LDS:EnhanceOptions(profileOptions, self.db)
profileOptions.inline = false
profileOptions.order = 9
local generalOptions = {
type = "group",
name = "General Settings",
inline = true,
args = {
enabled = {
type = "toggle",
name = "Enabled",
desc = "Enable / Disable the Icon",
get = function() return addon.db.profile.enabled end,
set = function(_, val)
addon.db.profile.enabled = val
if val then
AssistedCombatIconFrame:Start()
else
AssistedCombatIconFrame:Stop()
end
end,
order = 1,
width = 0.6,
},
locked = {
type = "toggle",
name = "Lock Frame",
desc = "Lock or unlock the frame for movement.\n\n|cffffa000TIP: Press and Hold the CONTROL key while hovering over the icon to show a Lock/Unlock toggle button!|r",
get = function() return addon.db.profile.locked end,
set = function(_, val)
AssistedCombatIconFrame:Lock(val)
AssistedCombatIconFrame:ApplyOptions()
end,
disabled = function() return addon.db.profile.position.parentFrame ~= "UIParent" end,
order = 1,
width = 0.6,
},
showCooldownSwipe = {
type = "toggle",
name = "Enable Cooldown",
desc = "Enable or disable the cooldown and charge swipe animations.",
get = function() return addon.db.profile.cooldown.showSwipe end,
set = function(_, val)
addon.db.profile.cooldown.showSwipe = val
AssistedCombatIconFrame:ApplyOptions()
end,
order = 2,
width = 0.8,
},
showKeybindText = {
type = "toggle",
name = "Enable Keybind",
desc = "Show or hide keybinding text",
get = function() return addon.db.profile.Keybind.show end,
set = function(_, val)
addon.db.profile.Keybind.show = val
AssistedCombatIconFrame:ApplyOptions()
end,
order = 3,
width = 0.8,
},
},
}
local displayOptions = {
type = "group",
name = "Display",
inline = false,
order = 1,
args = {
displayOptions = {
type = "group",
name = "Display Options",
desc = "When to show or hide the icon.",
inline = true,
order = 2,
args = {
r1 = {
type = "group",
name = "",
order = 1,
args = {
ALWAYS = {
type = "toggle",
name = "Always Show",
order = 1,
width = 1,
get = function(info)
return addon.db.profile.display.ALWAYS
end,
set = function(info, val)
if not val then
return
end
addon.db.profile.display.ALWAYS = val
addon:NormalizeDisplayOptions("ALWAYS",val)
AssistedCombatIconFrame:UpdateVisibility()
end,
},
HideOnMount = {
type = "toggle",
name = "Hide while mounted",
order = 2,
width = 1.2,
get = function(info)
return addon.db.profile.display.HideOnMount
end,
set = function(info, val)
addon.db.profile.display.HideOnMount = val
addon:NormalizeDisplayOptions("HideOnMount", val)
AssistedCombatIconFrame:UpdateVisibility()
end,
},
},
},
r2 = {
type = "group",
name = "",
order = 2,
args = {
HOSTILE_TARGET = {
type = "toggle",
name = "Show with target",
order = 1,
width = 1,
get = function(info)
return addon.db.profile.display.HOSTILE_TARGET
end,
set = function(info, val)
addon.db.profile.display.HOSTILE_TARGET = val
addon:NormalizeDisplayOptions("HOSTILE_TARGET", val)
AssistedCombatIconFrame:UpdateVisibility()
end,
},
HideInVehicle = {
type = "toggle",
name = "Hide in a Vehicle / Pet Battle",
order = 2,
width = 1.2,
get = function(info)
return addon.db.profile.display.HideInVehicle
end,
set = function(info, val)
addon.db.profile.display.HideInVehicle = val
addon:NormalizeDisplayOptions("HideInVehicle", val)
AssistedCombatIconFrame:UpdateVisibility()
end,
},
},
},
r3 = {
type = "group",
name = "",
order = 3,
args = {
IN_COMBAT = {
type = "toggle",
name = "Show in combat",
order = 1,
width = 1,
get = function(info)
return addon.db.profile.display.IN_COMBAT
end,
set = function(info, val)
addon.db.profile.display.IN_COMBAT = val
addon:NormalizeDisplayOptions("IN_COMBAT", val)
AssistedCombatIconFrame:UpdateVisibility()
end,
},
HideAsHealer = {
type = "toggle",
name = "Hide in Healer Role",
desc = "Hide the icon while in group content as a healer role.\n\n|cffffa000Icon still displays while solo.|r\n\n|cffffa000TIP: You can use Spec Profiles in the profiles options to hide based on Specs.|r",
order = 2,
width = 1.2,
get = function(info)
return addon.db.profile.display.HideAsHealer
end,
set = function(info, val)
addon.db.profile.display.HideAsHealer = val
addon:NormalizeDisplayOptions("HideAsHealer", val)
AssistedCombatIconFrame:UpdateVisibility()
end,
},
},
},
r4 = {
type = "group",
name = "",
order = 8,
args = {
IN_COMBAT = {
type = "toggle",
name = "All Conditions Only",
desc = "Only show when all of the selected conditions are met instead of any condition.",
order = 1,
width = 1.5,
get = function(info)
return addon.db.profile.display.ONLY_ALL_CONDITIONS
end,
set = function(info, val)
addon.db.profile.display.ONLY_ALL_CONDITIONS = val
addon:NormalizeDisplayOptions("ONLY_ALL_CONDITIONS", val)
AssistedCombatIconFrame:UpdateVisibility()
end,
disabled = function() return addon.db.profile.display.ALWAYS end,
},
},
},
grp2 = {
type = "group",
name = "",
inline = true,
order = 9,
args = {
iconSize = {
type = "toggle",
name = "Fade instead of Hiding",
desc = "Set the icon Alpha level instead of hiding.",
get = function() return addon.db.profile.fadeOutHide end,
set = function(_, val)
addon.db.profile.fadeOutHide = val
AssistedCombatIconFrame:ApplyOptions()
end,
disabled = function() return addon.db.profile.display.ALWAYS end,
order = 1,
width = "normal",
},
alpha = {
type = "range",
name = "Fade out Alpha",
desc = "Set the alpha to fade to when 'hidden'.",
min = 0, max = 1, step = 0.01,
get = function() return addon.db.profile.fadeOutAlpha end,
set = function(_, val)
addon.db.profile.fadeOutAlpha = val
AssistedCombatIconFrame:ApplyOptions()
end,
disabled = function() return addon.db.profile.display.ALWAYS or not addon.db.profile.fadeOutHide end,
order = 2,
width = "normal",
},
},
},
},
},
grp3 = {
type = "group",
name = "Icon",
inline = true,
order = 3,
args = {
iconSize = {
type = "range",
name = "Size",
desc = "Set the size of the icon",
min = 20, max = 300, step = 1,
get = function() return addon.db.profile.iconSize end,
set = function(_, val)
addon.db.profile.iconSize = val
AssistedCombatIconFrame:ApplyOptions()
end,
order = 2,
width = "normal",
},
alpha = {
type = "range",
name = " Alpha",
desc = "Change the alpha of the icon",
min = 0, max = 1, step = 0.01,
get = function() return addon.db.profile.alpha end,
set = function(_, val)
addon.db.profile.alpha = val
AssistedCombatIconFrame:ApplyOptions()
end,
order = 3,
width = "normal",
},
grp5 = {
type = "group",
name = "",
inline = true,
order = 5,
args = {
scale = {
type = "range",
name = "Icon Scale",
desc = "Set the scale of the icon",
min = 0.25, max = 2, step = 0.05,
get = function() return addon.db.profile.icon.scale end,
set = function(_, val)
addon.db.profile.icon.scale = val
AssistedCombatIconFrame:ApplyOptions()
end,
order = 1,
width = "normal",
},
},
},
grp6 = {
type = "group",
name = "",
inline = true,
order = 6,
args = {
checkVisible = {
type = "toggle",
name = "Visible Abilities Only",
desc = "Set if the icon should only show the abilities that are currently visible on the action bars.\n\nUses Blizzards own functions to determine if it is visible. Results may vary.\nOnly works on Default UI.",
disabled = function() return not AssistedCombatIconFrame.isDefaultUI end,
hidden = function() return not AssistedCombatIconFrame.isDefaultUI end,
get = function() return addon.db.profile.checkForVisibleButton end,
set = function(_, val)
addon.db.profile.checkForVisibleButton = val
AssistedCombatIconFrame:ApplyOptions()
end,
order = 1,
width = 1.5,
},
},
},
},
},
grp4 = {
type = "group",
name = "Border",
inline = true,
order = 4,
args = {
masqueWarning = {
type = "description",
name = "|cffffa000Border is currently overridden by Masque.|r",
hidden = function() return not (Masque and AssistedCombatIconFrame.MSQGroup and not AssistedCombatIconFrame.MSQGroup.db.Disabled) end,
order = 9.1,
},
borderColor = {
type = "color",
name = "Color",
desc = "Change the text color of the border",
hasAlpha = false,
get = function()
local c = addon.db.profile.border.color
return c.r, c.g, c.b
end,
set = function(_, r, g, b, a)
addon.db.profile.border.color = { r = r, g = g, b = b }
AssistedCombatIconFrame:ApplyOptions()
end,
hidden = function() return (Masque and AssistedCombatIconFrame.MSQGroup and not AssistedCombatIconFrame.MSQGroup.db.Disabled) end,
order = 2,
},
borderThickness = {
type = "range",
name = " Thickness",
desc = "Change the thickness of the icon border",
min = 0, max = 10, step = 1,
get = function() return addon.db.profile.border.thickness end,
set = function(_, val)
addon.db.profile.border.thickness = val
AssistedCombatIconFrame:ApplyOptions()
end,
hidden = function() return (Masque and AssistedCombatIconFrame.MSQGroup and not AssistedCombatIconFrame.MSQGroup.db.Disabled) end,
order = 1,
},
},
},
},
}
local cooldownOptions = {
type = "group",
name = "Cooldown & Charges",
inline = false,
order = 3,
args = {
subgroup1 = {
type = "group",
name = "Cooldown",
inline = true,
args = {
edge = {
type = "toggle",
name = "Draw Edge",
desc = "Sets whether a bright line should be drawn on the moving edge of the cooldown animation.",
get = function() return addon.db.profile.cooldown.edge end,
set = function(_, val)
addon.db.profile.cooldown.edge = val
AssistedCombatIconFrame:ApplyOptions()
end,
order = 1,
width = 0.6,
},
bling = {
type = "toggle",
name = "Draw Bling",
desc = "Set whether a 'bling' animation plays at the end of a cooldown.",
get = function() return addon.db.profile.cooldown.bling end,
set = function(_, val)
addon.db.profile.cooldown.bling = val
AssistedCombatIconFrame:ApplyOptions()
end,
order = 2,
width = 0.6,
},
hideNum = {
type = "toggle",
name = "Hide Cooldown Numbers",
desc = "Hide cooldown number text",
get = function() return addon.db.profile.cooldown.HideNumbers end,
set = function(_, val)
addon.db.profile.cooldown.HideNumbers = val
AssistedCombatIconFrame:ApplyOptions()
end,
order = 3,
width = 1.1,
},
},
},
subgroup2 = {
type = "group",
name = "Spell Charges",
inline = true,
args = {
subgroup = {
type = "group",
name = "",
inline = true,
order = 1,
args = {
swipe = {
type = "toggle",
name = "Show Swipe",
desc = "Sets whether a bright line should be drawn on the moving edge of the cooldown animation.",
get = function() return addon.db.profile.cooldown.chargeCooldown.showSwipe end,
set = function(_, val)
addon.db.profile.cooldown.chargeCooldown.showSwipe = val
AssistedCombatIconFrame:ApplyOptions()
end,
order = 1,
width = 0.8,
},
bling = {
type = "toggle",
name = "Show Count",
desc = "Show the number of current charges for the ability.",
get = function() return addon.db.profile.cooldown.chargeCooldown.showCount end,
set = function(_, val)
addon.db.profile.cooldown.chargeCooldown.showCount = val
AssistedCombatIconFrame:ApplyOptions()
end,
order = 2,
width = 0.8,
},
edge = {
type = "toggle",
name = "Draw Edge",
desc = "Sets whether a bright line should be drawn on the moving edge of the cooldown animation.",
get = function() return addon.db.profile.cooldown.chargeCooldown.edge end,
set = function(_, val)
addon.db.profile.cooldown.chargeCooldown.edge = val
AssistedCombatIconFrame:ApplyOptions()
end,
order = 3,
width = 0.6,
},
},
},
subgroup1 = {
type = "group",
name = "Display",
inline = true,
order = 2,
args = {
font = {
type = "select",
name = "Font",
desc = "Choose the font for the Charge Count text",
dialogControl = "LSM30_Font",
values = LSM:HashTable(LSM.MediaType.FONT),
get = function() return addon.db.profile.cooldown.chargeCooldown.text.font end,
set = function(_, val)
addon.db.profile.cooldown.chargeCooldown.text.font = val
AssistedCombatIconFrame:ApplyOptions()
end,
order = 1,
width = 0.8,
},
fontSize = {
type = "range",
name = "Font Size",
desc = "Set the Charge Count font size",
min = 8, max = 100, step = 1,
get = function() return addon.db.profile.cooldown.chargeCooldown.text.fontSize end,
set = function(_, val)
addon.db.profile.cooldown.chargeCooldown.text.fontSize = val
AssistedCombatIconFrame:ApplyOptions()
end,
order = 2,
width = 0.7,
},
fontOutline = {
type = "toggle",
name = "Outline",
desc = "Set the Charge Count font outline option",
get = function() return addon.db.profile.cooldown.chargeCooldown.text.fontOutline end,
set = function(_, val)
addon.db.profile.cooldown.chargeCooldown.text.fontOutline = val
AssistedCombatIconFrame:ApplyOptions()
end,
order = 3,
width = 0.5,
},
fontColor = {
type = "color",
name = "Color",
desc = "Change the text color of the Charge Count text.",
hasAlpha = true,
get = function()
local c = addon.db.profile.cooldown.chargeCooldown.text.fontColor
return c.r, c.g, c.b, c.a
end,
set = function(_, r, g, b, a)
addon.db.profile.cooldown.chargeCooldown.text.fontColor = { r = r, g = g, b = b, a = a }
AssistedCombatIconFrame:ApplyOptions()
end,
order = 4,
width = 0.33,
},
},
},
subgroup2 = {
type = "group",
name = "Position",
inline = true,
order = 3,
args = {
point = {
type = "select",
name = "Anchor",
desc = "Choose the anchor point of the Text",
values = function()
local points = {
["TOPLEFT"] = "TOPLEFT",
["TOP"] = "TOP",
["TOPRIGHT"] = "TOPRIGHT",
["LEFT"] = "LEFT",
["CENTER"] = "CENTER",
["RIGHT"] = "RIGHT",
["BOTTOMLEFT"] = "BOTTOMLEFT",
["BOTTOM"] = "BOTTOM",
["BOTTOMRIGHT"] = "BOTTOMRIGHT",
}
return points
end,
get = function() return addon.db.profile.cooldown.chargeCooldown.text.point end,
set = function(_, val)
addon.db.profile.cooldown.chargeCooldown.text.point = val
AssistedCombatIconFrame:ApplyOptions()
end,
order = 5,
width = 0.8,
},
fontX = {
type = "range",
name = "X Offset",
desc = "Set the X offset from the selected Anchor",
min = -64, max = 64, step = 1,
get = function() return addon.db.profile.cooldown.chargeCooldown.text.X end,
set = function(_, val)
addon.db.profile.cooldown.chargeCooldown.text.X = val
AssistedCombatIconFrame:ApplyOptions()
end,
order = 6,
width = 0.8,
},
fontY = {
type = "range",
name = "Y Offset",
desc = "Set the Y offset from the selected Anchor",
min = -64, max = 64, step = 1,
get = function() return addon.db.profile.cooldown.chargeCooldown.text.Y end,
set = function(_, val)
addon.db.profile.cooldown.chargeCooldown.text.Y = val
AssistedCombatIconFrame:ApplyOptions()
end,
order = 7,
width = 0.8,
},
},
},
},
},
},
}
local keybindOptions = {
type = "group",
name = "Keybind",
inline = false,
order = 4,
args = {
subgroup1 = {
type = "group",
name = "Display",
inline = true,
order = 1,
args = {
font = {
type = "select",
name = "Font",
desc = "Choose the font used for the keybind text",
dialogControl = "LSM30_Font",
values = LSM:HashTable(LSM.MediaType.FONT),
get = function() return addon.db.profile.Keybind.font end,
set = function(_, val)
addon.db.profile.Keybind.font = val
AssistedCombatIconFrame:ApplyOptions()
end,
order = 1,
width = 0.8,
},
fontSize = {
type = "range",
name = "Font Size",
desc = "Set the Keybind font size",
min = 8, max = 100, step = 1,
get = function() return addon.db.profile.Keybind.fontSize end,
set = function(_, val)
addon.db.profile.Keybind.fontSize = val
AssistedCombatIconFrame:ApplyOptions()
end,
order = 2,
width = 0.8,
},
fontOutline = {
type = "toggle",
name = "Outline",
desc = "Set the Keybind font outline",
get = function() return addon.db.profile.Keybind.fontOutline end,
set = function(_, val)
addon.db.profile.Keybind.fontOutline = val
AssistedCombatIconFrame:ApplyOptions()
end,
order = 3,
width = 0.5,
},
fontColor = {
type = "color",
name = "Color",
desc = "Change the text color of the keybind text.",
hasAlpha = true,
get = function()
local c = addon.db.profile.Keybind.fontColor
return c.r, c.g, c.b, c.a
end,
set = function(_, r, g, b, a)
addon.db.profile.Keybind.fontColor = { r = r, g = g, b = b, a = a }
AssistedCombatIconFrame:ApplyOptions()
end,
order = 4,
width = 0.33,
},
},
},
subgroup2 = {
type = "group",
name = "Position",
inline = true,
order = 2,
args = {
point = {
type = "select",
name = "Anchor",
desc = "Choose the anchor point of the text",
values = function()
local points = {
["TOPLEFT"] = "TOPLEFT",
["TOP"] = "TOP",
["TOPRIGHT"] = "TOPRIGHT",
["LEFT"] = "LEFT",
["CENTER"] = "CENTER",
["RIGHT"] = "RIGHT",
["BOTTOMLEFT"] = "BOTTOMLEFT",
["BOTTOM"] = "BOTTOM",
["BOTTOMRIGHT"] = "BOTTOMRIGHT",
}
return points
end,
get = function() return addon.db.profile.Keybind.point end,
set = function(_, val)
addon.db.profile.Keybind.point = val
AssistedCombatIconFrame:ApplyOptions()
end,
order = 5,
width = 0.8,
},
fontX = {
type = "range",
name = "X Offset",
desc = "Set the X offset from the selected Anchor",
min = -64, max = 64, step = 1,
get = function() return addon.db.profile.Keybind.X end,
set = function(_, val)
addon.db.profile.Keybind.X = val
AssistedCombatIconFrame:ApplyOptions()
end,
order = 6,
width = 0.8,
},
fontY = {
type = "range",
name = "Y Offset",
desc = "Set the Y offset from the selected Anchor",
min = -64, max = 64, step = 1,
get = function() return addon.db.profile.Keybind.Y end,
set = function(_, val)
addon.db.profile.Keybind.Y = val
AssistedCombatIconFrame:ApplyOptions()
end,
order = 7,
width = 0.8,
},
},
},
subgroup3 = {
type = "group",
name = "Advanced",
inline = true,
order = 3,
args = {
OverrideGrp = {
type = "group",
name = "Override Text",
inline = true,
order = 1,
args = {
spell = {
type = "select",
name = "Spell",
desc = "Select the spell to override.",
values = function()
local val = {}
local spells = C_AssistedCombat.GetRotationSpells()
for _, spellID in ipairs(spells) do
local spellInfo = C_Spell.GetSpellInfo(spellID)
local icon = ""
if spellInfo and spellInfo.iconID then
icon = ("|T%d:16:16:0:0|t "):format(spellInfo.iconID)
end
val[spellID] = icon ..spellInfo.name
end
return val
end,
get = function() return addon.overrideSpellSelected end,
set = function(_, val)
addon.overrideSpellSelected = val
AceConfigRegistry:NotifyChange(addonName)
end,
order = 1,
width = 1.2,
},
text = {
type = "input",
name = "Override text",
desc = "Enter the text you wish to be shown for the Keybind for this spell.",
get = function() return addon.db.profile.Keybind.overrides[addon.overrideSpellSelected] end,
set = function(_, val) addon.db.profile.Keybind.overrides[addon.overrideSpellSelected] = val ~= "" and val or nil end,
disabled = function() return not addon.overrideSpellSelected end,
order = 2,
width = 1.2,
},
},
},
ConsolePort = {
type = "toggle",
name = "Use ConsolePort GamePad Icons",