From 99cf464aa2207c9f4b8368bbe6d6b00396b2be0c Mon Sep 17 00:00:00 2001 From: p3lim Date: Wed, 5 Jan 2011 16:24:35 +0100 Subject: [PATCH] Add partyframes! --- oUF_P3lim.lua | 32 ++++++++++++++++++++++++++++++++ tags.lua | 21 +++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/oUF_P3lim.lua b/oUF_P3lim.lua index 9cddbdf..b9c3151 100644 --- a/oUF_P3lim.lua +++ b/oUF_P3lim.lua @@ -90,6 +90,30 @@ local UnitSpecific = { self:Tag(self.HealthValue, '[p3lim:status][p3lim:friendly]') self:SetWidth(130) end, + party = function(self) + local name = self.Health:CreateFontString(nil, 'OVERLAY') + name:SetPoint('LEFT', 3, 0) + name:SetFont(FONT, 8, 'OUTLINEMONOCHROME') + name:SetJustifyH('LEFT') + self:Tag(name, '[p3lim:unbuffed< ][p3lim:leader][raidcolor][name]') + + local phase = self.Health:CreateFontString(nil, 'OVERLAY') + phase:SetPoint('CENTER') + phase:SetFont([=[Fonts\ARIALN.TTF]=], 12, 'OUTLINEMONOCHROME') + self:Tag(phase, '|cff6000ff[p3lim:phase]|r') + + local roleicon = self:CreateTexture(nil, 'ARTWORK') + roleicon:SetPoint('LEFT', self, 'RIGHT', 3, 0) + roleicon:SetSize(14, 14) + roleicon:SetAlpha(0) + self.LFDRole = roleicon + + self:HookScript('OnEnter', function() groupicon:SetAlpha(1) end) + self:HookScript('OnLeave', function() groupicon:SetAlpha(0) end) + + self.Health:SetAllPoints() + self:Tag(self.HealthValue, '[p3lim:status][p3lim:percent]') + end } local function Shared(self, unit) @@ -230,4 +254,12 @@ oUF:Factory(function(self) self:Spawn('focus'):SetPoint('CENTER', -335, -225) self:Spawn('target'):SetPoint('CENTER', 300, -250) self:Spawn('targettarget'):SetPoint('CENTER', 334, -225) + + self:SpawnHeader(nil, nil, 'party', + 'showParty', true, 'showPlayer', true, 'yOffset', -6, + 'oUF-initialConfigFunction', [[ + self:SetHeight(16) + self:SetWidth(126) + ]] + ):SetPoint('TOP', Minimap, 'BOTTOM', 0, -10) end) diff --git a/tags.lua b/tags.lua index f2d360b..818062e 100644 --- a/tags.lua +++ b/tags.lua @@ -102,6 +102,27 @@ oUF.Tags['p3lim:color'] = function(unit) end end +oUF.TagEvents['p3lim:leader'] = 'PARTY_LEADER_CHANGED' +oUF.Tags['p3lim:leader'] = function(unit) + if(UnitIsPartyLeader(unit)) then + return '|cffffff00!|r' + end +end + +oUF.TagEvents['p3lim:phase'] = 'UNIT_PHASE' +oUF.Tags['p3lim:phase'] = function(unit) + if(not UnitInPhase(unit)) then + return RANGE_INDICATOR + end +end + +oUF.TagEvents['p3lim:unbuffed'] = 'UNIT_AURA' +oUF.Tags['p3lim:unbuffed'] = function(unit) + if(not UnitAura(unit, 'Mark of the Wild') and not UnitAura(unit, 'Blessing of Kings')) then + return '|cffff00ff!|r' + end +end + oUF.Tags['p3lim:spell'] = function(unit) return UnitCastingInfo(unit) or UnitChannelInfo(unit) end -- 1.7.9.5