View Single Post
08-16-10, 04:43 PM   #9
Toran
A Nerdscale Dorkin
 
Toran's Avatar
Premium Member
Join Date: May 2006
Posts: 143
Originally Posted by Rostok View Post
put the
Code:
self:RegisterEvent("UNIT_COMBO_POINTS", updateCPoints)
outside the loop for.
Thank you!

Here's the chunk of code that worked:

Code:
if playerClass == "ROGUE" or playerClass == "DRUID" then
			local CPoints = {}
			CPoints.unit = "player"
			for index = 1, MAX_COMBO_POINTS do
				local CPoint = CreateFrame("Frame", nil, self.Health)
				CPoint:SetHeight(6)
				CPoint:SetWidth(width * .96 / MAX_COMBO_POINTS)
				CPoint:SetFrameStrata("BACKGROUND")
				kiss_set_me_a_backdrop(CPoint)
				CPoint.bg = CPoint:CreateTexture(nil, "LOW")
				CPoint.bg:SetTexture(texture)
				CPoint.bg:SetAllPoints(CPoint)
				--CPoint:SetPoint('LEFT', index == 1 and self.Health or CPoints[index - 1], 'LEFT', 20, 10)
				if(index == 1) then
					CPoint:SetPoint("LEFT", self.Health, "LEFT", 0, 15)
				else
					CPoint:SetPoint("LEFT", CPoints[index-1], "RIGHT", 2, 0)
				end

				if(index == 1) then CPoint.bg:SetVertexColor(1,1,0) end
				if(index == 2) then CPoint.bg:SetVertexColor(1,0.75,0) end
				if(index == 3) then CPoint.bg:SetVertexColor(1,0.5,0) end
				if(index == 4) then CPoint.bg:SetVertexColor(1,0.25,0) end
				if(index == 5) then CPoint.bg:SetVertexColor(1,0,0) end
				CPoints[index] = CPoint
			end
			self:RegisterEvent("UNIT_COMBO_POINTS", updateCPoints)
			self.CPoints = CPoints
		end

Last edited by Toran : 08-16-10 at 04:49 PM.
  Reply With Quote