-
Notifications
You must be signed in to change notification settings - Fork 3
/
BlizzardCode.lua
executable file
·661 lines (552 loc) · 25.4 KB
/
BlizzardCode.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
local KHMRaidFrames = LibStub("AceAddon-3.0"):GetAddon("KHMRaidFrames")
local SharedMedia = LibStub("LibSharedMedia-3.0")
local UnitIsTapDenied = UnitIsTapDenied
local UnitPlayerControlled = UnitPlayerControlled
local UnitInRaid = UnitInRaid
local UnitHasVehicleUI = UnitHasVehicleUI
local UnitInVehicle = UnitInVehicle
local GetRaidRosterInfo = GetRaidRosterInfo
local UnitGroupRolesAssigned = UnitGroupRolesAssigned
local GetTexCoordsForRoleSmallCircle = GetTexCoordsForRoleSmallCircle
local GetReadyCheckTimeLeft = GetReadyCheckTimeLeft
local GetReadyCheckStatus = GetReadyCheckStatus
local READY_CHECK_WAITING_TEXTURE, READY_CHECK_NOT_READY_TEXTURE, READY_CHECK_NOT_READY_TEXTURE = READY_CHECK_WAITING_TEXTURE, READY_CHECK_NOT_READY_TEXTURE, READY_CHECK_NOT_READY_TEXTURE
local UnitPhaseReason = UnitPhaseReason
local Enum = Enum
local C_IncomingSummon = C_IncomingSummon
local UnitHasIncomingResurrection = UnitHasIncomingResurrection
local UnitInOtherParty = UnitInOtherParty
local UnitHealth = UnitHealth
local UnitHealthMax = UnitHealthMax
function KHMRaidFrames:CompactUnitFrame_UtilSetDebuff(debuffFrame, unit, index, filter, isBossAura, isBossBuff, ...)
debuffFrame.debuffFramesGlowing = nil
-- make sure you are using the correct index here!
--isBossAura says make this look large.
--isBossBuff looks in HELPFULL auras otherwise it looks in HARMFULL ones
local name, icon, count, debuffType, duration, expirationTime, unitCaster, canStealOrPurge, _, spellId = ...
if name == nil then
-- for backwards compatibility - this functionality will be removed in a future update
if unit then
if (isBossBuff) then
name, icon, count, debuffType, duration, expirationTime, unitCaster, canStealOrPurge, _, spellId = UnitBuff(unit, index, filter)
else
name, icon, count, debuffType, duration, expirationTime, unitCaster, canStealOrPurge, _, spellId = UnitDebuff(unit, index, filter)
end
else
return
end
end
debuffFrame.filter = filter
debuffFrame.icon:SetTexture(icon)
if ( count > 1 ) then
local countText = count
if ( count >= 100 ) then
countText = BUFF_STACKS_OVERFLOW
end
debuffFrame.count:Show()
debuffFrame.count:SetText(countText)
else
debuffFrame.count:Hide()
end
debuffFrame:SetID(index)
local enabled = expirationTime and expirationTime ~= 0
if enabled then
local startTime = expirationTime - duration
CooldownFrame_Set(debuffFrame.cooldown, startTime, duration, true)
else
CooldownFrame_Clear(debuffFrame.cooldown)
end
local color = DebuffTypeColor[debuffType] or DebuffTypeColor["none"]
debuffFrame.border:SetVertexColor(color.r, color.g, color.b)
debuffFrame.isBossBuff = isBossBuff
debuffFrame.isBossAura = isBossAura
local size
if IsInRaid() then
size = self.db.profile.raid.debuffFrames
else
size = self.db.profile.party.debuffFrames
end
if isBossAura then
size = size.bigDebuffSize
else
size = size.size
end
local parent = debuffFrame:GetParent()
size = size * self.componentScale(IsInRaid() and "raid" or "party")
debuffFrame:SetSize(size, size)
debuffFrame:Show()
name = name and name:lower()
debuffType = debuffType and debuffType:lower() or "physical"
spellId = tostring(spellId)
local db = self.db.profile.glows
if db.auraGlow.debuffFrames.enabled then
if self:TrackAuras(name, debuffType, spellId, db.auraGlow.debuffFrames.tracking) then
local color = db.auraGlow.debuffFrames.useDefaultsColors and db.auraGlow.defaultColors[debuffType]
self.StartGlow(debuffFrame, db.auraGlow.debuffFrames, color, "debuffFrames", "auraGlow")
debuffFrame.debuffFramesGlowing = debuffType
end
end
if not debuffFrame.debuffFramesGlowing then
self.StopGlow(debuffFrame, db.auraGlow.debuffFrames, "debuffFrames", "auraGlow")
end
parent.debuffFramesGlowing[debuffType] = {name, debuffType, spellId}
parent.debuffFramesGlowing[name] = {name, debuffType, spellId}
parent.debuffFramesGlowing[spellId] = {name, debuffType, spellId}
if self.Masque then
debuffFrame.border:Hide()
end
end
function KHMRaidFrames:CompactUnitFrame_UtilSetBuff(buffFrame, index, ...)
buffFrame.buffFramesGlowing = nil
local name, icon, count, debuffType, duration, expirationTime, unitCaster, canStealOrPurge, _, spellId, canApplyAura = ...
buffFrame.icon:SetTexture(icon)
if ( count > 1 ) then
local countText = count
if ( count >= 100 ) then
countText = BUFF_STACKS_OVERFLOW
end
buffFrame.count:Show()
buffFrame.count:SetText(countText)
else
buffFrame.count:Hide()
end
buffFrame:SetID(index)
local enabled = expirationTime and expirationTime ~= 0
if enabled then
local startTime = expirationTime - duration
CooldownFrame_Set(buffFrame.cooldown, startTime, duration, true)
else
CooldownFrame_Clear(buffFrame.cooldown)
end
buffFrame:Show()
name = name and name:lower()
debuffType = debuffType and debuffType:lower() or "physical"
spellId = tostring(spellId)
local db = self.db.profile.glows
if db.auraGlow.buffFrames.enabled then
if self:TrackAuras(name, debuffType, spellId, db.auraGlow.buffFrames.tracking) then
local color = db.auraGlow.buffFrames.useDefaultsColors and db.auraGlow.defaultColors[debuffType]
self.StartGlow(buffFrame, db.auraGlow.buffFrames, color, "buffFrames", "auraGlow")
buffFrame.buffFramesGlowing = debuffType
end
end
if not buffFrame.buffFramesGlowing then
self.StopGlow(buffFrame, db.auraGlow.buffFrames, "buffFrames", "auraGlow")
end
local parent = buffFrame:GetParent()
parent.buffFramesGlowing[debuffType] = {name, debuffType, spellId}
parent.buffFramesGlowing[name] = {name, debuffType, spellId}
parent.buffFramesGlowing[spellId] = {name, debuffType, spellId}
end
local function CompactUnitFrame_Util_IsBossAura(...)
return select(12, ...)
end
function KHMRaidFrames:CompactUnitFrame_Util_ShouldDisplayDebuff(...)
local name, icon, count, debuffType, duration, expirationTime, unitCaster, canStealOrPurge, _, spellId, canApplyAura, isBossAura = ...
if not self:FilterAuras(name, debuffType, spellId, "debuffFrames") then
return false
end
if self:AdditionalAura(name, debuffType, spellId, unitCaster) then
return true
end
local hasCustom, alwaysShowMine, showForMySpec = SpellGetVisibilityInfo(spellId, UnitAffectingCombat("player") and "RAID_INCOMBAT" or "RAID_OUTOFCOMBAT")
if ( hasCustom ) then
return showForMySpec or (alwaysShowMine and (unitCaster == "player" or unitCaster == "pet" or unitCaster == "vehicle") ) --Would only be "mine" in the case of something like forbearance.
else
return true
end
end
function KHMRaidFrames:CompactUnitFrame_UtilShouldDisplayBuff(...)
local name, icon, count, debuffType, duration, expirationTime, unitCaster, canStealOrPurge, _, spellId, canApplyAura = ...
if not self:FilterAuras(name, debuffType, spellId, "buffFrames") then
return false
end
if self:AdditionalAura(name, debuffType, spellId, unitCaster) then
return true
end
local hasCustom, alwaysShowMine, showForMySpec = SpellGetVisibilityInfo(spellId, UnitAffectingCombat("player") and "RAID_INCOMBAT" or "RAID_OUTOFCOMBAT")
if ( hasCustom ) then
return showForMySpec or (alwaysShowMine and (unitCaster == "player" or unitCaster == "pet" or unitCaster == "vehicle"))
else
return (unitCaster == "player" or unitCaster == "pet" or unitCaster == "vehicle") and canApplyAura and not SpellIsSelfBuff(spellId)
end
end
function KHMRaidFrames:CompactUnitFrame_HideAllBuffs(frame, startingIndex, db)
if frame.buffFrames then
for i=startingIndex or 1, #frame.buffFrames do
frame.buffFrames[i]:Hide()
self.StopGlow(frame.buffFrames[i], db.buffFrames, "buffFrames", "auraGlow")
end
end
end
function KHMRaidFrames:CompactUnitFrame_HideAllDebuffs(frame, startingIndex, db)
if frame.debuffFrames then
for i=startingIndex or 1, #frame.debuffFrames do
frame.debuffFrames[i]:Hide()
self.StopGlow(frame.debuffFrames[i], db.debuffFrames, "debuffFrames", "auraGlow")
end
end
end
function KHMRaidFrames:SetDebuffsHelper(debuffFrames, frameNum, maxDebuffs, filter, isBossAura, isBossBuff, auras)
if auras then
for i = 1,#auras do
local aura = auras[i]
if frameNum > maxDebuffs then
break
end
local debuffFrame = debuffFrames[frameNum]
local index, name, icon, count, debuffType, duration, expirationTime, unitCaster, canStealOrPurge, nameplateShowPersonal, spellId = aura[1], aura[2], aura[3], aura[4], aura[5], aura[6], aura[7], aura[8], aura[9], aura[10], aura[11]
if self:FilterAuras(name, debuffType, spellId, "debuffFrames") then
local unit = nil
self:CompactUnitFrame_UtilSetDebuff(debuffFrame, unit, index, "HARMFUL", isBossAura, isBossBuff, name, icon, count, debuffType, duration, expirationTime, unitCaster, canStealOrPurge, nameplateShowPersonal, spellId)
frameNum = frameNum + 1
if not self.db.profile[IsInRaid() and "raid" or "party"].debuffFrames.smartAnchoring then
if isBossAura then
--Boss auras are about twice as big as normal debuffs, so we may need to display fewer buffs
local bossDebuffScale = (debuffFrame.baseSize + BOSS_DEBUFF_SIZE_INCREASE)/debuffFrame.baseSize
maxDebuffs = maxDebuffs - (bossDebuffScale - 1)
end
end
end
end
end
return frameNum, maxDebuffs
end
local function NumElements(arr)
return arr and #arr or 0
end
local dispellableDebuffTypes = { Magic = true, Curse = true, Disease = true, Poison = true}
function KHMRaidFrames:CompactUnitFrame_UpdateAuras(frame)
if self.SkipFrame(frame) then return end
frame.buffFramesGlowing = {}
frame.debuffFramesGlowing = {}
local db = self:GroupTypeDB()
local maxBuffs = min(db.buffFrames.num, #frame.buffFrames) or 3
local maxDebuffs = min(db.debuffFrames.num, #frame.debuffFrames) or 3
local maxDispelDebuffs = min(db.dispelDebuffFrames.num, #frame.dispelDebuffFrames) or 3
local doneWithBuffs = not frame.buffFrames or not frame.optionTable.displayBuffs or maxBuffs == 0
local doneWithDebuffs = not frame.debuffFrames or not frame.optionTable.displayDebuffs or maxDebuffs == 0
local doneWithDispelDebuffs = not frame.dispelDebuffFrames or not frame.optionTable.displayDispelDebuffs or maxDispelDebuffs == 0
local numUsedBuffs = 0
local numUsedDebuffs = 0
local numUsedDispelDebuffs = 0
local displayOnlyDispellableDebuffs = frame.optionTable.displayOnlyDispellableDebuffs
-- The following is the priority order for debuffs
local bossDebuffs, bossBuffs, priorityDebuffs, nonBossDebuffs
local index = 1
local batchCount = maxDebuffs
if not doneWithDebuffs then
AuraUtil.ForEachAura(frame.displayedUnit, "HARMFUL", batchCount, function(...)
if db.debuffFrames.showBigDebuffs and CompactUnitFrame_Util_IsBossAura(...) then
if not bossDebuffs then
bossDebuffs = {}
end
tinsert(bossDebuffs, {index, ...})
numUsedDebuffs = numUsedDebuffs + 1
if numUsedDebuffs == maxDebuffs then
doneWithDebuffs = true
return true
end
elseif db.frames.showBigDebuffs and CompactUnitFrame_Util_IsPriorityDebuff(...) then
if not priorityDebuffs then
priorityDebuffs = {}
end
tinsert(priorityDebuffs, {index, ...})
elseif not displayOnlyDispellableDebuffs and self:CompactUnitFrame_Util_ShouldDisplayDebuff(...) then
if not nonBossDebuffs then
nonBossDebuffs = {}
end
tinsert(nonBossDebuffs, {index, ...})
end
index = index + 1
return false
end)
end
if not doneWithBuffs or not doneWithDebuffs then
index = 1
batchCount = math.max(maxBuffs, maxDebuffs)
AuraUtil.ForEachAura(frame.displayedUnit, "HELPFUL", batchCount, function(...)
if db.debuffFrames.showBigDebuffs and CompactUnitFrame_Util_IsBossAura(...) then
-- Boss Auras are considered Debuffs for our purposes.
if not doneWithDebuffs then
if not bossBuffs then
bossBuffs = {}
end
tinsert(bossBuffs, {index, ...})
numUsedDebuffs = numUsedDebuffs + 1
if numUsedDebuffs == maxDebuffs then
doneWithDebuffs = true
end
end
elseif self:CompactUnitFrame_UtilShouldDisplayBuff(...) then
if not doneWithBuffs then
numUsedBuffs = numUsedBuffs + 1
local buffFrame = frame.buffFrames[numUsedBuffs]
self:CompactUnitFrame_UtilSetBuff(buffFrame, index, ...)
if numUsedBuffs == maxBuffs then
doneWithBuffs = true
end
end
end
index = index + 1
return doneWithBuffs and doneWithDebuffs
end)
end
numUsedDebuffs = math.min(maxDebuffs, numUsedDebuffs + NumElements(priorityDebuffs))
if numUsedDebuffs == maxDebuffs then
doneWithDebuffs = true
end
if not doneWithDispelDebuffs then
--Clear what we currently have for dispellable debuffs
for debuffType, display in pairs(dispellableDebuffTypes) do
if ( display ) then
frame["hasDispel"..debuffType] = false
end
end
end
if not doneWithDispelDebuffs or not doneWithDebuffs then
batchCount = math.max(maxDebuffs, maxDispelDebuffs)
index = 1
AuraUtil.ForEachAura(frame.displayedUnit, "HARMFUL|RAID", batchCount, function(...)
if not doneWithDebuffs and displayOnlyDispellableDebuffs then
if self:CompactUnitFrame_Util_ShouldDisplayDebuff(...) and not CompactUnitFrame_Util_IsBossAura(...) and not CompactUnitFrame_Util_IsPriorityDebuff(...) then
if not nonBossDebuffs then
nonBossDebuffs = {}
end
tinsert(nonBossDebuffs, {index, ...})
numUsedDebuffs = numUsedDebuffs + 1
if numUsedDebuffs == maxDebuffs then
doneWithDebuffs = true
end
end
end
if not doneWithDispelDebuffs then
local debuffType = select(4, ...)
if ( dispellableDebuffTypes[debuffType] and not frame["hasDispel"..debuffType] ) then
frame["hasDispel"..debuffType] = true
numUsedDispelDebuffs = numUsedDispelDebuffs + 1
local dispellDebuffFrame = frame.dispelDebuffFrames[numUsedDispelDebuffs]
CompactUnitFrame_UtilSetDispelDebuff(dispellDebuffFrame, {dispelName=debuffType, auraInstanceID=index})
if numUsedDispelDebuffs == maxDispelDebuffs then
doneWithDispelDebuffs = true
end
end
end
index = index + 1
return (doneWithDebuffs or not displayOnlyDispellableDebuffs) and doneWithDispelDebuffs
end)
end
local frameNum = 1
local maxDebuffs = maxDebuffs
do
local isBossAura = true
local isBossBuff = false
frameNum, maxDebuffs = self:SetDebuffsHelper(frame.debuffFrames, frameNum, maxDebuffs, "HARMFUL", isBossAura, isBossBuff, bossDebuffs)
end
do
local isBossAura = true
local isBossBuff = true
frameNum, maxDebuffs = self:SetDebuffsHelper(frame.debuffFrames, frameNum, maxDebuffs, "HELPFUL", isBossAura, isBossBuff, bossBuffs)
end
do
local isBossAura = false
local isBossBuff = false
frameNum, maxDebuffs = self:SetDebuffsHelper(frame.debuffFrames, frameNum, maxDebuffs, "HARMFUL", isBossAura, isBossBuff, priorityDebuffs)
end
do
local isBossAura = false
local isBossBuff = false
frameNum, maxDebuffs = self:SetDebuffsHelper(frame.debuffFrames, frameNum, maxDebuffs, "HARMFUL|RAID", isBossAura, isBossBuff, nonBossDebuffs)
end
numUsedDebuffs = frameNum - 1
self:CompactUnitFrame_HideAllBuffs(frame, numUsedBuffs + 1, self.db.profile.glows.auraGlow)
self:CompactUnitFrame_HideAllDebuffs(frame, numUsedDebuffs + 1, self.db.profile.glows.auraGlow)
CompactUnitFrame_HideAllDispelDebuffs(frame, numUsedDispelDebuffs + 1)
local groupType = IsInRaid() and "raid" or "party"
if self.db.profile[groupType].debuffFrames.showBigDebuffs then
if self.db.profile[groupType].debuffFrames.smartAnchoring then
self:SmartAnchoring(frame, IsInRaid() and "raid" or "party")
end
if self.db.profile.Masque then
for _, _frame in pairs(frame.debuffFrames) do
if _frame:IsShown() then
self.Masque.debuffFrames:ReSkin(_frame)
end
end
end
end
local db = self.db.profile.glows.frameGlow
if db.buffFrames.enabled then
for aura, auras in pairs(frame.buffFramesGlowing) do
local name, debuffType, spellId = auras[1], auras[2], auras[3]
if self:TrackAuras(name, debuffType, spellId, self.db.profile.glows.frameGlow.buffFrames.tracking) then
local color = db.buffFrames.useDefaultsColors and db.defaultColors[debuffType]
self.StartGlow(frame, db.buffFrames, color, "buffFrames", "frameGlow")
self.StopGlow(frame, db.debuffFrames, "debuffFrames", "frameGlow")
return
end
end
end
if db.debuffFrames.enabled then
for aura, auras in pairs(frame.debuffFramesGlowing) do
local name, debuffType, spellId = auras[1], auras[2], auras[3]
if self:TrackAuras(name, debuffType, spellId, self.db.profile.glows.frameGlow.debuffFrames.tracking) then
local color = db.debuffFrames.useDefaultsColors and db.defaultColors[debuffType]
self.StartGlow(frame, db.debuffFrames, color, "debuffFrames", "frameGlow")
self.StopGlow(frame, db.buffFrames, "buffFrames", "frameGlow")
return
end
end
end
self.StopGlow(frame, db.debuffFrames, "debuffFrames", "frameGlow")
self.StopGlow(frame, db.buffFrames, "buffFrames", "frameGlow")
end
function KHMRaidFrames.CompactUnitFrame_IsTapDenied(frame)
return frame.optionTable.greyOutWhenTapDenied and not UnitPlayerControlled(frame.unit) and UnitIsTapDenied(frame.unit)
end
function KHMRaidFrames.CompactUnitFrame_UpdateRoleIcon(frame)
if not frame.roleIcon or not frame.unit then
return
end
frame.roleIcon:ClearAllPoints()
frame.roleIcon:SetPoint("TOPLEFT", 3, -2)
frame.roleIcon:SetSize(12, 12)
if IsInGroup() then
frame.roleIcon:Show()
end
KHMRaidFrames.CompactUnitFrame_UpdateRoleIconTexture(frame)
end
function KHMRaidFrames.CompactUnitFrame_UpdateRoleIconTexture(frame)
CompactUnitFrame_UpdateRoleIcon(frame)
frame.roleIcon:SetVertexColor(1, 1, 1, 1)
end
function KHMRaidFrames.RevertRoleIcon()
for frame in KHMRaidFrames.IterateCompactFrames() do
if frame.unit then
KHMRaidFrames.CompactUnitFrame_UpdateRoleIcon(frame)
end
end
end
function KHMRaidFrames.RevertRoleIconTexture()
for frame in KHMRaidFrames.IterateCompactFrames() do
if frame.unit then
KHMRaidFrames.CompactUnitFrame_UpdateRoleIconTexture(frame)
end
end
end
function KHMRaidFrames.CompactUnitFrame_UpdateReadyCheck(frame)
if not frame.readyCheckIcon or frame.readyCheckDecay and GetReadyCheckTimeLeft() <= 0 or not frame.unit then
return
end
local readyCheckSize = 15 * KHMRaidFrames.componentScale(IsInRaid() and "raid" or "party")
frame.readyCheckIcon:ClearAllPoints();
frame.readyCheckIcon:SetPoint("BOTTOM", frame, "BOTTOM", 0, frame:GetHeight() / 3 - 4)
frame.readyCheckIcon:SetSize(readyCheckSize, readyCheckSize)
KHMRaidFrames.CompactUnitFrame_UpdateReadyCheckTexture(frame)
end
function KHMRaidFrames.CompactUnitFrame_UpdateReadyCheckTexture(frame)
CompactUnitFrame_UpdateReadyCheck(frame)
frame.readyCheckIcon:SetVertexColor(1, 1, 1, 1)
end
function KHMRaidFrames.RevertReadyCheckIcon()
for frame in KHMRaidFrames.IterateCompactFrames() do
if frame.unit then
KHMRaidFrames.CompactUnitFrame_UpdateReadyCheck(frame)
end
end
end
function KHMRaidFrames.RevertReadyCheckIconTexture()
for frame in KHMRaidFrames.IterateCompactFrames() do
if frame.unit then
KHMRaidFrames.CompactUnitFrame_UpdateReadyCheckTexture(frame)
end
end
end
function KHMRaidFrames.CompactUnitFrame_UpdateCenterStatusIcon(frame)
if not frame.unit or not frame.centerStatusIcon then return end
local size = 11 * KHMRaidFrames.componentScale(IsInRaid() and "raid" or "party") * 2
frame.centerStatusIcon:ClearAllPoints()
frame.centerStatusIcon:SetPoint("CENTER", frame, "BOTTOM", 0, frame:GetHeight() / 3 + 2)
frame.centerStatusIcon:SetSize(size, size)
KHMRaidFrames.CompactUnitFrame_UpdateCenterStatusIconTexture(frame)
end
function KHMRaidFrames.CompactUnitFrame_UpdateCenterStatusIconTexture(frame)
CompactUnitFrame_UpdateCenterStatusIcon(frame)
frame.centerStatusIcon.texture:SetVertexColor(1, 1, 1, 1)
end
function KHMRaidFrames.RevertStatusIcon()
for frame in KHMRaidFrames.IterateCompactFrames() do
if frame.unit then
KHMRaidFrames.CompactUnitFrame_UpdateCenterStatusIcon(frame)
end
end
end
function KHMRaidFrames.RevertStatusIconTexture()
for frame in KHMRaidFrames.IterateCompactFrames() do
if frame.unit then
KHMRaidFrames.CompactUnitFrame_UpdateCenterStatusIconTexture(frame)
end
end
end
function KHMRaidFrames.RevertStatusText()
for frame in KHMRaidFrames.IterateCompactFrames() do
if frame.KHMStatusText then
frame.KHMStatusText:Hide()
end
local hide, text, percents = KHMRaidFrames.HideStatusText(frame)
frame.statusText:SetShown(not hide)
end
end
function KHMRaidFrames.CompactUnitFrame_UpdateName(frame)
frame.name:SetFont(SharedMedia:Fetch("font", KHMRaidFrames.font), 11)
frame.name:ClearAllPoints()
if KHMRaidFrames.db.profile[IsInRaid() and "raid" or "party"].nameAndIcons.roleIcon.enabled then
frame.name:SetPoint("TOPLEFT", frame, "TOPLEFT", 0, -1)
else
frame.name:SetPoint("TOPLEFT", frame.roleIcon, "TOPRIGHT", 0, -1)
end
frame.name:SetPoint("TOPRIGHT", frame, "TOPRIGHT", -3, -3)
frame.name:SetJustifyH("LEFT")
frame.name:SetVertexColor(1.0, 1.0, 1.0)
CompactUnitFrame_UpdateName(frame)
end
function KHMRaidFrames.RevertName()
for frame in KHMRaidFrames.IterateCompactFrames() do
if frame.unit then
KHMRaidFrames.CompactUnitFrame_UpdateName(frame)
end
end
end
function KHMRaidFrames.RevertNameColors()
for frame in KHMRaidFrames.IterateCompactFrames() do
if KHMRaidFrames.CompactUnitFrame_IsTapDenied(frame) then
frame.name:SetVertexColor(0.5, 0.5, 0.5)
else
frame.name:SetVertexColor(1.0, 1.0, 1.0)
end
end
end
function KHMRaidFrames.ReverseHealthBarColors()
local br, bg, bb = unpack(KHMRaidFrames:Defaults().profile.party.frames.backGroundColor)
for frame in KHMRaidFrames.IterateCompactFrames() do
if frame.healthBar.r ~= nil then
frame.healthBar:SetStatusBarColor(frame.healthBar.r, frame.healthBar.g, frame.healthBar.b)
frame.healthBar.background:SetColorTexture(br, bg, bb)
frame.background:Show()
end
end
end
function KHMRaidFrames.RevertRaidTargetIcon()
for frame in KHMRaidFrames.IterateCompactFrames() do
if frame.raidIcon then
frame.raidIcon:Hide()
end
end
end
function KHMRaidFrames.RevertLeaderIcon()
for frame in KHMRaidFrames.IterateCompactFrames() do
if frame.leaderIcon then
frame.leaderIcon:Hide()
end
end
end