From a346d80147375ca7595e8877f2553b3c4110a9cf Mon Sep 17 00:00:00 2001 From: Adrian L Lange Date: Sat, 26 Jul 2014 19:31:10 +0200 Subject: [PATCH] Generalize the variables --- oUF_Reputation.lua | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/oUF_Reputation.lua b/oUF_Reputation.lua index 0277def..1ae8fe0 100644 --- a/oUF_Reputation.lua +++ b/oUF_Reputation.lua @@ -41,26 +41,26 @@ end oUF.Tags.SharedEvents.UPDATE_FACTION = true local function Update(self, event, unit) - local reputation = self.Reputation + local element = self.Reputation local name, standingID, _, _, _, id = GetWatchedFactionInfo() if(not name) then - return reputation:Hide() + return element:Hide() else - reputation:Show() + element:Show() end local min, max, standingText = GetReputation() - reputation:SetMinMaxValues(0, max) - reputation:SetValue(min) + element:SetMinMaxValues(0, max) + element:SetValue(min) - if(reputation.colorStanding) then + if(element.colorStanding) then local color = FACTION_BAR_COLORS[standingID] - reputation:SetStatusBarColor(color.r, color.g, color.b) + element:SetStatusBarColor(color.r, color.g, color.b) end - if(reputation.PostUpdate) then - return reputation:PostUpdate(unit, min, max, name, id, standingID, standingText) + if(element.PostUpdate) then + return element:PostUpdate(unit, min, max, name, id, standingID, standingText) end end @@ -73,15 +73,15 @@ local function ForceUpdate(element) end local function Enable(self, unit) - local reputation = self.Reputation - if(reputation) then - reputation.__owner = self - reputation.ForceUpdate = ForceUpdate + local element = self.Reputation + if(element) then + element.__owner = self + element.ForceUpdate = ForceUpdate self:RegisterEvent('UPDATE_FACTION', Path) - if(not reputation:GetStatusBarTexture()) then - reputation:SetStatusBarTexture([[Interface\TargetingFrame\UI-StatusBar]]) + if(not element:GetStatusBarTexture()) then + element:SetStatusBarTexture([[Interface\TargetingFrame\UI-StatusBar]]) end return true -- 1.7.9.5