@@ -16,8 +16,6 @@ local UnitName = UnitName
16
16
local UnitReaction = UnitReaction
17
17
local UnitSpellHaste = UnitSpellHaste
18
18
19
- local ticks = {}
20
-
21
19
do
22
20
local pipMapColor = {4 , 1 , 2 , 3 }
23
21
function UF :CastBar_UpdatePip (castbar , pip , stage )
@@ -119,6 +117,7 @@ function UF:Construct_Castbar(frame, moverName)
119
117
castbar .UpdatePipStep = UF .UpdatePipStep
120
118
castbar .PostUpdatePip = UF .PostUpdatePip
121
119
castbar .CreatePip = UF .BuildPip
120
+ castbar .TicksData = {}
122
121
123
122
castbar :SetClampedToScreen (true )
124
123
castbar :CreateBackdrop (nil , nil , nil , nil , true )
@@ -333,7 +332,7 @@ function UF:Configure_Castbar(frame)
333
332
castbar .tickWidth = db .tickWidth
334
333
castbar .tickColor = db .tickColor
335
334
336
- for _ , tick in next , ticks do
335
+ for _ , tick in next , castbar . TicksData do
337
336
tick :SetVertexColor (castbar .tickColor .r , castbar .tickColor .g , castbar .tickColor .b , castbar .tickColor .a )
338
337
tick :Width (castbar .tickWidth )
339
338
end
@@ -427,26 +426,26 @@ function UF:CustomTimeText(duration)
427
426
self .Time :SetWidth (self .Time :GetStringWidth ())
428
427
end
429
428
430
- function UF :HideTicks ()
431
- for _ , tick in next , ticks do
429
+ function UF :HideTicks (frame )
430
+ for _ , tick in next , frame . TicksData do
432
431
tick :Hide ()
433
432
end
434
433
end
435
434
436
435
function UF :SetCastTicks (frame , numTicks )
437
- UF :HideTicks ()
436
+ UF :HideTicks (frame )
438
437
439
438
if numTicks and numTicks <= 0 then return end
440
439
441
440
local offset = frame :GetWidth () / numTicks
442
441
443
442
for i = 1 , numTicks - 1 do
444
- local tick = ticks [i ]
443
+ local tick = frame . TicksData [i ]
445
444
if not tick then
446
445
tick = frame :CreateTexture (nil , ' OVERLAY' )
447
446
tick :SetTexture (E .media .blankTex )
448
447
tick :Width (frame .tickWidth )
449
- ticks [i ] = tick
448
+ frame . TicksData [i ] = tick
450
449
end
451
450
452
451
tick :SetVertexColor (frame .tickColor .r , frame .tickColor .g , frame .tickColor .b , frame .tickColor .a )
@@ -576,7 +575,7 @@ function UF:PostCastStart(unit)
576
575
UF :SetCastTicks (self , baseTicks )
577
576
self .hadTicks = true
578
577
else
579
- UF :HideTicks ()
578
+ UF :HideTicks (self )
580
579
end
581
580
end
582
581
589
588
590
589
function UF :PostCastStop (unit )
591
590
if self .hadTicks and unit == ' player' then
592
- UF :HideTicks ()
591
+ UF :HideTicks (self )
593
592
self .hadTicks = false
594
593
self .chainTick = nil -- reset the chain
595
594
self .chainTime = nil -- spell cast vars
0 commit comments