Suppose i should explain a little more. So im setting up the skinning for GrimUI. i have put the skins within directory's called skin1 skin2 so on and so forth. The primary art is then called bottom1.blp bottom2.blp so on and so forth. What im trying to do is get the following code to read bgFile="Interface\\AddOns\\!GrimUI\\Art\\Skin"..index\\Bottom"..index
then what im wanting to do is make the skin index a variable somehow so when the skin is selected on the option panel it would switch and save the variable.
Right now the code looks like this,
Code:
local function createBottomArt(index)
local frame = CreateFrame("Frame", "GrimUIcoreArtB"..index, UIParent)
frame:SetHeight(238)
frame:SetFrameStrata("BACKGROUND")
frame:SetBackdrop{
bgFile = "Interface\\AddOns\\!GrimUI\\Art\\Bottom"..index,
edgeFile = nil, tile = false, tileSize = 0, edgeSize = 0,
insets = { left = 0, right = 0, top = 0, bottom = 0 }
}
-- We return the frame back, so we can do more with it later
return frame
end
-- Now let's call our newly created function for art1
local art1 = createBottomArt(1)
art1:SetWidth(468)
art1:SetPoint("BOTTOMLEFT")
local art4 = createBottomArt(4)
art4:SetWidth(474)
art4:SetPoint("BOTTOMRIGHT")
local art2 = createBottomArt(2)
art2:SetPoint("LEFT", GrimUIcoreArtB1, "RIGHT")
art2:SetPoint("RIGHT", UIParent, "CENTER")
art2:SetPoint("BOTTOM")
local art3 = createBottomArt(3)
art3:SetPoint("RIGHT", GrimUIcoreArtB4, "LEFT")
art3:SetPoint("LEFT", UIParent, "CENTER")
art3:SetPoint("BOTTOM")