unitframes: remove attributes during creation

This commit is contained in:
shagu
2020-03-05 19:28:12 +01:00
parent 082df33444
commit 47c8816bae
+1 -4
View File
@@ -892,13 +892,10 @@ function pfUI.uf:EnableScripts()
local f = self
-- handle secure unit button templates (> vanilla)
if f.SetAttribute and RegisterStateDriver then
if f.SetAttribute then
f.showmenu = pfUI.uf.RightClickAction
f:SetAttribute("unit", f.label .. f.id)
f:SetAttribute("type1", "target")
f:SetAttribute("type2", "showmenu")
f.visibilitycondition = string.format("[target=%s%s,exists] show; hide", f.label, f.id)
RegisterStateDriver(f, 'visibility', f.visibilitycondition)
else
f:SetScript("OnClick", pfUI.uf.OnClick)
end