@@ -67,6 +67,8 @@ local barAnimationType, highlightEnabled, predictionEnabled
6767local shieldEnabled , overshieldEnabled , overshieldReverseFillEnabled
6868local absorbEnabled , absorbInvertColor
6969
70+ local CheckCLEURequired
71+
7072---- ---------------------------------------------
7173-- unit button func declarations
7274---- ---------------------------------------------
@@ -105,6 +107,8 @@ local function ResetIndicators()
105107 wipe (enabledIndicators )
106108 wipe (indicatorNums )
107109
110+ CheckCLEURequired ()
111+
108112 for _ , t in pairs (Cell .vars .currentLayoutTable [" indicators" ]) do
109113 -- update enabled
110114 if t [" enabled" ] then
@@ -398,17 +402,25 @@ local queue = {}
398402updater :SetScript (" OnUpdate" , function ()
399403 local b = queue [1 ]
400404 if b then
401- if not b ._status then
402- -- print("processing ", GetTime(), b:GetName())
405+ if b ._status == " waiting_for_init " then
406+ -- print("processing_init ", GetTime(), b:GetName())
403407 b ._status = " processing"
404408 HandleIndicators (b )
405- UnitButton_UpdateAll (b )
406- b ._status = " finished"
407- elseif b ._status == " finished" then
409+ UnitButton_UpdateAuras (b )
410+ b ._status = " done"
411+ elseif b ._status == " waiting_for_update" then
412+ -- print("processing_update", GetTime(), b:GetName())
413+ b ._indicatorsReady = true
414+ b ._status = " processing"
415+ UnitButton_UpdateAuras (b )
416+ b ._status = " done"
417+ elseif b ._status == " done" then
408418 CellLoadingBar .current = (CellLoadingBar .current or 0 ) + 1
409419 CellLoadingBar :SetValue (CellLoadingBar .current )
410420 tremove (queue , 1 )
411421 b ._status = nil
422+ elseif b ._status ~= " processing" then -- re-queue
423+ b ._status = " waiting_for_init"
412424 end
413425 else
414426 CellLoadingBar :Hide ()
@@ -424,8 +436,15 @@ hooksecurefunc(updater, "Show", function()
424436 CellLoadingBar :Show ()
425437end )
426438
427- local function AddToQueue (b )
439+ local function AddToInitQueue (b )
440+ b ._indicatorsReady = nil
441+ b ._status = " waiting_for_init"
442+ tinsert (queue , b )
443+ end
444+
445+ local function AddToUpdateQueue (b )
428446 b ._indicatorsReady = nil
447+ b ._status = " waiting_for_update"
429448 tinsert (queue , b )
430449end
431450
@@ -462,9 +481,10 @@ local function UpdateIndicators(layout, indicatorName, setting, value, value2)
462481 F :Debug (" NO UPDATE: only reset custom indicator tables" )
463482 I .ResetCustomIndicatorTables ()
464483 ResetIndicators ()
484+ -- ! update main _indicatorsReady
485+ F :IterateAllUnitButtons (AddToUpdateQueue , true , nil , true )
465486 -- ! update shared buttons: npcs, spotlights
466- -- F:IterateSharedUnitButtons(HandleIndicators)
467- F :IterateSharedUnitButtons (AddToQueue )
487+ F :IterateSharedUnitButtons (AddToInitQueue )
468488 updater :Show ()
469489 return
470490 end
@@ -482,7 +502,7 @@ local function UpdateIndicators(layout, indicatorName, setting, value, value2)
482502 -- update all when indicators update finished
483503 F :IterateAllUnitButtons (UnitButton_UpdateAll , true )
484504 else
485- F :IterateAllUnitButtons (AddToQueue , true )
505+ F :IterateAllUnitButtons (AddToInitQueue , true )
486506 updater :Show ()
487507 end
488508 indicatorsInitialized = true
@@ -850,6 +870,7 @@ local function UpdateIndicators(layout, indicatorName, setting, value, value2)
850870 indicatorBooleans [indicatorName ] = value2
851871 end
852872 elseif setting == " create" then
873+ I .UpdateIndicatorTable (value )
853874 F :IterateAllUnitButtons (function (b )
854875 local indicator = I .CreateIndicator (b , value )
855876 indicator .configs = value
@@ -1461,15 +1482,27 @@ end
14611482-- check auras using CLEU
14621483---- ---------------------------------------------
14631484local cleu = CreateFrame (" Frame" )
1464- cleu :RegisterEvent (" COMBAT_LOG_EVENT_UNFILTERED" )
1485+
1486+ function CheckCLEURequired ()
1487+ if (Cell .vars .currentLayoutTable .indicators [Cell .defaults .indicatorIndices .externalCooldowns ].enabled
1488+ or Cell .vars .currentLayoutTable .indicators [Cell .defaults .indicatorIndices .defensiveCooldowns ].enabled
1489+ or Cell .vars .currentLayoutTable .indicators [Cell .defaults .indicatorIndices .allCooldowns ].enabled )
1490+ and (I .IsDefensiveCooldown (55342 ) or I .IsExternalCooldown (414660 )) then
1491+ cleu :RegisterEvent (" COMBAT_LOG_EVENT_UNFILTERED" )
1492+ else
1493+ cleu :UnregisterEvent (" COMBAT_LOG_EVENT_UNFILTERED" )
1494+ end
1495+ end
14651496
14661497local function UpdateMirrorImage (b , event )
14671498 if event == " SPELL_AURA_APPLIED" then
14681499 b ._mirror_image = GetTime ()
14691500 elseif event == " SPELL_AURA_REMOVED" then
14701501 b ._mirror_image = nil
14711502 end
1472- UnitButton_UpdateBuffs (b )
1503+ if b ._indicatorsReady then
1504+ UnitButton_UpdateBuffs (b )
1505+ end
14731506end
14741507
14751508local SelfBarriers = {
@@ -1497,7 +1530,9 @@ local function UpdateMassBarrier(b, event)
14971530 b ._mass_barrier = nil
14981531 b ._mass_barrier_icon = nil
14991532 end
1500- UnitButton_UpdateBuffs (b )
1533+ if b ._indicatorsReady then
1534+ UnitButton_UpdateBuffs (b )
1535+ end
15011536end
15021537
15031538cleu :SetScript (" OnEvent" , function ()
0 commit comments