diff --git a/modules/gui.lua b/modules/gui.lua index 186537c5..80cb5091 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -18,10 +18,28 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function () U = setmetatable({}, { __index = function(tab,key) local ufunc - if type(pfUI[key]) == "table" and pfUI[key].UpdateConfig then - ufunc = function() return pfUI[key]:UpdateConfig() end - elseif pfUI.uf and type(pfUI.uf[key]) == "table" and pfUI.uf[key].UpdateConfig then - ufunc = function() return pfUI.uf[key]:UpdateConfig() end + -- search pfUI.uf.frames first - these are the active unit frames + if pfUI.uf and pfUI.uf.frames then + for _, f in ipairs(pfUI.uf.frames) do + if f.label == key and f.id == "" then + ufunc = function() + for _, fr in ipairs(pfUI.uf.frames) do + if fr.label == key then + pfUI.uf.UpdateConfig(fr) + end + end + end + break + end + end + end + -- fallback to pfUI[key] for non-unitframe modules + if not ufunc then + if type(pfUI[key]) == "table" and pfUI[key].UpdateConfig then + ufunc = function() return pfUI[key]:UpdateConfig() end + elseif pfUI.uf and type(pfUI.uf[key]) == "table" and pfUI.uf[key].UpdateConfig then + ufunc = function() return pfUI.uf[key]:UpdateConfig() end + end end if ufunc then rawset(tab,key,ufunc) @@ -2922,4 +2940,4 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function () end end) end -end) +end) \ No newline at end of file