feat(filters): match aura whitelist/blacklist by spell ID, not just name
release / release (push) Successful in 3s
release / release (push) Successful in 3s
CoA's 3.3.5 client returns spellId as the 11th UnitAura value (stock 3.3.5a stops at 10). The scan loop now captures it and the whitelist/blacklist match on name OR spellId. The filter 'add' box accepts a numeric spell ID (stored as a numeric key so it matches UnitAura's spellId) and the list view resolves IDs to 'Name (ID)' via GetSpellInfo. Fixes ambiguity from name-only matching where CoA custom spells share display names across ranks/variants.
This commit is contained in:
@@ -48,6 +48,8 @@ L["Ascending"] = "Ascending"
|
||||
L["Aura border style"] = "Aura border style"
|
||||
L["Aura filters"] = "Aura filters"
|
||||
L["Aura name"] = "Aura name"
|
||||
L["Aura name or spell ID"] = "Aura name or spell ID"
|
||||
L["Enter an exact aura name, or a numeric spell ID for precise matching (CoA's client exposes aura spell IDs)."] = "Enter an exact aura name, or a numeric spell ID for precise matching (CoA's client exposes aura spell IDs)."
|
||||
L["Auras"] = "Auras"
|
||||
L["Aura types to filter"] = "Aura types to filter"
|
||||
L["B"] = "B"
|
||||
|
||||
@@ -531,10 +531,12 @@ local function scan(parent, frame, type, config, filter)
|
||||
local index = 0
|
||||
while( true ) do
|
||||
index = index + 1
|
||||
local name, rank, texture, count, auraType, duration, endTime, caster, isStealable = UnitAura(frame.parent.unit, index, filter)
|
||||
-- CoA's 3.3.5 client returns spellId as the 11th value (stock 3.3.5a stops at 10),
|
||||
-- which lets the whitelist/blacklist match by ID as well as by name.
|
||||
local name, rank, texture, count, auraType, duration, endTime, caster, isStealable, _, spellId = UnitAura(frame.parent.unit, index, filter)
|
||||
if( not name ) then break end
|
||||
|
||||
if( ( not coaFilter or (auraType and coaFilter[auraType]) ) and ( not config.player or playerUnits[caster] ) and ( not parent.whitelist[type] and not parent.blacklist[type] or parent.whitelist[type] and parent.whitelist[name] or parent.blacklist[type] and not parent.blacklist[name] ) ) then
|
||||
|
||||
if( ( not coaFilter or (auraType and coaFilter[auraType]) ) and ( not config.player or playerUnits[caster] ) and ( not parent.whitelist[type] and not parent.blacklist[type] or parent.whitelist[type] and ( parent.whitelist[name] or parent.whitelist[spellId] ) or parent.blacklist[type] and not ( parent.blacklist[name] or parent.blacklist[spellId] ) ) ) then
|
||||
-- Create any buttons we need
|
||||
frame.totalAuras = frame.totalAuras + 1
|
||||
if( #(frame.buttons) < frame.totalAuras ) then
|
||||
|
||||
Reference in New Issue
Block a user