From 36e5a66c4a226ffead82b33fb8d7acd241c70350 Mon Sep 17 00:00:00 2001 From: p3lim Date: Wed, 5 Jan 2011 13:30:11 +0100 Subject: [PATCH] Add player/pet "castbar" --- oUF_P3lim.lua | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/oUF_P3lim.lua b/oUF_P3lim.lua index eaf04dd..f9a188e 100644 --- a/oUF_P3lim.lua +++ b/oUF_P3lim.lua @@ -70,6 +70,10 @@ oUF.Tags['p3lim:name'] = function(unit) return ('%s%s|r'):format(Hex(r, g, b), UnitName(unit)) end +oUF.Tags['p3lim:spell'] = function(unit) + return UnitCastingInfo(unit) or UnitChannelInfo(unit) +end + local function SpawnMenu(self) ToggleDropDownMenu(1, nil, _G[string.gsub(self.unit, '^.', string.upper)..'FrameDropDown'], 'cursor') end @@ -198,12 +202,25 @@ local function Shared(self, unit) power.bg = powerBG if(unit ~= 'target') then + local castbar = CreateFrame('StatusBar', nil, self) + castbar:SetAllPoints(health) + castbar:SetStatusBarTexture(TEXTURE) + castbar:SetStatusBarColor(0, 0, 0, 0) + castbar:SetToplevel(true) + self.Castbar = castbar + + local spark = castbar:CreateTexture(nil, 'OVERLAY') + spark:SetSize(2, 20) + spark:SetTexture(1, 1, 1) + castbar.Spark = spark + local powerValue = health:CreateFontString(nil, 'OVERLAY') powerValue:SetPoint('LEFT', health, 2, 0) + powerValue:SetPoint('RIGHT', healthValue, 'LEFT', -3) powerValue:SetFont(FONT, 8, 'OUTLINEMONOCHROME') powerValue:SetJustifyH('LEFT') powerValue.frequentUpdates = 0.1 - self:Tag(powerValue, '[p3lim:power][ >p3lim:druid]') + self:Tag(powerValue, '[p3lim:power][ >p3lim:druid][ | >p3lim:spell]') end local raidicon = health:CreateTexture(nil, 'OVERLAY') -- 1.7.9.5