From 441a3efa348746f6e7599400fa715e0c527d1420 Mon Sep 17 00:00:00 2001 From: p3lim-52096 Date: Tue, 13 Jan 2009 20:39:59 +0000 Subject: [PATCH] Added unit check for UNIT_PET Removed faulty unit check Removed unneeded script creations git-svn-id: svn://svn.wowinterface.com/oUF_Experience-227/trunk@25 f81be506-7a38-4956-9b9f-d707db2888a5 --- oUF_Experience/oUF_Experience.lua | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/oUF_Experience/oUF_Experience.lua b/oUF_Experience/oUF_Experience.lua index 844457f..a0a8cd3 100644 --- a/oUF_Experience/oUF_Experience.lua +++ b/oUF_Experience/oUF_Experience.lua @@ -23,9 +23,9 @@ local function Tooltip(self, unit, min, max) end local function Update(self, event, unit) - if(self.unit ~= unit) then return end + if(event == 'UNIT_PET' and unit ~= 'player') then return end local bar = self.Experience - + if(self.unit == 'pet' and UnitLevel('pet') == UnitLevel('player')) then bar:Hide() elseif(self.unit == 'player' and UnitLevel('player') == MAX_PLAYER_LEVEL) then @@ -54,13 +54,8 @@ local function Update(self, event, unit) if(bar.Tooltip and bar.MouseOver) then bar:SetScript('OnEnter', function() bar:SetAlpha(1); Tooltip(bar, self.unit, min, max) end) - bar:SetScript('OnLeave', function() bar:SetAlpha(0); GameTooltip:Hide() end) elseif(bar.Tooltip and not bar.MouseOver) then bar:SetScript('OnEnter', function() Tooltip(bar, self.unit, min, max) end) - bar:SetScript('OnLeave', function() GameTooltip:Hide() end) - elseif(bar.MouseOver and not bar.Tooltip) then - bar:SetScript('OnEnter', function() bar:SetAlpha(1) end) - bar:SetScript('OnLeave', function() bar:SetAlpha(0) end) end end end @@ -76,8 +71,15 @@ local function Enable(self) experience:SetStatusBarTexture([=[Interface\TargetingFrame\UI-StatusBar]=]) end - if(experience.MouseOver) then + if(experience.Tooltip and experience.MouseOver) then + experience:SetAlpha(0) + experience:SetScript('OnLeave', function(self) self:SetAlpha(0); GameTooltip:Hide() end) + elseif(experience.MouseOver and not experience.Tooltip) then experience:SetAlpha(0) + experience:SetScript('OnEnter', function(self) self:SetAlpha(1) end) + experience:SetScript('OnLeave', function(self) self:SetAlpha(0) end) + elseif(experience.Tooltip and not experience.MouseOver) then + experience:SetScript('OnLeave', function(self) GameTooltip:Hide() end) end return true -- 1.7.9.5