Thread Tools Display Modes
Prev Previous Post   Next Post Next
Unread 09-28-09, 07:49 AM   #11
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,263
Originally Posted by Icerat View Post
Back again sorry:

I have the following to show my experience bar and it works great does all i expected it to do, hide until mouse over and show a tooltip on my player.

For some reason though it wont show a bar for my hunters pet (pets not max lvl nor is me hunter)

Code:
-- EXPERIENCE BAR --
	if(IsAddOnLoaded('oUF_Experience') and (unit == 'player' or unit == 'pet')) then
			self.Experience = CreateFrame('StatusBar', nil, self)
			self.Experience:SetPoint('BOTTOMLEFT', self, 'TOPLEFT', 0, 5)
			self.Experience:SetPoint('BOTTOMRIGHT', self, 'TOPRIGHT', 0, 5)
				if(unit == "pet") then
					self.Experience:SetPoint("TOPLEFT", self, "BOTTOMLEFT", 0, -25)
					self.Experience:SetPoint("TOPRIGHT", self, "BOTTOMRIGHT", 0, -25)
				end
			self.Experience:SetHeight(3)
			self.Experience:SetStatusBarTexture(texture2)
			self.Experience:SetStatusBarColor(0.15, 0.7, 0.1)
			self.Experience.Tooltip = true
			
			self.Experience.Rested = CreateFrame('StatusBar', nil, self)
			self.Experience.Rested:SetParent(self.Experience)  -- Parent to the Experiance bar to get it to hide
			self.Experience.Rested:SetAllPoints(self.Experience)
			self.Experience.Rested:SetStatusBarTexture(texture2)
			self.Experience.Rested:SetStatusBarColor(0, 0.4, 1, 0.6)
			self.Experience.Rested:SetBackdrop(backdrop)
			self.Experience.Rested:SetBackdropColor(0, 0, 0)

--			self.Experience.Text = self.Experience:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmallOutline')
--			self.Experience.Text:SetPoint('CENTER', self.Experience)

			self.Experience.bg = self.Experience.Rested:CreateTexture(nil, 'BORDER')
			self.Experience.bg:SetAllPoints(self.Experience)
			self.Experience.bg:SetTexture(0.3, 0.3, 0.3)
			
			self.Experience:SetScript ('OnEnter', function(self) self:SetAlpha(1) end)
			self.Experience:SetScript ('OnLeave', function(self) self:SetAlpha(0) end)
			self.Experience:SetAlpha(0)
		end
What am i doing wrong? bets its something stupid, thanks in advance
You sure the pet aint the same level as the player?
p3lim is offline  
 

Go BackWoWInterface » Featured Projects » oUF (Otravi Unit Frames) » oUF - Layout discussion

Thread Tools
Display Modes

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