From 147d57c76714bf0895815fb5607872b4d2a69672 Mon Sep 17 00:00:00 2001 From: shagu Date: Sat, 7 Jul 2018 15:20:49 +0200 Subject: [PATCH] group: disable group target scanner on config --- modules/group.lua | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/modules/group.lua b/modules/group.lua index 23e10b90..c4584072 100644 --- a/modules/group.lua +++ b/modules/group.lua @@ -2,6 +2,21 @@ pfUI:RegisterModule("group", function () -- do not go further on disabled UFs if C.unitframes.disable == "1" then return end + -- scan for group targets + pfUI.uf.groupscanner = CreateFrame("Frame", nil, UIParent) + pfUI.uf.groupscanner:Hide() + pfUI.uf.groupscanner:SetScript("OnUpdate", function() + if ( this.limit or 1) > GetTime() then return else this.limit = GetTime() + .2 end + + for i=1, 4 do + if (UnitExists("party" .. i) and UnitExists("party" .. i .. "target")) or (pfUI.unlock and pfUI.unlock:IsShown()) then + pfUI.uf.group[i].target:Show() + else + pfUI.uf.group[i].target:Hide() + end + end + end) + -- hide blizzard group frames for i=1, 4 do if _G["PartyMemberFrame" .. i] then @@ -40,7 +55,9 @@ pfUI:RegisterModule("group", function () pfUI.uf.group[i].target:SetPoint("TOPLEFT", pfUI.uf.group[i], "TOPRIGHT", 3*default_border, 0) pfUI.uf.group[i].target:UpdateConfig() UpdateMovable(pfUI.uf.group[i].target) + pfUI.uf.groupscanner:Show() elseif pfUI.uf.group[i] and pfUI.uf.group[i].target then + pfUI.uf.groupscanner:Hide() pfUI.uf.group[i].target:UpdateConfig() RemoveMovable(pfUI.uf.group[i].target) end @@ -59,19 +76,4 @@ pfUI:RegisterModule("group", function () end pfUI.uf.group:UpdateConfig() - - -- scan for group targets - if C.unitframes.grouptarget.visible == "1" then - pfUI.uf.groupscanner = CreateFrame("Frame", nil, UIParent) - pfUI.uf.groupscanner:SetScript("OnUpdate", function() - if ( this.limit or 1) > GetTime() then return else this.limit = GetTime() + .2 end - for i=1, 4 do - if (UnitExists("party" .. i) and UnitExists("party" .. i .. "target")) or (pfUI.unlock and pfUI.unlock:IsShown()) then - pfUI.uf.group[i].target:Show() - else - pfUI.uf.group[i].target:Hide() - end - end - end) - end end)