From 994ac59fac14870614180e1cc1f8a8c03e44b53a Mon Sep 17 00:00:00 2001 From: p3lim Date: Wed, 13 Oct 2010 03:32:57 +0200 Subject: [PATCH] Add some basic tags --- oUF_Reputation.lua | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/oUF_Reputation.lua b/oUF_Reputation.lua index e55e7c8..2ce5d58 100644 --- a/oUF_Reputation.lua +++ b/oUF_Reputation.lua @@ -2,6 +2,26 @@ local _, ns = ... local oUF = ns.oUF or oUF assert(oUF, 'oUF Reputation was unable to locate oUF install') +local tagStrings = { + ['currep'] = function(unit) + local _, _, _, _, value = GetWatchedFactionInfo() + return value + end, + ['maxrep'] = function(unit) + local _, _, _, max = GetWatchedFactionInfo() + return max + end, + ['perrep'] = function(unit) + local _, _, _, max, value = GetWatchedFactionInfo() + return math.floor(value / max * 100 + 0.5) + end, + ['standing'] = function(unit) + local _, standing = GetWatchedFactionInfo() + return standing + end, + ['reputation'] = GetWatchedFactionInfo +} + local function Update(self, event, unit) local reputation = self.Reputation @@ -36,6 +56,11 @@ local function Enable(self, unit) self:RegisterEvent('UPDATE_FACTION', Path) + for tag, func in pairs(tagStrings) do + oUF.Tags[tag] = func + oUF.TagEvents[tag] = 'UPDATE_FACTION' + end + if(not reputation:GetStatusBarTexture()) then reputation:SetStatusBarTexture([=[Interface\TargetingFrame\UI-StatusBar]=]) end -- 1.7.9.5