Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions ElvUI_Libraries/Game/Shared/oUF/auraskip.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,27 @@ local function AllowAura(frame, aura)
return true
end

local function NotFilteredOut(unit, auraInstanceID, filter)
-- C_UnitAuras.IsAuraFilteredOutByInstanceID returns a SECRET boolean for secret auras in Midnight.
-- `not <secret>` would propagate secretness into the auraIsX flags and taint UF:VerifyFilter's
-- and/or chain (-> reduced budget -> "script ran too long"). Coerce to a plain boolean; a secret
-- aura defaults to false (not matched by this special filter) which is a safe, no-freeze default.
local filtered = IsAuraFilteredOutByInstanceID(unit, auraInstanceID, filter)
return oUF:NotSecretValue(filtered) and not filtered
end

local function InstanceFiltered(unit, aura, helpful, harmful)
local isHelpful = not IsAuraFilteredOutByInstanceID(unit, aura.auraInstanceID, helpful)
local isHarmful = not IsAuraFilteredOutByInstanceID(unit, aura.auraInstanceID, harmful)
local isHelpful = NotFilteredOut(unit, aura.auraInstanceID, helpful)
local isHarmful = NotFilteredOut(unit, aura.auraInstanceID, harmful)

return isHelpful or isHarmful
end

-- These flags are per-aura and do NOT depend on the filter, so compute them
-- once instead of recomputing identical values inside the 3x filter loop.
local function ComputeAuraFlags(unit, aura)
aura.auraIsHarmful = not IsAuraFilteredOutByInstanceID(unit, aura.auraInstanceID, 'HARMFUL')
aura.auraIsHelpful = not IsAuraFilteredOutByInstanceID(unit, aura.auraInstanceID, 'HELPFUL')
aura.auraIsHarmful = NotFilteredOut(unit, aura.auraInstanceID, 'HARMFUL')
aura.auraIsHelpful = NotFilteredOut(unit, aura.auraInstanceID, 'HELPFUL')

aura.auraIsImportant = InstanceFiltered(unit, aura, 'HELPFUL|IMPORTANT', 'HARMFUL|IMPORTANT')
aura.auraIsCancelable = InstanceFiltered(unit, aura, 'HELPFUL|CANCELABLE', 'HARMFUL|CANCELABLE')
Expand Down