View Single Post
08-21-10, 01:11 PM   #13
sacrife
An Onyxian Warder
 
sacrife's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 384
I did not have a postCastStart in my layout and failed to create one so I tried to just manually listen for the event in the castbar code. Nothing happens though

Any ideas?

Code:
	------------- target castbar -----------
		elseif ( unit == 'target' ) then
			self.Castbar:RegisterEvent('UNIT_SPELLCAST_NOT_INTERRUPTABLE')
			self.Castbar:RegisterEvent('UNIT_SPELLCAST_INTERRUPTABLE')
			self.Castbar:SetScript('OnEvent', function(self, event, name)
				if (event == 'UNIT_SPELLCAST_INTERRUPTABLE') then
					self.Castbar.Text:SetTextColor(1,0,1)
					print("INTERRUPT")
				end
			end)
			
			self.Castbar.Text:SetWidth(275)
			self.Castbar.Time = self.Castbar:CreateFontString(nil, 'OVERLAY')		 
			self.Castbar.Time:SetFontObject(SystemFont_Tiny)		
			self.Castbar.CustomTimeText = function(self, duration)
				if self.casting then
					self.Time:SetFormattedText("%.1f", self.max - duration)
				elseif self.channeling then
					self.Time:SetFormattedText("%.1f", duration)
				end
			end

				self.Castbar:SetToplevel(true)
				self.Castbar:SetStatusBarColor(1, 1, 1, 0.4)
				self.Castbar:SetWidth(sett1ngs.mX)
				self.Castbar:SetHeight(sett1ngs.mhp)
				self.Castbar:SetParent(self.Health) 
				self.Castbar:SetPoint("TOPLEFT",'oUF_target',"TOPLEFT",0,0)

				self.Castbar.Spark = self.Castbar:CreateTexture(nil, 'OVERLAY')
				self.Castbar.Spark:SetHeight(sett1ngs.mhp+sett1ngs.mpower+28)
				self.Castbar.Spark:SetWidth(10)
				self.Castbar.Spark:SetBlendMode('ADD')

				self.Castbar.Text:SetPoint("TOP", self.Castbar, "TOP", 0, 0.5)
				self.Castbar.Text:SetJustifyH"CENTER"
				--self.Castbar.Text:SetTextColor(1,1,1)
				
				self.Castbar.Time:SetPoint("CENTER", self.Castbar, "CENTER", 0, -3)
				--self.Castbar.Time:SetTextColor(1,1,1)
				
				self.Castbar:SetFrameStrata("HIGH")
				
				self.Castbar.Button = CreateFrame('Frame', nil, self.Castbar)
				self.Castbar.Button:SetHeight(sett1ngs.cbplayerH-3)
				self.Castbar.Button:SetWidth(sett1ngs.cbplayerH-3)
				self.Castbar.Button:SetBackdrop(backdrop)
				self.Castbar.Button:SetBackdropColor(0, 0, 0)
				self.Castbar.Button:SetPoint('RIGHT', self.Castbar, 'LEFT', -3, -1)
				self.Castbar.Button.bd = SetBD(self.Castbar.Button, backdrop, sett1ngs.bcolor)
				self.Castbar.bd = SetBD(self.Castbar, backdrop, sett1ngs.bcolor)

				self.Castbar.Icon = self.Castbar.Button:CreateTexture(nil, 'ARTWORK')
				self.Castbar.Icon:SetAllPoints(self.Castbar.Button)
				self.Castbar.Icon:SetTexCoord(0.08, 0.92, 0.08, 0.92)
__________________

  Reply With Quote