You could try something like:
Code:
local bottom = CreateFrame('Frame', "GrimUIcoreArtB", UIParent)
bottom:SetAllPoints()
bottom:SetFrameStrata('BACKGROUND')
bottom[1] = bottom:CreateTexture("GrimUIcoreArtB1", 'BACKGROUND')
bottom[1]:SetWidth(468)
bottom[1]:SetPoint('BOTTOMLEFT')
bottom[2] = bottom:CreateTexture("GrimUIcoreArtB2", 'BACKGROUND')
bottom[2]:SetPoint('LEFT', bottom[1], 'RIGHT')
bottom[2]:SetPoint('RIGHT', bottom, 'CENTER')
bottom[4] = bottom:CreateTexture("GrimUIcoreArtB4", 'BACKGROUND')
bottom[4]:SetWidth(474)
bottom[4]:SetPoint('BOTTOMRIGHT')
bottom[3] = bottom:CreateTexture("GrimUIcoreArtB3", 'BACKGROUND')
bottom[3]:SetPoint('RIGHT', bottom[4], 'LEFT')
bottom[3]:SetPoint('LEFT', bottom[2], 'RIGHT')
for index = 1, #bottom do
bottom[index]:SetHeight(238)
end
function GrimUI_LoadSkin(name)
local path = [[Interface\AddOns\!GrimUI\Art\]] .. name .. [[\Bottom]]
for index = 1, #bottom do
bottom[index]:SetTexture(path .. index)
end
end
And if your textures will always basically be horizontally flipped copies of each other you could change it to:
Code:
function GrimUI_LoadSkin(name)
local path = [[Interface\AddOns\!GrimUI\Art\]] .. name .. [[\Bottom]]
bottom[1]:SetTexture(path .. 1)
bottom[2]:SetTexture(path .. 2)
bottom[3]:SetTexture(path .. 2)
bottom[4]:SetTexture(path .. 1)
bottom[3]:SetTexCoord(1, 0, 0, 1)
bottom[4]:SetTexCoord(1, 0, 0, 1)
end
That will allow you to only need 2 textures per skin vice 4.