mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-23 04:20:50 +00:00
unitframes: add option to show self in group
This commit is contained in:
@@ -87,6 +87,7 @@ function pfUI:LoadConfig()
|
|||||||
pfUI:UpdateConfig("unitframes", nil, "combosize", "6")
|
pfUI:UpdateConfig("unitframes", nil, "combosize", "6")
|
||||||
pfUI:UpdateConfig("unitframes", nil, "abbrevnum", "1")
|
pfUI:UpdateConfig("unitframes", nil, "abbrevnum", "1")
|
||||||
|
|
||||||
|
pfUI:UpdateConfig("unitframes", nil, "selfingroup", "0")
|
||||||
pfUI:UpdateConfig("unitframes", nil, "show_hots", "0")
|
pfUI:UpdateConfig("unitframes", nil, "show_hots", "0")
|
||||||
pfUI:UpdateConfig("unitframes", nil, "all_hots", "0")
|
pfUI:UpdateConfig("unitframes", nil, "all_hots", "0")
|
||||||
pfUI:UpdateConfig("unitframes", nil, "show_procs", "0")
|
pfUI:UpdateConfig("unitframes", nil, "show_procs", "0")
|
||||||
|
|||||||
@@ -38,6 +38,22 @@ function pfUI.uf:CreateUnitFrame(unit, id, config, tick)
|
|||||||
|
|
||||||
local f = CreateFrame("Button", "pf" .. fname, UIParent)
|
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
|
if not pfValidUnits[unit .. id] then
|
||||||
f.unitname = unit
|
f.unitname = unit
|
||||||
f.RegisterEvent = function() return end
|
f.RegisterEvent = function() return end
|
||||||
@@ -525,6 +541,14 @@ function pfUI.uf:RefreshUnit(unit, component)
|
|||||||
-- break early on misconfigured UF's
|
-- break early on misconfigured UF's
|
||||||
if not unit.label then return end
|
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 unit.label == "target" or unit.label == "targettarget" then
|
||||||
if pfScanActive == true then return end
|
if pfScanActive == true then return end
|
||||||
end
|
end
|
||||||
|
|||||||
+7
-4
@@ -19,10 +19,12 @@ pfUI:RegisterModule("group", function ()
|
|||||||
|
|
||||||
pfUI.uf.group = {}
|
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] = pfUI.uf:CreateUnitFrame("Party", i, C.unitframes.group)
|
||||||
pfUI.uf.group[i]:UpdateFrameSize()
|
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])
|
UpdateMovable(pfUI.uf.group[i])
|
||||||
|
|
||||||
pfUI.uf.group[i].target = pfUI.uf:CreateUnitFrame("Party" .. i .. "Target", nil, C.unitframes.grouptarget, 0.2)
|
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)
|
UpdateMovable(pfUI.uf.group[i].pet)
|
||||||
end
|
end
|
||||||
|
|
||||||
pfUI.uf.partytargetScanner = CreateFrame("Button",nil,UIParent)
|
pfUI.uf.groupscanner = CreateFrame("Frame", nil, UIParent)
|
||||||
pfUI.uf.partytargetScanner:SetScript("OnUpdate", function()
|
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
|
for i=1, 4 do
|
||||||
if UnitExists("party" .. i .. "target") or (pfUI.unlock and pfUI.unlock:IsShown()) then
|
if UnitExists("party" .. i .. "target") or (pfUI.unlock and pfUI.unlock:IsShown()) then
|
||||||
pfUI.uf.group[i].target:Show()
|
pfUI.uf.group[i].target:Show()
|
||||||
|
|||||||
@@ -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 = pfUI.gui.tabs.gf.tabs:CreateChildFrame(T["General"], 70)
|
||||||
pfUI.gui.tabs.gf.tabs.general:SetScript("OnShow", function()
|
pfUI.gui.tabs.gf.tabs.general:SetScript("OnShow", function()
|
||||||
if not this.setup then
|
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 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 Hots of all Classes"], C.unitframes, "all_hots", "checkbox")
|
||||||
CreateConfig(this, T["Show Procs as Buff Indicators"], C.unitframes, "show_procs", "checkbox")
|
CreateConfig(this, T["Show Procs as Buff Indicators"], C.unitframes, "show_procs", "checkbox")
|
||||||
|
|||||||
Reference in New Issue
Block a user