From 53a53377f09c06c03c680d6f7c386eb5a613ae54 Mon Sep 17 00:00:00 2001 From: p3lim Date: Tue, 7 Sep 2010 03:40:58 +0200 Subject: [PATCH] Back to basics --- oUF_Reputation.lua | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/oUF_Reputation.lua b/oUF_Reputation.lua index aa30f23..b62a0fa 100644 --- a/oUF_Reputation.lua +++ b/oUF_Reputation.lua @@ -1,21 +1,19 @@ local function Update(self, event, unit) - local bar = self.Reputation - if(not GetWatchedFactionInfo()) then return bar:Hide() end - - local name, id, min, max, value = GetWatchedFactionInfo() - bar:SetMinMaxValues(min, max) - bar:SetValue(value) - bar:Show() - - if(bar.Text) then - if(bar.OverrideText) then - bar:OverrideText(min, max, value, name, id) - else - bar.Text:SetFormattedText('%d / %d - %s', value - min, max - min, name) - end + local reputation = self.Reputation + + if(not GetWatchedFactionInfo()) then + return reputation:Hide() + else + reputation:Show() end - if(bar.PostUpdate) then bar.PostUpdate(self, event, unit, bar, min, max, value, name, id) end + local name, standing, min, max, value = GetWatchedFactionInfo() + reputation:SetMinMaxValues(min, max) + reputation:SetValue(value) + + if(reputation.PostUpdate) then + return reputation:PostUpdate(unit, name, standing, min, max, value) + end end local function Path(self, ...) @@ -27,15 +25,15 @@ local function ForceUpdate(element) end local function Enable(self, unit) - local bar = self.Reputation - if(bar) then - bar.__owner = self - bar.ForceUpdate = ForceUpdate + local reputation = self.Reputation + if(reputation) then + reputation.__owner = self + reputation.ForceUpdate = ForceUpdate self:RegisterEvent('UPDATE_FACTION', Path) - if(not bar:GetStatusBarTexture()) then - bar:SetStatusBarTexture([=[Interface\TargetingFrame\UI-StatusBar]=]) + if(not reputation:GetStatusBarTexture()) then + reputation:SetStatusBarTexture([=[Interface\TargetingFrame\UI-StatusBar]=]) end return true -- 1.7.9.5