Code:
-- Assuming that 'container' is the container frame mentioned above
-- I'm not sure about the offset and height values. This is a drycoded example. Play around until it fits.
container.entries = setmetatable({},{__index=function(t,v)
local entryFrame = CreateFrame("Frame",nil,container)
entryFrame:SetHeight(25)
if v == 1 then
entryFrame:SetPoint("TOPLEFT",container,"TOPLEFT",10,-10)
entryFrame:SetPoint("TOPRIGHT",container,"TOPRIGHT",-10,-10)
else
entryFrame:SetPoint("TOPLEFT",t[v-1][3],"BOTTOMLEFT",0,-10)
entryFrame:SetPoint("TOPRIGHT",t[v-1][3],"BOTTOMRIGHT",0,-10)
end
local text1 = entryFrame:CreateFontString(nil,"ARTWORK")
text1:SetPoint("TOPLEFT")
text1:SetPoint("TOPRIGHT")
text1:SetFont("Fonts\\FRIZQT__.TTF",12,"OUTLINE")
text1:SetTextColor(1,1,1)
text1:SetJustifyH("LEFT")
text1.frame = entryFrame
local text2 = entryFrame:CreateFontString(nil,"ARTWORK")
text2:SetPoint("BOTTOMLEFT")
text2:SetPoint("BOTTOMRIGHT",
text2:SetFont("Fonts\\FRIZQT__.TTF",12,"OUTLINE")
text2:SetTextColor(1,1,1)
text2:SetJustifyH("LEFT")
text2.frame = entryFrame
t[v] = {text1,text2,entryFrame}
return t[v]
end})
-- assuming entryList is a numerically indexed table of tables. each sub-table contains two strings
-- example: {{"1) Win - Loss: 6 - 1 (85%)","Gitta - Frostmourne,Archeia - Frostmourne"},{"2) Win - Loss: 25 - 5 (83%)","Bubblèwrap - Barthilas,Orion - Barthilas"}}
-- these should have color codes, of course
local function setExample(title,entryList)
-- remember to set the label fontstring, too. this example doesn't do it.
for i=1,#entryList do
local e = entryList[i]
local f = container.entries[e]
f[3]:Show() -- f[3] is the entry's frame
f[1]:SetText(e[1]) -- f[1] is the top fontstring
f[2]:SetText(e[2]) -- f[2] is the bottom fontstring
end
for i=(#entryList+1),#container.entries do
container.entries[i][3]:Hide() -- hide frames for all entries we aren't using
end
end
All of the above is drycoded. All sizes, font sizes and offsets are thus pure guesswork. Errors may be contained.