I'm trying to crop down my file lenght by creating a function to set Icons.
Code:
function Icon()
local f = CreateFrame("Frame",nil,arg1)
f:SetFrameStrata("Medium")
f:SetWidth(64)
f:SetHeight(64)
local t = f:CreateTexture(nil,"BACKGROUND")
t:SetTexture("Interface\\AddOns\\miirGui\\gfx\\"..arg2)
t:SetAllPoints(f)
f.texture = t
f:SetPoint("Topleft",5,-4)
f:Show()
end
Using Icon(DressUpFrame, dress) it creates Interface\AddOns\miirGui\core.lua:14: attempt to concatenate global 'arg2' (a nil value).
Anyone knows how to fix it?