Thread: frame replacing
View Single Post
10-10-14, 02:58 AM   #37
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Filter options for the default UI do not affect oUF.

However, on further investigation, oUF itself applies a filter if you don't supply one, and if you set certain properties on the Debuffs element:

Code:
local customFilter = function(icons, unit, icon, name, rank, texture, count, dtype, duration, timeLeft, caster)
	if((icons.onlyShowPlayer and icon.isPlayer) or (not icons.onlyShowPlayer and name)) then
		return true
	end
end
If you want to use this default filter instead of supplying your own, then I'd suggest that rather than removing the filter, you replace it with a dummy one that lets everything through:

Code:
local showall = function() return true end

local f = CreateFrame("Frame")
f:RegisterEvent("MODIFIER_STATE_CHANGED")
f:SetScript("OnEvent", function(f, event, key, state)
	if key ~= "LSHIFT" and key ~= "RSHIFT" then
		return
	end
	local a, b
	if state == 1 then
		a, b = "CustomFilter", "__CustomFilter"
	else
		a, b = "__CustomFilter", "CustomFilter"
	end
	for i = 1, #oUF.objects do
		local object = oUF.objects[i]
		local buffs = object.Auras or object.Buffs
		if buffs and buffs[a] then
			buffs[b] = buffs[a]
			buffs[a] = showall
			buffs:ForceUpdate()
		end
		local debuffs = object.Debuffs
		if debuffs and debuffs[a] then
			debuffs[b] = debuffs[a]
			debuffs[a] = showall
			debuffs:ForceUpdate()
		end
	end
end)
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.

Last edited by Phanx : 10-10-14 at 03:06 AM.
  Reply With Quote