From 654146f0ab888195bf96452041d98be1f5a83748 Mon Sep 17 00:00:00 2001 From: p3lim-52096 Date: Thu, 11 Jun 2009 20:18:27 +0000 Subject: [PATCH] Fixed rested bar values git-svn-id: svn://svn.wowinterface.com/oUF_Experience-227/trunk@35 f81be506-7a38-4956-9b9f-d707db2888a5 --- oUF_Experience/oUF_Experience.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/oUF_Experience/oUF_Experience.lua b/oUF_Experience/oUF_Experience.lua index bbd04ea..f41aca4 100644 --- a/oUF_Experience/oUF_Experience.lua +++ b/oUF_Experience/oUF_Experience.lua @@ -25,9 +25,8 @@ local function showTooltip(self, unit, min, max, bars) GameTooltip:AddLine(format('XP: %d/%d (%.1f%%)', min, max, min / max * 100)) GameTooltip:AddLine(format('%d needed (%.1f%% - %.1f bars)', max - min, (max - min) / max * 100, bars * (max - min) / max)) - local rested = GetXPExhaustion() - if(unit == 'player' and rested and rested > 0) then - GameTooltip:AddLine(format('|cff0090ffRested: +%d (%.1f%%)', rested, rested / max * 100)) + if(unit == 'player' and GetXPExhaustion() and GetXPExhaustion() > 0) then + GameTooltip:AddLine(format('|cff0090ffRested: +%d (%.1f%%)', GetXPExhaustion(), GetXPExhaustion() / max * 100)) end GameTooltip:Show() @@ -44,7 +43,7 @@ end local function Update(self) local bar, unit = self.Experience, self.unit local min, max = getXP(unit) - bar:SetMinMaxValues(math.min(0, min), max) + bar:SetMinMaxValues(0, max) bar:SetValue(min) if(bar.Text) then @@ -57,7 +56,7 @@ local function Update(self) if(bar.Rested and unit == 'player') then if(GetXPExhaustion() and GetXPExhaustion() > 0) then - bar.Rested:SetMinMaxValues(min, max) + bar.Rested:SetMinMaxValues(0, max) bar.Rested:SetValue(math.min(min + GetXPExhaustion(), max)) else bar.Rested:SetMinMaxValues(0, 1) -- 1.7.9.5