Hi all,
It's been a while since I posted my last oUF related thread here
So, I'm currently spawning my raid group frames like the following:
Lua Code:
local koverwatch = LSM:Fetch("font", "koverwatch");
for i = 1, NUM_RAID_GROUPS do
local overrideName = "Raid" .. i;
width = db.raid.width;
height = db.raid.height;
point, relativeFrame, relativePoint, ofsx, ofsy = unpack(db.raid.position);
if i >= 2 then
ofsx = ofsx + ((width + 3) * ((i - 1) % 4));
end
if i >= 5 then
ofsy = ofsy + (height + 3) * 5 + 28;
end
local group = self:SpawnHeader(
overrideName,
nil,
"custom [group:raid] show; hide",
-- attributes
"oUF-initialConfigFunction", ("self:SetWidth(%d); self:SetHeight(%d);"):format(width, height),
"showRaid", true,
"showParty", false,
"showPlayer", true,
"showSolo", false,
"groupFilter", tostring(i),
"point", "LEFT",
-- "xOffset", ,
-- "yOffset", ,
"maxColumns", 5,
"unitsPerColumn", 1,
"columnSpacing", 8,
"columnAnchorPoint", "TOP"
);
group:SetPoint(point, relativeFrame, relativePoint, ofsx, ofsy);
group:SetScript("OnShow", function(self)
self.headText:Show();
end);
group:SetScript("OnHide", function(self)
self.headText:Hide();
end);
local headText = group:CreateFontString("$parentHeadText", "OVERLAY");
headText:SetFont(koverwatch, 14, "OUTLINE");
headText:SetPoint("BOTTOM", group, "TOP");
headText:SetText("Group " .. i);
headText:Hide();
group.headText = headText;
end
I'm currently trying to display a text, "Group N", on top of each group's frame, but it seems like those frames don't call OnShow/OnHide scripts
So, I've tested it without headText being hidden on creation and here's what it looks like at the moment.
From "Group 1" to "Group 7" are properly positioned while "Group 8" is off...
So, my conclusion here is that each of groups are created and already visible since I'm in raid group (and that's why it's not calling OnShow/OnHide scripts), but are not yet sized correctly until that particular group gets a member in it and that's why it's causing this.
However, I'm still unsure of how I could fix this
Any helps, please?!
Thank you!!