From 4aa8445bc60b2ca62bfe3645c8bbf42786ba0292 Mon Sep 17 00:00:00 2001 From: shagu Date: Fri, 17 Apr 2020 19:32:46 +0200 Subject: [PATCH] unitframes: don't rely on API calls due to shitty addons NotGrid and other Grid forks add :SetAttribute to all frames that are created, no matter if its their own or not. Since the :SetAttribute provided by those is unfunctional, we need to ignore them and use client identifier checks instead. --- api/unitframes.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/unitframes.lua b/api/unitframes.lua index e74ff519..8e3df455 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -244,7 +244,7 @@ function pfUI.uf:UpdateVisibility() end -- tbc visibility - if self.SetAttribute and RegisterStateDriver then + if pfUI.client > 11200 then self:SetAttribute("unit", unitstr) -- update visibility condition on change @@ -901,7 +901,7 @@ function pfUI.uf:EnableScripts() local f = self -- handle secure unit button templates (> vanilla) - if f.SetAttribute then + if pfUI.client > 11200 then f.showmenu = pfUI.uf.RightClickAction f:SetAttribute("*type1", "target") f:SetAttribute("*type2", "showmenu") @@ -1610,7 +1610,7 @@ function pfUI.uf:EnableClickCast() local bconf = bid == 1 and "" or bid if pfUI_config.unitframes["clickcast"..bconf..mconf] ~= "" then -- prepare click casting - if self.SetAttribute then + if pfUI.client > 11200 then -- set attributes for tbc+ local prefix = modifier == "" and "" or modifier .. "-"