Thread Tools Display Modes
08-21-10, 02:22 PM   #1
sacrife
An Onyxian Warder
 
sacrife's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 384
Confusing results. (Look inside, hard to explain)

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
__________________

  Reply With Quote
08-22-10, 07:09 AM   #2
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
If you move the whole part with cpoints and that before initial-sizing, you also move the 'return self' part I guess.

if you didnt know, return stops everything in a function/table lookup/whatever, and returns the arguments followed.

The part with 'return self' was something oUF required before (I don't remember right, but it was in 1.2 or maybe even 1.1), so you dont have any use of it now.
  Reply With Quote
08-22-10, 03:55 PM   #3
sacrife
An Onyxian Warder
 
sacrife's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 384
Switched places, removed the return part. Same result.
__________________

  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Confusing results. (Look inside, hard to explain)


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off