I was in the midst of cleaning up my layout and came across something I cant figure out why is happening.
At the bottom of my layout just before I spawn the the frames I have this piece of code. If I put the combopoints part above the SetAttributes part, I get no error, but the unitframes are invisible. Any ideas?
Code:
if(unit == "targettarget") then
self:SetAttribute('initial-height', sett1ngs.shp+sett1ngs.spower+1)
self:SetAttribute('initial-width', sett1ngs.sX)
elseif (unit == "pet" or unit == "pettarget") then
self:SetAttribute('initial-height', sett1ngs.shp+sett1ngs.spower+1)
self:SetAttribute('initial-width', sett1ngs.sX)
elseif (unit == "focus") then
self:SetAttribute('initial-height', sett1ngs.mhp+sett1ngs.mpower+1)
self:SetAttribute('initial-width', sett1ngs.sX)
elseif (unit == "player" or unit == "target") then
self:SetAttribute('initial-height', sett1ngs.mhp+sett1ngs.mpower+1)
self:SetAttribute('initial-width', sett1ngs.mX)
end
if (unit == 'target') then
self.CPoints = {}
for id = 1, MAX_COMBO_POINTS do
self.CPoints[id] = CreateFrame('StatusBar', nil, self)
if (id > 1) then
self.CPoints[id]:SetPoint('TOPLEFT', self.CPoints[id-1], 'TOPRIGHT', 1, 0)
else
self.CPoints[id]:SetPoint('TOPLEFT', self, 'BOTTOMLEFT', 0, -1)
end
self.CPoints[id]:SetStatusBarTexture(sett1ngs.texture)
self.CPoints[id]:GetStatusBarTexture():SetHorizTile(false)
local r, g, b
local class = select(2, UnitClass('player'))
if class then
r = RAID_CLASS_COLORS[class].r
g = RAID_CLASS_COLORS[class].g
b = RAID_CLASS_COLORS[class].b
end
self.CPoints[id]:SetStatusBarColor(r, g, b, 1)
self.CPoints[id].bd = SetBD(self.CPoints[id], backdrop, sett1ngs.bcolor)
self.CPoints[id]:SetHeight(sett1ngs.panelsH)
self.CPoints[id]:SetWidth((sett1ngs.mX-4) / MAX_COMBO_POINTS)
end
self.CPoints.unit = PlayerFrame.unit
self:RegisterEvent('UNIT_COMBO_POINTS', updateCombo)
end
if ( sett1ngs.swapV == true ) then
self.disallowVehicleSwap = false
else
self.disallowVehicleSwap = true
end
return self
end