-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSimpleBossMods.lua
More file actions
executable file
·1413 lines (1322 loc) · 45.3 KB
/
SimpleBossMods.lua
File metadata and controls
executable file
·1413 lines (1322 loc) · 45.3 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
-- SimpleBossMods.lua (Core)
-- Shared constants, defaults, and utility helpers.
local ADDON_NAME = ...
local M = _G[ADDON_NAME]
if not M then
M = {}
_G[ADDON_NAME] = M
end
M.Const = M.Const or {}
local C = M.Const
local bitBand = (bit and bit.band) or (bit32 and bit32.band)
local function isPlayerInCombat()
if InCombatLockdown and InCombatLockdown() then
return true
end
if UnitAffectingCombat then
return UnitAffectingCombat("player") and true or false
end
return false
end
local LSM = LibStub and LibStub("LibSharedMedia-3.0", true)
M.LSM = LSM
if LSM then
LSM:Register("font", "SBM Expressway", "Interface\\AddOns\\SimpleBossMods\\media\\fonts\\Expressway.ttf")
LSM:Register("statusbar", "SBM Flat", "Interface\\Buttons\\WHITE8X8")
LSM:Register("statusbar", "SBM Default", "Interface\\TARGETINGFRAME\\UI-StatusBar")
end
-- Font
C.FONT_PATH = "Interface\\AddOns\\SimpleBossMods\\media\\fonts\\Expressway.ttf"
C.FONT_FLAGS = "OUTLINE" -- or "THICKOUTLINE"
-- Bar texture (flat)
C.BAR_TEX_DEFAULT = "Interface\\TARGETINGFRAME\\UI-StatusBar"
-- Defaults
C.THRESHOLD_TO_BAR = 5.0
C.ICON_ZOOM = 0.10
C.ICONS_PER_ROW = 6
C.TICK_INTERVAL = 0.20
-- Move everything slightly up (requested)
C.GLOBAL_Y_NUDGE = 0.1
-- Manual timers
C.PULL_ICON = "Interface\\Icons\\Ability_Warrior_Charge"
C.BREAK_ICON = "Interface\\Icons\\INV_Misc_DeliciousPizza"
C.PULL_LABEL = "Pull"
C.BREAK_LABEL = "Break"
-- State icons (large icon overlays)
C.PAUSE_STATE_ICON = "Interface\\AddOns\\SimpleBossMods\\media\\icons\\pause.png"
C.BLOCKED_STATE_ICON = "Interface\\AddOns\\SimpleBossMods\\media\\icons\\dnd.png"
-- Indicators
C.INDICATOR_MAX = 6
C.INDICATOR_MASK = 1023 -- all bits
-- Private aura anchor slots (max icons in the group)
C.PRIVATE_AURA_MAX = 8
-- Bars: indicator icons outside to the right
C.BAR_END_INDICATOR_GAP_X = 6
-- Default bar colors
C.BAR_FG_R, C.BAR_FG_G, C.BAR_FG_B, C.BAR_FG_A = (255/255), (152/255), (0/255), 1.0
C.BAR_BG_R, C.BAR_BG_G, C.BAR_BG_B, C.BAR_BG_A = 0.0, 0.0, 0.0, 0.90
local INDICATOR_PRIORITY_GROUP_DEFAULT = {
"playerRole",
"dispels",
"roles",
"other",
"severity",
}
M.Defaults = M.Defaults or {
cfg = {
general = {
gap = 8,
autoInsertKeystone = false,
thresholdToBar = C.THRESHOLD_TO_BAR,
useRecommendedTimelineSettings = true,
animateIcons = true,
animateBars = true,
indicatorColors = {
deadly = { r = (239 / 255), g = (11 / 255), b = (30 / 255), a = 1.0 },
enrage = { r = (239 / 255), g = (11 / 255), b = (30 / 255), a = 1.0 },
bleed = { r = (255 / 255), g = (2 / 255), b = (31 / 255), a = 1.0 },
magic = { r = (0 / 255), g = (126 / 255), b = (240 / 255), a = 1.0 },
disease = { r = (77 / 255), g = (179 / 255), b = (51 / 255), a = 1.0 },
curse = { r = (166 / 255), g = (44 / 255), b = (234 / 255), a = 1.0 },
poison = { r = (245 / 255), g = (255 / 255), b = (15 / 255), a = 1.0 },
tank = { r = (198 / 255), g = (183 / 255), b = (156 / 255), a = 1.0 },
healer = { r = (36 / 255), g = (213 / 255), b = (2 / 255), a = 1.0 },
dps = { r = (162 / 255), g = (162 / 255), b = (186 / 255), a = 1.0 },
severitylow = { r = 0.95, g = 0.82, b = 0.20, a = 1.0 },
severitymedium = { r = 0.95, g = 0.48, b = 0.12, a = 1.0 },
severityhigh = { r = 0.90, g = 0.15, b = 0.15, a = 1.0 },
},
useDispelColors = true,
useRoleColors = true,
useOtherColors = true,
usePlayerRoleColor = false,
useSeverityColors = false,
useIconBorderColors = false,
indicatorPriorityGroups = {
"playerRole",
"dispels",
"roles",
"other",
"severity",
},
useCustomPlayerRoleColor = false,
customPlayerRoleColor = { r = 1.0, g = 0.84, b = 0.0, a = 1.0 },
font = "SBM Expressway",
},
icons = {
enabled = true,
size = 64,
fontSize = 32,
borderThickness = 2,
font = "SBM Expressway",
gap = 8,
perRow = C.ICONS_PER_ROW,
limit = 0,
anchorFrom = "TOPLEFT",
anchorTo = "CENTER",
anchorParent = "NONE",
customParent = "",
x = 300,
y = 0,
growDirection = "RIGHT_DOWN",
},
bars = {
width = 352,
height = 36,
fontSize = 16,
borderThickness = 2,
swapIconSide = false,
swapIndicatorSide = false,
hideIcon = false,
hideIndicators = false,
texture = "Dragonflight",
anchorFrom = "BOTTOMLEFT",
anchorTo = "TOPLEFT",
anchorParent = "SimpleBossMods_Icons",
customParent = "",
x = 0,
y = 8,
growDirection = "UP",
sortAscending = true,
fillDirection = "LEFT",
color = {
r = C.BAR_FG_R,
g = C.BAR_FG_G,
b = C.BAR_FG_B,
a = C.BAR_FG_A,
},
bgColor = {
r = C.BAR_BG_R,
g = C.BAR_BG_G,
b = C.BAR_BG_B,
a = C.BAR_BG_A,
},
},
indicators = { iconSize = 13, barSize = 24 },
privateAuras = {
enabled = true,
size = 48,
gap = 6,
growDirection = "RIGHT",
x = 0,
y = -8,
anchorFrom = "TOPLEFT",
anchorTo = "BOTTOMLEFT",
anchorParent = "SimpleBossMods_Icons",
customParent = "",
},
combatTimer = {
enabled = false,
x = 0,
y = -8,
anchorFrom = "TOPLEFT",
anchorTo = "BOTTOMLEFT",
anchorParent = "SimpleBossMods_PrivateAuras",
customParent = "",
font = "SBM Expressway",
fontSize = 18,
color = { r = 1, g = 1, b = 1, a = 1 },
borderColor = { r = 0, g = 0, b = 0, a = 1 },
bgColor = { r = 0, g = 0, b = 0, a = 0.8 },
},
},
}
local GENERAL_INDICATOR_COLOR_KEYS = {
"deadly",
"enrage",
"bleed",
"magic",
"disease",
"curse",
"poison",
"tank",
"healer",
"dps",
"severitylow",
"severitymedium",
"severityhigh",
}
M.IndicatorColorKeys = GENERAL_INDICATOR_COLOR_KEYS
local INDICATOR_PRIORITY_GROUP_SET = {
playerRole = true,
dispels = true,
roles = true,
other = true,
severity = true,
}
local function normalizeIndicatorPriorityGroups(groups)
local out = {}
local seen = {}
if type(groups) == "table" then
for _, key in ipairs(groups) do
if type(key) == "string" and INDICATOR_PRIORITY_GROUP_SET[key] and not seen[key] then
seen[key] = true
out[#out + 1] = key
end
end
end
for _, key in ipairs(INDICATOR_PRIORITY_GROUP_DEFAULT) do
if not seen[key] then
out[#out + 1] = key
end
end
return out
end
M.NormalizeIndicatorPriorityGroups = normalizeIndicatorPriorityGroups
M.IndicatorPriorityGroupDefault = INDICATOR_PRIORITY_GROUP_DEFAULT
function M:EnsureDefaults()
SimpleBossModsDB = SimpleBossModsDB or {}
SimpleBossModsDB.cfg = SimpleBossModsDB.cfg or {}
SimpleBossModsDB.manualTimers = SimpleBossModsDB.manualTimers or {}
-- Legacy cache cleanup
if SimpleBossModsDB.encounterEventCache then SimpleBossModsDB.encounterEventCache = nil end
if SimpleBossModsDB.spellCache then SimpleBossModsDB.spellCache = nil end
if SimpleBossModsDB.cacheBuild then SimpleBossModsDB.cacheBuild = nil end
if SimpleBossModsDB.encounterEventSets then SimpleBossModsDB.encounterEventSets = nil end
if SimpleBossModsDB.encounterSpellMask then SimpleBossModsDB.encounterSpellMask = nil end
local cfg = SimpleBossModsDB.cfg
cfg.general = cfg.general or {
gap = M.Defaults.cfg.general.gap,
autoInsertKeystone = M.Defaults.cfg.general.autoInsertKeystone,
thresholdToBar = M.Defaults.cfg.general.thresholdToBar,
useRecommendedTimelineSettings = M.Defaults.cfg.general.useRecommendedTimelineSettings,
animateIcons = M.Defaults.cfg.general.animateIcons,
animateBars = M.Defaults.cfg.general.animateBars,
}
local function approx(a, b)
if type(a) ~= "number" or type(b) ~= "number" then return false end
return math.abs(a - b) < 0.0001
end
local function repairColor(color, defR, defG, defB, defA)
if type(color.r) ~= "number" then color.r = defR end
if type(color.g) ~= "number" then color.g = defG end
if type(color.b) ~= "number" then color.b = defB end
if type(color.a) ~= "number" then color.a = defA end
if color.a == 0 and approx(color.r, defR) and approx(color.g, defG) and approx(color.b, defB) then
color.a = defA
end
end
if cfg.general.autoInsertKeystone == nil then
cfg.general.autoInsertKeystone = M.Defaults.cfg.general.autoInsertKeystone
end
if cfg.general.thresholdToBar == nil then
cfg.general.thresholdToBar = M.Defaults.cfg.general.thresholdToBar
end
if cfg.general.useRecommendedTimelineSettings == nil then
local legacyConnectors = cfg.connectors
if type(legacyConnectors) == "table" and legacyConnectors.useRecommendedSettings ~= nil then
cfg.general.useRecommendedTimelineSettings = legacyConnectors.useRecommendedSettings ~= false
else
cfg.general.useRecommendedTimelineSettings = M.Defaults.cfg.general.useRecommendedTimelineSettings
end
else
cfg.general.useRecommendedTimelineSettings = cfg.general.useRecommendedTimelineSettings and true or false
end
if cfg.general.animateIcons == nil then
cfg.general.animateIcons = M.Defaults.cfg.general.animateIcons
else
cfg.general.animateIcons = cfg.general.animateIcons and true or false
end
if cfg.general.animateBars == nil then
cfg.general.animateBars = M.Defaults.cfg.general.animateBars
else
cfg.general.animateBars = cfg.general.animateBars and true or false
end
if cfg.general.font == nil then
cfg.general.font = M.Defaults.cfg.general.font
end
if cfg.general.useDispelColors == nil then
cfg.general.useDispelColors = M.Defaults.cfg.general.useDispelColors
end
if cfg.general.useRoleColors == nil then
cfg.general.useRoleColors = M.Defaults.cfg.general.useRoleColors
end
if cfg.general.useOtherColors == nil then
cfg.general.useOtherColors = M.Defaults.cfg.general.useOtherColors
end
if cfg.general.usePlayerRoleColor == nil then
cfg.general.usePlayerRoleColor = M.Defaults.cfg.general.usePlayerRoleColor
end
if cfg.general.useSeverityColors == nil then
cfg.general.useSeverityColors = M.Defaults.cfg.general.useSeverityColors
end
if cfg.general.useIconBorderColors == nil then
cfg.general.useIconBorderColors = M.Defaults.cfg.general.useIconBorderColors
end
cfg.general.indicatorPriorityGroups = normalizeIndicatorPriorityGroups(cfg.general.indicatorPriorityGroups)
if cfg.general.prioritizePlayerRole ~= nil then
cfg.general.prioritizePlayerRole = nil
end
if cfg.general.useCustomPlayerRoleColor == nil then
cfg.general.useCustomPlayerRoleColor = M.Defaults.cfg.general.useCustomPlayerRoleColor
end
cfg.general.customPlayerRoleColor = cfg.general.customPlayerRoleColor or {
r = M.Defaults.cfg.general.customPlayerRoleColor.r,
g = M.Defaults.cfg.general.customPlayerRoleColor.g,
b = M.Defaults.cfg.general.customPlayerRoleColor.b,
a = M.Defaults.cfg.general.customPlayerRoleColor.a,
}
repairColor(cfg.general.customPlayerRoleColor, M.Defaults.cfg.general.customPlayerRoleColor.r, M.Defaults.cfg.general.customPlayerRoleColor.g, M.Defaults.cfg.general.customPlayerRoleColor.b, M.Defaults.cfg.general.customPlayerRoleColor.a)
cfg.general.indicatorColors = cfg.general.indicatorColors or {}
cfg.icons = cfg.icons or {
size = M.Defaults.cfg.icons.size,
fontSize = M.Defaults.cfg.icons.fontSize,
borderThickness = M.Defaults.cfg.icons.borderThickness,
enabled = M.Defaults.cfg.icons.enabled,
gap = M.Defaults.cfg.icons.gap,
perRow = M.Defaults.cfg.icons.perRow,
limit = M.Defaults.cfg.icons.limit,
anchorFrom = M.Defaults.cfg.icons.anchorFrom,
anchorTo = M.Defaults.cfg.icons.anchorTo,
anchorParent = M.Defaults.cfg.icons.anchorParent,
customParent = M.Defaults.cfg.icons.customParent,
x = M.Defaults.cfg.icons.x,
y = M.Defaults.cfg.icons.y,
growDirection = M.Defaults.cfg.icons.growDirection,
}
if cfg.icons.enabled == nil then
cfg.icons.enabled = M.Defaults.cfg.icons.enabled
end
if cfg.icons.gap == nil then
cfg.icons.gap = M.Defaults.cfg.icons.gap
end
if cfg.icons.perRow == nil then
cfg.icons.perRow = M.Defaults.cfg.icons.perRow
end
if cfg.icons.limit == nil then
cfg.icons.limit = M.Defaults.cfg.icons.limit
end
if cfg.icons.anchorFrom == nil then
cfg.icons.anchorFrom = M.Defaults.cfg.icons.anchorFrom
end
if cfg.icons.anchorTo == nil then
cfg.icons.anchorTo = M.Defaults.cfg.icons.anchorTo
end
if cfg.icons.anchorParent == nil then
cfg.icons.anchorParent = M.Defaults.cfg.icons.anchorParent
end
if cfg.icons.customParent == nil then
cfg.icons.customParent = M.Defaults.cfg.icons.customParent
end
if cfg.icons.x == nil then
cfg.icons.x = M.Defaults.cfg.icons.x
end
if cfg.icons.y == nil then
cfg.icons.y = M.Defaults.cfg.icons.y
end
if cfg.icons.growDirection == nil then
cfg.icons.growDirection = M.Defaults.cfg.icons.growDirection
end
if cfg.icons.font == nil then
cfg.icons.font = cfg.general.font or M.Defaults.cfg.icons.font
end
do
local dir = cfg.icons.growDirection
if type(dir) ~= "string" then
dir = M.Defaults.cfg.icons.growDirection
end
dir = dir:upper():gsub("%s+", "_")
if dir == "BOTTOM_DOWN" then
dir = "LEFT_DOWN"
elseif dir == "BOTTOM_UP" then
dir = "LEFT_UP"
end
if dir ~= "LEFT_DOWN" and dir ~= "LEFT_UP" and dir ~= "RIGHT_DOWN" and dir ~= "RIGHT_UP" then
dir = M.Defaults.cfg.icons.growDirection
end
cfg.icons.growDirection = dir
end
cfg.bars = cfg.bars or {
width = M.Defaults.cfg.bars.width,
height = M.Defaults.cfg.bars.height,
fontSize = M.Defaults.cfg.bars.fontSize,
borderThickness = M.Defaults.cfg.bars.borderThickness,
swapIconSide = M.Defaults.cfg.bars.swapIconSide,
swapIndicatorSide = M.Defaults.cfg.bars.swapIndicatorSide,
hideIcon = M.Defaults.cfg.bars.hideIcon,
hideIndicators = M.Defaults.cfg.bars.hideIndicators,
anchorFrom = M.Defaults.cfg.bars.anchorFrom,
anchorTo = M.Defaults.cfg.bars.anchorTo,
anchorParent = M.Defaults.cfg.bars.anchorParent,
customParent = M.Defaults.cfg.bars.customParent,
x = M.Defaults.cfg.bars.x,
y = M.Defaults.cfg.bars.y,
growDirection = M.Defaults.cfg.bars.growDirection,
sortAscending = M.Defaults.cfg.bars.sortAscending,
fillDirection = M.Defaults.cfg.bars.fillDirection,
}
if cfg.bars.swapIconSide == nil then
cfg.bars.swapIconSide = M.Defaults.cfg.bars.swapIconSide
end
if cfg.bars.swapIndicatorSide == nil then
cfg.bars.swapIndicatorSide = M.Defaults.cfg.bars.swapIndicatorSide
end
if cfg.bars.hideIcon == nil then
cfg.bars.hideIcon = M.Defaults.cfg.bars.hideIcon
end
if cfg.bars.hideIndicators == nil then
cfg.bars.hideIndicators = M.Defaults.cfg.bars.hideIndicators
end
if cfg.bars.anchorFrom == nil then
cfg.bars.anchorFrom = M.Defaults.cfg.bars.anchorFrom
end
if cfg.bars.anchorTo == nil then
cfg.bars.anchorTo = M.Defaults.cfg.bars.anchorTo
end
if cfg.bars.anchorParent == nil then
cfg.bars.anchorParent = M.Defaults.cfg.bars.anchorParent
end
if cfg.bars.customParent == nil then
cfg.bars.customParent = M.Defaults.cfg.bars.customParent
end
if cfg.bars.x == nil then
cfg.bars.x = M.Defaults.cfg.bars.x
end
if cfg.bars.y == nil then
cfg.bars.y = M.Defaults.cfg.bars.y
end
if cfg.bars.growDirection == nil then
cfg.bars.growDirection = M.Defaults.cfg.bars.growDirection
end
if cfg.bars.sortAscending == nil then
cfg.bars.sortAscending = M.Defaults.cfg.bars.sortAscending
end
if cfg.bars.fillDirection == nil then
cfg.bars.fillDirection = M.Defaults.cfg.bars.fillDirection
end
if cfg.bars.texture == nil then
cfg.bars.texture = M.Defaults.cfg.bars.texture
end
cfg.bars.color = cfg.bars.color or {
r = M.Defaults.cfg.bars.color.r,
g = M.Defaults.cfg.bars.color.g,
b = M.Defaults.cfg.bars.color.b,
a = M.Defaults.cfg.bars.color.a,
}
cfg.bars.bgColor = cfg.bars.bgColor or {
r = M.Defaults.cfg.bars.bgColor.r,
g = M.Defaults.cfg.bars.bgColor.g,
b = M.Defaults.cfg.bars.bgColor.b,
a = M.Defaults.cfg.bars.bgColor.a,
}
repairColor(cfg.bars.bgColor, M.Defaults.cfg.bars.bgColor.r, M.Defaults.cfg.bars.bgColor.g, M.Defaults.cfg.bars.bgColor.b, M.Defaults.cfg.bars.bgColor.a)
for _, key in ipairs(GENERAL_INDICATOR_COLOR_KEYS) do
local defaults = M.Defaults.cfg.general.indicatorColors[key]
if type(cfg.general.indicatorColors[key]) ~= "table" then
cfg.general.indicatorColors[key] = {
r = defaults.r,
g = defaults.g,
b = defaults.b,
a = defaults.a,
}
end
repairColor(cfg.general.indicatorColors[key], defaults.r, defaults.g, defaults.b, defaults.a)
end
if cfg.colors then
cfg.colors = nil
end
cfg.indicators = cfg.indicators or {
iconSize = M.Defaults.cfg.indicators.iconSize,
barSize = M.Defaults.cfg.indicators.barSize,
}
if cfg.indicators.iconSize == nil then
cfg.indicators.iconSize = M.Defaults.cfg.indicators.iconSize
end
if cfg.indicators.barSize == nil then
cfg.indicators.barSize = M.Defaults.cfg.indicators.barSize
end
cfg.privateAuras = cfg.privateAuras or {
enabled = M.Defaults.cfg.privateAuras.enabled,
size = M.Defaults.cfg.privateAuras.size,
gap = M.Defaults.cfg.privateAuras.gap,
growDirection = M.Defaults.cfg.privateAuras.growDirection,
x = M.Defaults.cfg.privateAuras.x,
y = M.Defaults.cfg.privateAuras.y,
anchorFrom = M.Defaults.cfg.privateAuras.anchorFrom,
anchorTo = M.Defaults.cfg.privateAuras.anchorTo,
anchorParent = M.Defaults.cfg.privateAuras.anchorParent,
customParent = M.Defaults.cfg.privateAuras.customParent,
}
if cfg.privateAuras.size == nil then
cfg.privateAuras.size = M.Defaults.cfg.privateAuras.size
end
if cfg.privateAuras.enabled == nil then
cfg.privateAuras.enabled = M.Defaults.cfg.privateAuras.enabled
end
if cfg.privateAuras.gap == nil then
cfg.privateAuras.gap = M.Defaults.cfg.privateAuras.gap
end
if cfg.privateAuras.x == nil then
cfg.privateAuras.x = M.Defaults.cfg.privateAuras.x
end
if cfg.privateAuras.y == nil then
cfg.privateAuras.y = M.Defaults.cfg.privateAuras.y
end
if cfg.privateAuras.anchorFrom == nil then
cfg.privateAuras.anchorFrom = M.Defaults.cfg.privateAuras.anchorFrom
end
if cfg.privateAuras.anchorTo == nil then
cfg.privateAuras.anchorTo = M.Defaults.cfg.privateAuras.anchorTo
end
if cfg.privateAuras.anchorParent == nil then
cfg.privateAuras.anchorParent = M.Defaults.cfg.privateAuras.anchorParent
end
if cfg.privateAuras.customParent == nil then
cfg.privateAuras.customParent = M.Defaults.cfg.privateAuras.customParent
end
cfg.privateAuras.sound = nil
cfg.privateAuras.soundKitID = nil
cfg.privateAuras.soundChannel = nil
cfg.privateAuras.font = nil
cfg.privateAuras.fontSize = nil
cfg.privateAuras.stackFontSize = nil
do
local dir = cfg.privateAuras.growDirection
if type(dir) ~= "string" then
dir = M.Defaults.cfg.privateAuras.growDirection
end
dir = dir:upper()
if dir ~= "LEFT" and dir ~= "RIGHT" and dir ~= "UP" and dir ~= "DOWN" then
dir = M.Defaults.cfg.privateAuras.growDirection
end
cfg.privateAuras.growDirection = dir
end
cfg.combatTimer = cfg.combatTimer or {
enabled = M.Defaults.cfg.combatTimer.enabled,
x = M.Defaults.cfg.combatTimer.x,
y = M.Defaults.cfg.combatTimer.y,
font = M.Defaults.cfg.combatTimer.font,
fontSize = M.Defaults.cfg.combatTimer.fontSize,
}
if cfg.combatTimer.enabled == nil then
cfg.combatTimer.enabled = M.Defaults.cfg.combatTimer.enabled
end
if cfg.combatTimer.anchorFrom == nil then
cfg.combatTimer.anchorFrom = M.Defaults.cfg.combatTimer.anchorFrom
end
if cfg.combatTimer.anchorTo == nil then
cfg.combatTimer.anchorTo = M.Defaults.cfg.combatTimer.anchorTo
end
if cfg.combatTimer.anchorParent == nil then
cfg.combatTimer.anchorParent = M.Defaults.cfg.combatTimer.anchorParent
end
if cfg.combatTimer.customParent == nil then
cfg.combatTimer.customParent = M.Defaults.cfg.combatTimer.customParent
end
if cfg.combatTimer.font == nil then
cfg.combatTimer.font = cfg.general.font or M.Defaults.cfg.combatTimer.font
end
if cfg.combatTimer.fontSize == nil then
cfg.combatTimer.fontSize = M.Defaults.cfg.combatTimer.fontSize
end
if cfg.combatTimer.x == nil then
cfg.combatTimer.x = M.Defaults.cfg.combatTimer.x
end
if cfg.combatTimer.y == nil then
cfg.combatTimer.y = M.Defaults.cfg.combatTimer.y
end
if cfg.combatTimer.anchorParent == "SimpleBossMods_Anchor"
and cfg.combatTimer.anchorFrom == "LEFT"
and cfg.combatTimer.anchorTo == "RIGHT"
and cfg.combatTimer.x == -80
and cfg.combatTimer.y == 0 then
cfg.combatTimer.anchorParent = "SimpleBossMods_PrivateAuras"
cfg.combatTimer.anchorFrom = "TOPLEFT"
cfg.combatTimer.anchorTo = "BOTTOMLEFT"
cfg.combatTimer.x = 0
cfg.combatTimer.y = 0
end
cfg.combatTimer.color = cfg.combatTimer.color or {
r = M.Defaults.cfg.combatTimer.color.r,
g = M.Defaults.cfg.combatTimer.color.g,
b = M.Defaults.cfg.combatTimer.color.b,
a = M.Defaults.cfg.combatTimer.color.a,
}
cfg.combatTimer.borderColor = cfg.combatTimer.borderColor or {
r = M.Defaults.cfg.combatTimer.borderColor.r,
g = M.Defaults.cfg.combatTimer.borderColor.g,
b = M.Defaults.cfg.combatTimer.borderColor.b,
a = M.Defaults.cfg.combatTimer.borderColor.a,
}
cfg.combatTimer.bgColor = cfg.combatTimer.bgColor or {
r = M.Defaults.cfg.combatTimer.bgColor.r,
g = M.Defaults.cfg.combatTimer.bgColor.g,
b = M.Defaults.cfg.combatTimer.bgColor.b,
a = M.Defaults.cfg.combatTimer.bgColor.a,
}
repairColor(cfg.combatTimer.color, M.Defaults.cfg.combatTimer.color.r, M.Defaults.cfg.combatTimer.color.g, M.Defaults.cfg.combatTimer.color.b, M.Defaults.cfg.combatTimer.color.a)
repairColor(cfg.combatTimer.borderColor, M.Defaults.cfg.combatTimer.borderColor.r, M.Defaults.cfg.combatTimer.borderColor.g, M.Defaults.cfg.combatTimer.borderColor.b, M.Defaults.cfg.combatTimer.borderColor.a)
repairColor(cfg.combatTimer.bgColor, M.Defaults.cfg.combatTimer.bgColor.r, M.Defaults.cfg.combatTimer.bgColor.g, M.Defaults.cfg.combatTimer.bgColor.b, M.Defaults.cfg.combatTimer.bgColor.a)
end
M.Live = M.Live or {}
local L = M.Live
M.Util = M.Util or {}
local U = M.Util
M.events = M.events or {}
function U.clamp(v, lo, hi)
if type(issecretvalue) == "function" then
local vSecret = issecretvalue(v)
local loSecret = issecretvalue(lo)
local hiSecret = issecretvalue(hi)
if vSecret or loSecret or hiSecret then
if type(lo) == "number" and not loSecret then
return lo
end
if type(hi) == "number" and not hiSecret then
return hi
end
if type(v) == "number" and not vSecret then
return v
end
return 0
end
end
if type(v) ~= "number" then
v = tonumber(v) or 0
end
if type(lo) ~= "number" then
lo = tonumber(lo) or v
end
if type(hi) ~= "number" then
hi = tonumber(hi) or v
end
if v < lo then return lo end
if v > hi then return hi end
return v
end
function U.round(v)
v = tonumber(v) or 0
if v >= 0 then return math.floor(v + 0.5) end
return math.ceil(v - 0.5)
end
local function normalizeAnchorPoint(point)
if type(point) ~= "string" then return "CENTER" end
point = point:upper()
if point == "TOPLEFT" or point == "TOP" or point == "TOPRIGHT"
or point == "LEFT" or point == "CENTER" or point == "RIGHT"
or point == "BOTTOMLEFT" or point == "BOTTOM" or point == "BOTTOMRIGHT" then
return point
end
return "CENTER"
end
function M.SyncLiveConfig()
local gc = SimpleBossModsDB.cfg.general
local ic = SimpleBossModsDB.cfg.icons
local bc = SimpleBossModsDB.cfg.bars
local inc = SimpleBossModsDB.cfg.indicators
local pc = SimpleBossModsDB.cfg.privateAuras or M.Defaults.cfg.privateAuras
local ct = SimpleBossModsDB.cfg.combatTimer or M.Defaults.cfg.combatTimer
L.PRIVATE_AURA_ENABLED = pc.enabled ~= false
L.TIMELINE_USE_RECOMMENDED_SETTINGS = gc.useRecommendedTimelineSettings ~= false
L.ANIMATE_ICONS = gc.animateIcons ~= false
L.ANIMATE_BARS = gc.animateBars ~= false
do
local indicatorColors = gc.indicatorColors or M.Defaults.cfg.general.indicatorColors
for _, key in ipairs(GENERAL_INDICATOR_COLOR_KEYS) do
local defaults = M.Defaults.cfg.general.indicatorColors[key] or {}
local color = indicatorColors[key] or defaults
color = color or defaults
local upper = key:upper()
local prefix = "INDICATOR_COLOR_" .. upper .. "_"
local r = tonumber(color.r) or defaults.r
local g = tonumber(color.g) or defaults.g
local b = tonumber(color.b) or defaults.b
local a = tonumber(color.a) or defaults.a
L[prefix .. "R"] = U.clamp(r, 0, 1)
L[prefix .. "G"] = U.clamp(g, 0, 1)
L[prefix .. "B"] = U.clamp(b, 0, 1)
L[prefix .. "A"] = U.clamp(a, 0, 1)
end
L.USE_DISPEL_COLORS = gc.useDispelColors ~= false
L.USE_ROLE_COLORS = gc.useRoleColors ~= false
L.USE_OTHER_COLORS = gc.useOtherColors ~= false
L.USE_PLAYER_ROLE_COLOR = gc.usePlayerRoleColor ~= false
L.USE_SEVERITY_COLORS = gc.useSeverityColors ~= false
L.USE_ICON_BORDER_COLORS = gc.useIconBorderColors and true or false
local groups = normalizeIndicatorPriorityGroups(gc.indicatorPriorityGroups)
gc.indicatorPriorityGroups = groups
L.INDICATOR_PRIORITY_GROUPS = groups
L.USE_CUSTOM_PLAYER_ROLE_COLOR = gc.useCustomPlayerRoleColor and true or false
local crc = gc.customPlayerRoleColor or M.Defaults.cfg.general.customPlayerRoleColor
L.CUSTOM_PLAYER_ROLE_COLOR_R = U.clamp(tonumber(crc.r) or 1.0, 0, 1)
L.CUSTOM_PLAYER_ROLE_COLOR_G = U.clamp(tonumber(crc.g) or 0.84, 0, 1)
L.CUSTOM_PLAYER_ROLE_COLOR_B = U.clamp(tonumber(crc.b) or 0.0, 0, 1)
L.CUSTOM_PLAYER_ROLE_COLOR_A = U.clamp(tonumber(crc.a) or 1.0, 0, 1)
end
L.GAP = tonumber(gc.gap) or 6
L.AUTO_INSERT_KEYSTONE = gc.autoInsertKeystone and true or false
L.THRESHOLD_TO_BAR = U.clamp(tonumber(gc.thresholdToBar) or C.THRESHOLD_TO_BAR, 0, 600)
L.ICONS_ENABLED = ic.enabled ~= false
L.ICON_SIZE = ic.size
L.ICON_FONT_SIZE = ic.fontSize
L.ICON_BORDER_THICKNESS = ic.borderThickness
L.ICON_GAP = U.clamp(U.round(tonumber(ic.gap) or M.Defaults.cfg.icons.gap), -50, 50)
L.ICONS_PER_ROW = U.clamp(U.round(tonumber(ic.perRow) or C.ICONS_PER_ROW), 1, 20)
L.ICONS_LIMIT = U.clamp(U.round(tonumber(ic.limit) or 0), 0, 200)
do
local dir = ic.growDirection
if type(dir) ~= "string" then
dir = M.Defaults.cfg.icons.growDirection
end
dir = dir:upper():gsub("%s+", "_")
if dir == "BOTTOM_DOWN" then
dir = "LEFT_DOWN"
elseif dir == "BOTTOM_UP" then
dir = "LEFT_UP"
end
if dir ~= "LEFT_DOWN" and dir ~= "LEFT_UP" and dir ~= "RIGHT_DOWN" and dir ~= "RIGHT_UP" then
dir = M.Defaults.cfg.icons.growDirection
end
L.ICON_GROW_DIR = dir
end
L.ICON_ANCHOR_FROM = normalizeAnchorPoint(ic.anchorFrom)
L.ICON_ANCHOR_TO = normalizeAnchorPoint(ic.anchorTo)
L.ICON_ANCHOR_PARENT = (type(ic.anchorParent) == "string" and ic.anchorParent ~= "") and ic.anchorParent or "NONE"
do
local customParent = nil
if type(ic.customParent) == "string" then
customParent = ic.customParent:gsub("^%s+", ""):gsub("%s+$", "")
if customParent == "" then
customParent = nil
end
end
L.ICON_ANCHOR_CUSTOM_PARENT = customParent
if customParent then
L.ICON_PARENT_NAME = customParent
elseif L.ICON_ANCHOR_PARENT ~= "NONE" then
L.ICON_PARENT_NAME = L.ICON_ANCHOR_PARENT
else
L.ICON_PARENT_NAME = nil
end
end
L.ICON_ANCHOR_X = tonumber(ic.x) or 0
L.ICON_ANCHOR_Y = tonumber(ic.y) or 0
L.ICON_FONT_KEY = ic.font or M.Defaults.cfg.icons.font
L.ICON_FONT_PATH = C.FONT_PATH
if LSM then
L.ICON_FONT_PATH = LSM:Fetch("font", L.ICON_FONT_KEY) or C.FONT_PATH
end
L.BAR_WIDTH = bc.width
L.BAR_HEIGHT = bc.height
L.BAR_FONT_SIZE = bc.fontSize
L.BAR_BORDER_THICKNESS = bc.borderThickness
L.BAR_ICON_SWAP = bc.swapIconSide and true or false
L.BAR_INDICATOR_SWAP = bc.swapIndicatorSide and true or false
L.BAR_ICON_HIDDEN = bc.hideIcon and true or false
L.BAR_INDICATOR_HIDDEN = bc.hideIndicators and true or false
do
local dir = bc.growDirection
if type(dir) ~= "string" then
dir = M.Defaults.cfg.bars.growDirection
end
dir = dir:upper()
if dir ~= "UP" and dir ~= "DOWN" then
dir = M.Defaults.cfg.bars.growDirection
end
L.BAR_GROW_DIR = dir
end
L.BAR_SORT_ASC = bc.sortAscending and true or false
do
local fill = bc.fillDirection
if type(fill) ~= "string" then
fill = M.Defaults.cfg.bars.fillDirection
end
fill = fill:upper()
if fill ~= "LEFT" and fill ~= "RIGHT" then
fill = M.Defaults.cfg.bars.fillDirection
end
L.BAR_FILL_DIR = fill
end
L.BAR_FILL_REVERSE = (L.BAR_FILL_DIR == "RIGHT")
do
local indicatorOnLeft = L.BAR_FILL_REVERSE
if L.BAR_INDICATOR_SWAP then
indicatorOnLeft = not indicatorOnLeft
end
L.BAR_INDICATOR_ON_LEFT = indicatorOnLeft
end
L.FONT_KEY = gc.font or M.Defaults.cfg.general.font
L.FONT_PATH = C.FONT_PATH
if LSM then
L.FONT_PATH = LSM:Fetch("font", L.FONT_KEY) or C.FONT_PATH
end
L.BAR_ANCHOR_FROM = normalizeAnchorPoint(bc.anchorFrom)
L.BAR_ANCHOR_TO = normalizeAnchorPoint(bc.anchorTo)
L.BAR_ANCHOR_PARENT = (type(bc.anchorParent) == "string" and bc.anchorParent ~= "") and bc.anchorParent or "NONE"
do
local customParent = nil
if type(bc.customParent) == "string" then
customParent = bc.customParent:gsub("^%s+", ""):gsub("%s+$", "")
if customParent == "" then
customParent = nil
end
end
L.BAR_ANCHOR_CUSTOM_PARENT = customParent
if customParent then
L.BAR_PARENT_NAME = customParent
elseif L.BAR_ANCHOR_PARENT ~= "NONE" then
L.BAR_PARENT_NAME = L.BAR_ANCHOR_PARENT
else
L.BAR_PARENT_NAME = nil
end
end
L.BAR_ANCHOR_X = tonumber(bc.x) or 0
L.BAR_ANCHOR_Y = tonumber(bc.y) or 0
L.BAR_TEX_KEY = bc.texture or M.Defaults.cfg.bars.texture
L.BAR_TEX = C.BAR_TEX_DEFAULT
if LSM then
L.BAR_TEX = LSM:Fetch("statusbar", L.BAR_TEX_KEY) or C.BAR_TEX_DEFAULT
end
local barColor = bc.color or {}
L.BAR_FG_R = U.clamp(tonumber(barColor.r) or C.BAR_FG_R, 0, 1)
L.BAR_FG_G = U.clamp(tonumber(barColor.g) or C.BAR_FG_G, 0, 1)
L.BAR_FG_B = U.clamp(tonumber(barColor.b) or C.BAR_FG_B, 0, 1)
L.BAR_FG_A = U.clamp(tonumber(barColor.a) or C.BAR_FG_A, 0, 1)
local barBg = bc.bgColor or {}
L.BAR_BG_R = U.clamp(tonumber(barBg.r) or C.BAR_BG_R, 0, 1)
L.BAR_BG_G = U.clamp(tonumber(barBg.g) or C.BAR_BG_G, 0, 1)
L.BAR_BG_B = U.clamp(tonumber(barBg.b) or C.BAR_BG_B, 0, 1)
L.BAR_BG_A = U.clamp(tonumber(barBg.a) or C.BAR_BG_A, 0, 1)
L.ICON_INDICATOR_SIZE = tonumber(inc.iconSize) or 0
L.BAR_INDICATOR_SIZE = tonumber(inc.barSize) or 0
L.PRIVATE_AURA_SIZE = U.clamp(U.round(tonumber(pc.size) or M.Defaults.cfg.privateAuras.size), 16, 128)
L.PRIVATE_AURA_GAP = U.clamp(U.round(tonumber(pc.gap) or 0), 0, 50)
do
local dir = pc.growDirection
if type(dir) ~= "string" then
dir = M.Defaults.cfg.privateAuras.growDirection
end
dir = dir:upper()
if dir ~= "LEFT" and dir ~= "RIGHT" and dir ~= "UP" and dir ~= "DOWN" then
dir = M.Defaults.cfg.privateAuras.growDirection
end
L.PRIVATE_AURA_GROW = dir
end
L.PRIVATE_AURA_ANCHOR_FROM = normalizeAnchorPoint(pc.anchorFrom)
L.PRIVATE_AURA_ANCHOR_TO = normalizeAnchorPoint(pc.anchorTo)
L.PRIVATE_AURA_ANCHOR_PARENT = (type(pc.anchorParent) == "string" and pc.anchorParent ~= "") and pc.anchorParent or "NONE"
do
local customParent = nil
if type(pc.customParent) == "string" then
customParent = pc.customParent:gsub("^%s+", ""):gsub("%s+$", "")
if customParent == "" then
customParent = nil
end
end
L.PRIVATE_AURA_ANCHOR_CUSTOM_PARENT = customParent
if customParent then
L.PRIVATE_AURA_PARENT_NAME = customParent
elseif L.PRIVATE_AURA_ANCHOR_PARENT ~= "NONE" then
L.PRIVATE_AURA_PARENT_NAME = L.PRIVATE_AURA_ANCHOR_PARENT
else
L.PRIVATE_AURA_PARENT_NAME = nil
end
end
L.PRIVATE_AURA_X = tonumber(pc.x) or 0
L.PRIVATE_AURA_Y = tonumber(pc.y) or 0
L.COMBAT_TIMER_ENABLED = ct.enabled and true or false
L.COMBAT_TIMER_X = tonumber(ct.x) or 0
L.COMBAT_TIMER_Y = tonumber(ct.y) or 0
L.COMBAT_TIMER_ANCHOR_FROM = normalizeAnchorPoint(ct.anchorFrom)
L.COMBAT_TIMER_ANCHOR_TO = normalizeAnchorPoint(ct.anchorTo)
L.COMBAT_TIMER_ANCHOR_PARENT = (type(ct.anchorParent) == "string" and ct.anchorParent ~= "") and ct.anchorParent or "NONE"
local customParent = nil
if type(ct.customParent) == "string" then
customParent = ct.customParent:gsub("^%s+", ""):gsub("%s+$", "")
if customParent == "" then
customParent = nil
end
end
L.COMBAT_TIMER_ANCHOR_CUSTOM_PARENT = customParent
if customParent then
L.COMBAT_TIMER_PARENT_NAME = customParent
elseif L.COMBAT_TIMER_ANCHOR_PARENT ~= "NONE" then
L.COMBAT_TIMER_PARENT_NAME = L.COMBAT_TIMER_ANCHOR_PARENT
else
L.COMBAT_TIMER_PARENT_NAME = nil
end
L.COMBAT_TIMER_FONT_KEY = ct.font or L.FONT_KEY or M.Defaults.cfg.combatTimer.font
L.COMBAT_TIMER_FONT_PATH = C.FONT_PATH
if LSM then
L.COMBAT_TIMER_FONT_PATH = LSM:Fetch("font", L.COMBAT_TIMER_FONT_KEY) or C.FONT_PATH
end
L.COMBAT_TIMER_FONT_SIZE = U.clamp(U.round(tonumber(ct.fontSize) or M.Defaults.cfg.combatTimer.fontSize), 8, 72)
local ctColor = ct.color or {}
L.COMBAT_TIMER_COLOR_R = U.clamp(tonumber(ctColor.r) or M.Defaults.cfg.combatTimer.color.r, 0, 1)
L.COMBAT_TIMER_COLOR_G = U.clamp(tonumber(ctColor.g) or M.Defaults.cfg.combatTimer.color.g, 0, 1)
L.COMBAT_TIMER_COLOR_B = U.clamp(tonumber(ctColor.b) or M.Defaults.cfg.combatTimer.color.b, 0, 1)
L.COMBAT_TIMER_COLOR_A = U.clamp(tonumber(ctColor.a) or M.Defaults.cfg.combatTimer.color.a, 0, 1)
local ctBorder = ct.borderColor or {}
L.COMBAT_TIMER_BORDER_R = U.clamp(tonumber(ctBorder.r) or M.Defaults.cfg.combatTimer.borderColor.r, 0, 1)
L.COMBAT_TIMER_BORDER_G = U.clamp(tonumber(ctBorder.g) or M.Defaults.cfg.combatTimer.borderColor.g, 0, 1)
L.COMBAT_TIMER_BORDER_B = U.clamp(tonumber(ctBorder.b) or M.Defaults.cfg.combatTimer.borderColor.b, 0, 1)
L.COMBAT_TIMER_BORDER_A = U.clamp(tonumber(ctBorder.a) or M.Defaults.cfg.combatTimer.borderColor.a, 0, 1)
local ctBg = ct.bgColor or {}
L.COMBAT_TIMER_BG_R = U.clamp(tonumber(ctBg.r) or M.Defaults.cfg.combatTimer.bgColor.r, 0, 1)
L.COMBAT_TIMER_BG_G = U.clamp(tonumber(ctBg.g) or M.Defaults.cfg.combatTimer.bgColor.g, 0, 1)
L.COMBAT_TIMER_BG_B = U.clamp(tonumber(ctBg.b) or M.Defaults.cfg.combatTimer.bgColor.b, 0, 1)
L.COMBAT_TIMER_BG_A = U.clamp(tonumber(ctBg.a) or M.Defaults.cfg.combatTimer.bgColor.a, 0, 1)
end
local function isSecretValue(value)
return type(issecretvalue) == "function" and issecretvalue(value)
end
local INDICATOR_MASK_MAP = {
deadly = 1,
enrage = 2,
bleed = 4,
magic = 8,
disease = 16,
curse = 32,
poison = 64,
tank = 128,
healer = 256,
dps = 512,
}
local ENCOUNTER_SEVERITY = (Enum and Enum.EncounterEventSeverity) or {}
local SEVERITY_LOW = (type(ENCOUNTER_SEVERITY.Low) == "number") and ENCOUNTER_SEVERITY.Low or 0
local SEVERITY_MEDIUM = (type(ENCOUNTER_SEVERITY.Medium) == "number") and ENCOUNTER_SEVERITY.Medium or 1
local SEVERITY_HIGH = (type(ENCOUNTER_SEVERITY.High) == "number") and ENCOUNTER_SEVERITY.High or 2
local GROUP_INDICATORS = {
dispels = { "bleed", "magic", "disease", "curse", "poison" },
roles = { "tank", "healer", "dps" },
other = { "deadly", "enrage" },
}
local cachedPlayerRoleForColors = nil
local function normalizePlayerRole(role)
if type(role) ~= "string" or role == "" or role == "NONE" then
return nil