diff --git a/api/config.lua b/api/config.lua index fed7b1ca..e6c78795 100644 --- a/api/config.lua +++ b/api/config.lua @@ -87,6 +87,7 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("unitframes", nil, "combosize", "6") pfUI:UpdateConfig("unitframes", nil, "abbrevnum", "1") + pfUI:UpdateConfig("unitframes", nil, "selfingroup", "0") pfUI:UpdateConfig("unitframes", nil, "show_hots", "0") pfUI:UpdateConfig("unitframes", nil, "all_hots", "0") pfUI:UpdateConfig("unitframes", nil, "show_procs", "0") diff --git a/api/unitframes.lua b/api/unitframes.lua index 2102301f..624f98b0 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -38,6 +38,22 @@ function pfUI.uf:CreateUnitFrame(unit, id, config, tick) local f = CreateFrame("Button", "pf" .. fname, UIParent) + -- show self in group + if unit == "party" and id == "0" then + unit = "player" + id = "" + end + + if unit == "partypet" and id == "0" then + unit = "pet" + id = "" + end + + if unit == "party0target" then + unit = "target" + id = "" + end + if not pfValidUnits[unit .. id] then f.unitname = unit f.RegisterEvent = function() return end @@ -525,6 +541,14 @@ function pfUI.uf:RefreshUnit(unit, component) -- break early on misconfigured UF's if not unit.label then return end + -- hide self in group + if unit.fname == "Group0" or unit.fname == "PartyPet0" or unit.fname == "Party0Target" then + if GetNumPartyMembers() <= 0 then + unit:Hide() + return + end + end + if unit.label == "target" or unit.label == "targettarget" then if pfScanActive == true then return end end diff --git a/modules/group.lua b/modules/group.lua index 5e0b1d28..a8f63741 100644 --- a/modules/group.lua +++ b/modules/group.lua @@ -19,10 +19,12 @@ pfUI:RegisterModule("group", function () pfUI.uf.group = {} - for i=1, 4 do + local startid = C.unitframes.selfingroup == "1" and 0 or 1 + + for i=startid, 4 do pfUI.uf.group[i] = pfUI.uf:CreateUnitFrame("Party", i, C.unitframes.group) pfUI.uf.group[i]:UpdateFrameSize() - pfUI.uf.group[i]:SetPoint("TOPLEFT", 5, -5 - ((i-1)*75)) + pfUI.uf.group[i]:SetPoint("TOPLEFT", 5, -5 - ((i-startid)*75)) UpdateMovable(pfUI.uf.group[i]) pfUI.uf.group[i].target = pfUI.uf:CreateUnitFrame("Party" .. i .. "Target", nil, C.unitframes.grouptarget, 0.2) @@ -37,8 +39,9 @@ pfUI:RegisterModule("group", function () UpdateMovable(pfUI.uf.group[i].pet) end - pfUI.uf.partytargetScanner = CreateFrame("Button",nil,UIParent) - pfUI.uf.partytargetScanner:SetScript("OnUpdate", function() + 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 .. "target") or (pfUI.unlock and pfUI.unlock:IsShown()) then pfUI.uf.group[i].target:Show() diff --git a/modules/gui.lua b/modules/gui.lua index 3e532da6..de6a20f1 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -1119,6 +1119,7 @@ pfUI:RegisterModule("gui", function () pfUI.gui.tabs.gf.tabs.general = pfUI.gui.tabs.gf.tabs:CreateChildFrame(T["General"], 70) pfUI.gui.tabs.gf.tabs.general:SetScript("OnShow", function() if not this.setup then + CreateConfig(this, T["Show Self as Group Member"], C.unitframes, "selfingroup", "checkbox") CreateConfig(this, T["Show Hots as Buff Indicators"], C.unitframes, "show_hots", "checkbox") CreateConfig(this, T["Show Hots of all Classes"], C.unitframes, "all_hots", "checkbox") CreateConfig(this, T["Show Procs as Buff Indicators"], C.unitframes, "show_procs", "checkbox")