Hi all,
I finally started to make party frame with oUF and here's what it looks so far.
Lua Code:
C.Party = oUF:SpawnHeader(
"testParty",
nil,
"custom [group:party,nogroup:raid] show; hide",
-- attributes
"initial-width", G["unitframe"]["party"]["width"],
"initial-height", G["unitframe"]["party"]["height"],
"oUF-initialConfigFunction", [[
local header = self:GetParent();
self:SetWidth(header:GetAttribute("initial-width"));
self:SetHeight(header:GetAttribute("initial-height"));
]],
"showRaid", false,
"showParty", true,
"showSolo", false,
"showPlayer", true,
"point", "TOP",
"xOffset", 0,
"yOffset", -40
);
C.Party:SetPoint(unpack(G["unitframe"]["party"]["point"]));
The one thing that I am currently unhappy with is that it adds
"UnitButton" to each party frame's name.
I thought this was because of
"SecureGroupHeaderTemplate", thus I have dug into Blizzard's interface code and found the following lines of code from
SecureGroupHeaders.lua
Lua Code:
-- ensure there are enough buttons
local needButtons = max(1, numDisplayed);
if not ( self:GetAttribute("child"..needButtons) ) then
local buttonTemplate = self:GetAttribute("template");
local templateType = self:GetAttribute("templateType") or "Button";
local name = self:GetName();
for i = 1, needButtons, 1 do
local childAttr = "child" .. i;
if not ( self:GetAttribute(childAttr) ) then
local newButton = CreateFrame(templateType, name and (name.."UnitButton"..i), self, buttonTemplate);
self[i] = newButton;
SetupUnitButtonConfiguration(self, newButton);
setAttributesWithoutResponse(self, childAttr, newButton, "frameref-"..childAttr, GetFrameHandle(newButton));
end
end
end
To be honest, I don't think I can create my own custom template with my current skills, but really would like to get rid of that "UnitButton" text from frame's name.
If anyone could suggest a workaround, I would really appreciate it!
Thank you.