mirror of
https://github.com/brues-code/SuperCleveRoidMacros.git
synced 2026-09-16 03:38:00 +00:00
target can use multiscan/fix overflowframe not showing more than 1 buff
This commit is contained in:
@@ -2585,6 +2585,23 @@ function CleveRoids.DoTarget(msg)
|
||||
-- Save original target GUID for potential restoration (SuperWoW returns GUID as 2nd value)
|
||||
local _, originalTargetGuid = UnitExists("target")
|
||||
|
||||
-- Handle [multiscan:priority] - use ResolveMultiscanTarget for enemy scanning
|
||||
-- ResolveMultiscanTarget handles its own target save/restore internally
|
||||
if conditionals.multiscan then
|
||||
local scanResult = CleveRoids.ResolveMultiscanTarget(conditionals, conditionals.target)
|
||||
if scanResult then
|
||||
TargetUnit(scanResult)
|
||||
return true
|
||||
end
|
||||
-- No match found - restore original target if scanning changed it
|
||||
if originalTargetGuid and UnitExists(originalTargetGuid) then
|
||||
TargetUnit(originalTargetGuid)
|
||||
elseif not originalTargetGuid then
|
||||
ClearTarget()
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- Track if an explicit target was specified via @unit syntax
|
||||
local explicitTarget = conditionals.target
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ local targetLabelFs = nil
|
||||
local updateFrame = nil
|
||||
local updateElapsed = 0
|
||||
local testMode = false
|
||||
local dirty = false -- Flag for deferred rebuild (avoids event ordering race)
|
||||
local lastPlayerCount = 0
|
||||
local lastTargetCount = 0
|
||||
|
||||
@@ -551,6 +552,14 @@ CleveRoids.ToggleOverflowTest = ToggleTestMode
|
||||
-- ============================================================================
|
||||
local function OnUpdate()
|
||||
updateElapsed = updateElapsed + arg1
|
||||
-- Check dirty flag every frame for responsive rebuilds after AURA_CAST events.
|
||||
-- By the time OnUpdate fires, the core handler has already updated OverflowBuffs.
|
||||
if dirty then
|
||||
dirty = false
|
||||
updateElapsed = 0
|
||||
RebuildFrame()
|
||||
return
|
||||
end
|
||||
if updateElapsed < UPDATE_INTERVAL then return end
|
||||
updateElapsed = 0
|
||||
RefreshDurations()
|
||||
@@ -570,7 +579,11 @@ ext.OnTargetChanged = function()
|
||||
end
|
||||
|
||||
ext.OnAuraCast = function()
|
||||
RebuildFrame()
|
||||
-- Defer rebuild to OnUpdate: the core handler that populates OverflowBuffs
|
||||
-- registers for AURA_CAST_ON_SELF later (PLAYER_ENTERING_WORLD) than this
|
||||
-- extension (ADDON_LOADED), so it fires AFTER us. A direct RebuildFrame()
|
||||
-- here would read stale data.
|
||||
dirty = true
|
||||
end
|
||||
|
||||
ext.OnGroupChanged = function()
|
||||
|
||||
Reference in New Issue
Block a user