From 28087d5a3d1eb76919d037a2f6f770a49f7b7098 Mon Sep 17 00:00:00 2001 From: p3lim-52096 Date: Sat, 31 Jan 2009 21:02:17 +0000 Subject: [PATCH] Added filter to duration on auras Added dynamic positioning to MasterLooter Fixed name tag text color git-svn-id: svn://svn.wowinterface.com/oUF_P3lim-52/trunk@55 8c7459ed-49dc-4bc8-85d7-b6381a8f5413 --- oUF_P3lim/oUF_P3lim.lua | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/oUF_P3lim/oUF_P3lim.lua b/oUF_P3lim/oUF_P3lim.lua index d2478ca..48cd95c 100644 --- a/oUF_P3lim/oUF_P3lim.lua +++ b/oUF_P3lim/oUF_P3lim.lua @@ -46,7 +46,7 @@ end local function UpdateInfoColor(self, unit) if(UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit)) then self:SetTextColor(unpack(colors.tapped)) - elseif(UnitIsDead(unit) or UnitIsGhost(unit) or not UnitIsConnected(unit)) then + elseif(not UnitIsConnected(unit)) then self:SetTextColor(unpack(colors.disconnected)) elseif(not UnitIsPlayer(unit)) then self:SetTextColor(unpack({UnitSelectionColor(unit)} or colors.health)) @@ -55,6 +55,15 @@ local function UpdateInfoColor(self, unit) end end +local function UpdateMasterLooter(self) + self.MasterLooter:ClearAllPoints() + if((UnitInParty(self.unit) or UnitInRaid(self.unit)) and UnitIsPartyLeader(self.unit)) then + self.MasterLooter:SetPoint('LEFT', self.Leader, 'RIGHT') + else + self.MasterLooter:SetPoint('TOPLEFT', self, 0, 8) + end +end + local function UpdateRuneBar(self, elapsed) local start, duration, ready = GetRuneCooldown(self:GetID()) @@ -183,6 +192,15 @@ local function PostCreateAuraIcon(self, button, icons) button.overlay.Hide = function(self) self:SetVertexColor(0.25, 0.25, 0.25) end end +local function PostUpdateAuraIcon(self, icons, unit, icon, index, offset, filter, debuff) + if(debuff and UnitIsEnemy('player', unit)) then + local _, _, _, _, _, duration, _, isPlayer = UnitAura(unit, index, filter) + if(duration and duration > 0 and not isPlayer) then + icon.cd:Hide() + end + end +end + local function CreateStyle(self, unit) self.colors = colors self.menu = menu @@ -240,6 +258,11 @@ local function CreateStyle(self, unit) self.MasterLooter:SetHeight(16) self.MasterLooter:SetWidth(16) + table.insert(self.__elements, UpdateMasterLooter) + self:RegisterEvent('PARTY_LOOT_METHOD_CHANGED', UpdateMasterLooter) + self:RegisterEvent('PARTY_MEMBERS_CHANGED', UpdateMasterLooter) + self:RegisterEvent('PARTY_LEADER_CHANGED', UpdateMasterLooter) + if(unit == 'player' or unit == 'pet') then self.Power.Text = self.Power:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmall') self.Power.Text:SetPoint('LEFT', self.Health, 2, -1) @@ -468,6 +491,7 @@ local function CreateStyle(self, unit) self.DebuffHighlightBackdrop = true self.DebuffHighlightFilter = true + self.PostUpdateAuraIcon = PostUpdateAuraIcon self.PostCreateAuraIcon = PostCreateAuraIcon self.PostUpdateHealth = PostUpdateHealth self.PostUpdatePower = PostUpdatePower -- 1.7.9.5