Quantcast

Adding all of the files

Cynyr [09-06-09 - 15:07]
Adding all of the files
Filename
UI_screenshot.png
media/minimalist.tga
oUF_Cynyr.lua
oUF_Cynyr.toc
oUF_Cynyr.wuuver
oUF_Cynyr.xml
tags.lua
diff --git a/UI_screenshot.png b/UI_screenshot.png
new file mode 100644
index 0000000..5b1d05b
Binary files /dev/null and b/UI_screenshot.png differ
diff --git a/media/minimalist.tga b/media/minimalist.tga
new file mode 100644
index 0000000..030bc83
Binary files /dev/null and b/media/minimalist.tga differ
diff --git a/oUF_Cynyr.lua b/oUF_Cynyr.lua
new file mode 100644
index 0000000..8f44f08
--- /dev/null
+++ b/oUF_Cynyr.lua
@@ -0,0 +1,420 @@
+--[[
+
+  Adrian L Lange grants anyone the right to use this work for any purpose,
+  without any conditions, unless such conditions are required by law.
+
+--]]
+
+--settings have been omved to here, for easier changing
+local minalpha = 0
+local maxalpha = 1
+local castbaroffset = 140
+local castbarheight = 16
+local castbarbuttonsize = 21
+local playertargetheight = 27
+local playertargetwidth = 180
+local petheight = 27
+local petwidth = 130
+local focustargettargetheight = 20
+local focustargettargetwidth = playertargetwidth * .80
+
+
+
+local max = math.max
+local floor = math.floor
+
+local minimalist = [=[Interface\AddOns\oUF_Cynyr\media\minimalist]=]
+local backdrop = {
+	bgFile = [=[Interface\ChatFrame\ChatFrameBackground]=],
+	insets = {top = -1, bottom = -1, left = -1, right = -1}
+}
+
+local colors = setmetatable({
+	power = setmetatable({
+		MANA = {0, 144/255, 1}
+	}, {__index = oUF.colors.power}),
+	reaction = setmetatable({
+		[2] = {1, 0, 0},
+		[4] = {1, 1, 0},
+		[5] = {0, 1, 0}
+	}, {__index = oUF.colors.reaction}),
+	runes = setmetatable({
+		[1] = {0.8, 0, 0},
+		[3] = {0, 0.4, 0.7},
+		[4] = {0.8, 0.8, 0.8}
+	}, {__index = oUF.colors.runes})
+}, {__index = oUF.colors})
+
+local buffFilter = {
+	[GetSpellInfo(62600)] = true,
+	[GetSpellInfo(61336)] = true,
+	[GetSpellInfo(52610)] = true,
+	[GetSpellInfo(22842)] = true,
+	[GetSpellInfo(22812)] = true,
+	[GetSpellInfo(16870)] = true
+}
+
+local function menu(self)
+	local drop = _G[string.gsub(self.unit, '(.)', string.upper, 1) .. 'FrameDropDown']
+	if(drop) then
+		ToggleDropDownMenu(1, nil, drop, 'cursor')
+	end
+end
+
+local function updateCombo(self, event, unit)
+	if(unit == PlayerFrame.unit and unit ~= self.CPoints.unit) then
+		self.CPoints.unit = unit
+	end
+end
+
+local function updatePower(self, event, unit, bar, minVal, maxVal)
+	if(unit ~= 'target') then return end
+
+	if(maxVal ~= 0) then
+		self.Health:SetHeight(22)
+		bar:Show()
+	else
+		self.Health:SetHeight(27)
+		bar:Hide()
+	end
+end
+
+local function castIcon(self, event, unit)
+	local castbar = self.Castbar
+	if(castbar.interrupt) then
+		castbar.Button:SetBackdropColor(0, 0.9, 1)
+	else
+		castbar.Button:SetBackdropColor(0, 0, 0)
+	end
+end
+
+local function castTime(self, duration)
+	if(self.channeling) then
+		self.Time:SetFormattedText('%.1f ', duration)
+	elseif(self.casting) then
+		self.Time:SetFormattedText('%.1f ', self.max - duration)
+	end
+end
+
+local function updateTime(self, elapsed)
+	self.remaining = max(self.remaining - elapsed, 0)
+	self.time:SetText(self.remaining < 90 and floor(self.remaining) or '')
+end
+
+local function updateBuff(self, icons, unit, icon, index)
+	local _, _, _, _, _, duration, expiration = UnitAura(unit, index, icon.filter)
+
+	if(duration > 0 and expiration) then
+		icon.remaining = expiration - GetTime()
+		icon:SetScript('OnUpdate', updateTime)
+	else
+		icon:SetScript('OnUpdate', nil)
+		icon.time:SetText()
+	end
+end
+
+local function updateDebuff(self, icons, unit, icon, index)
+	local _, _, _, _, dtype = UnitAura(unit, index, icon.filter)
+
+	if(icon.debuff) then
+		if(not UnitIsFriend('player', unit) and icon.owner ~= 'player' and icon.owner ~= 'vehicle') then
+			icon:SetBackdropColor(0, 0, 0)
+			icon.icon:SetDesaturated(true)
+		else
+			local color = DebuffTypeColor[dtype] or DebuffTypeColor.none
+			icon:SetBackdropColor(color.r * 0.6, color.g * 0.6, color.b * 0.6)
+			icon.icon:SetDesaturated(false)
+		end
+	end
+end
+
+local function createAura(self, button, icons)
+	icons.showDebuffType = true
+
+	button.cd:SetReverse()
+	button:SetBackdrop(backdrop)
+	button:SetBackdropColor(0, 0, 0)
+	button.icon:SetTexCoord(0.06, 0.94, 0.06, 0.94)
+	button.icon:SetDrawLayer('ARTWORK')
+	button.overlay:SetTexture()
+
+	if(self.unit == 'player') then
+		icons.disableCooldown = true
+
+		button.time = button:CreateFontString(nil, 'OVERLAY', 'NumberFontNormal')
+		button.time:SetPoint('TOPLEFT', button)
+	end
+end
+
+local function customFilter(icons, unit, icon, name, rank, texture, count, dtype, duration, expiration, caster)
+	if(buffFilter[name] and caster == 'player') then
+		return true
+	end
+end
+
+local function style(self, unit)
+	self.colors = colors
+	self.menu = menu
+
+	self:RegisterForClicks('AnyUp')
+	self:SetAttribute('type2', 'menu')
+
+	self:SetScript('OnEnter', UnitFrame_OnEnter)
+	self:SetScript('OnLeave', UnitFrame_OnLeave)
+
+	self:SetBackdrop(backdrop)
+	self:SetBackdropColor(0, 0, 0)
+
+	self.Health = CreateFrame('StatusBar', nil, self)
+	self.Health:SetPoint('TOPRIGHT')
+	self.Health:SetPoint('TOPLEFT')
+	self.Health:SetStatusBarTexture(minimalist)
+	self.Health:SetStatusBarColor(0.25, 0.25, 0.35)
+	self.Health:SetHeight((unit == 'focus' or unit == 'targettarget') and 20 or 22)
+	self.Health.frequentUpdates = true
+
+	self.Health.bg = self.Health:CreateTexture(nil, 'BORDER')
+	self.Health.bg:SetAllPoints(self.Health)
+	self.Health.bg:SetTexture(0.3, 0.3, 0.3)
+
+	local health = self.Health:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmallRight')
+	health:SetPoint('RIGHT', self.Health, -2, -1)
+	health.frequentUpdates = 0.25
+	self:Tag(health, '[phealth]')
+
+	self.RaidIcon = self.Health:CreateTexture(nil, 'OVERLAY')
+	self.RaidIcon:SetPoint('TOP', self, 0, 8)
+	self.RaidIcon:SetHeight(16)
+	self.RaidIcon:SetWidth(16)
+
+	if(unit == 'focus' or unit == 'targettarget') then
+		self:SetAttribute('initial-height', focustargettargetheight)
+		self:SetAttribute('initial-width', focustargettargetwidth)
+
+		self.Debuffs = CreateFrame('Frame', nil, self)
+		self.Debuffs:SetHeight(20)
+		self.Debuffs:SetWidth(44)
+		self.Debuffs.num = 2
+		self.Debuffs.size = 20
+		self.Debuffs.spacing = 4
+		self.PostCreateAuraIcon = createAura
+
+		if(unit == 'focus') then
+			self.Debuffs:SetPoint('TOPLEFT', self, 'TOPRIGHT', 4, 0)
+			self.Debuffs.onlyShowPlayer = true
+			self.Debuffs.initialAnchor = 'TOPLEFT'
+		else
+			self.Debuffs:SetPoint('TOPRIGHT', self, 'TOPLEFT', -4, 0)
+			self.Debuffs.initialAnchor = 'TOPRIGHT'
+			self.Debuffs['growth-x'] = 'LEFT'
+		end
+	else
+		self.Power = CreateFrame('StatusBar', nil, self)
+		self.Power:SetPoint('BOTTOMRIGHT')
+		self.Power:SetPoint('BOTTOMLEFT')
+		self.Power:SetPoint('TOP', self.Health, 'BOTTOM', 0, -1)
+		self.Power:SetStatusBarTexture(minimalist)
+		self.Power.frequentUpdates = true
+
+		self.Power.colorClass = true
+		self.Power.colorTapping = true
+		self.Power.colorDisconnected = true
+		self.Power.colorReaction = unit ~= 'pet'
+		self.Power.colorHappiness = unit == 'pet'
+		self.Power.colorPower = unit == 'pet'
+
+		self.Power.bg = self.Power:CreateTexture(nil, 'BORDER')
+		self.Power.bg:SetAllPoints(self.Power)
+		self.Power.bg:SetTexture([=[Interface\ChatFrame\ChatFrameBackground]=])
+		self.Power.bg.multiplier = 0.3
+	end
+
+	if(unit == 'player' or unit == 'pet') then
+		if(IsAddOnLoaded('oUF_Experience')) then
+			self.Experience = CreateFrame('StatusBar', nil, self)
+			self.Experience:SetPoint('TOPLEFT', self, 'BOTTOMLEFT', 0, -10)
+			self.Experience:SetPoint('TOPRIGHT', self, 'BOTTOMRIGHT', 0, -10)
+			self.Experience:SetHeight(11)
+			self.Experience:SetStatusBarTexture(minimalist)
+			self.Experience:SetStatusBarColor(0.15, 0.7, 0.1)
+			self.Experience.Tooltip = true
+
+			self.Experience.Rested = CreateFrame('StatusBar', nil, self)
+			self.Experience.Rested:SetAllPoints(self.Experience)
+			self.Experience.Rested:SetStatusBarTexture(minimalist)
+			self.Experience.Rested:SetStatusBarColor(0, 0.4, 1, 0.6)
+			self.Experience.Rested:SetBackdrop(backdrop)
+			self.Experience.Rested:SetBackdropColor(0, 0, 0)
+
+			self.Experience.Text = self.Experience:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmall')
+			self.Experience.Text:SetPoint('CENTER', self.Experience)
+
+			self.Experience.bg = self.Experience.Rested:CreateTexture(nil, 'BORDER')
+			self.Experience.bg:SetAllPoints(self.Experience)
+			self.Experience.bg:SetTexture(0.3, 0.3, 0.3)
+		end
+
+		local power = self.Health:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmallLeft')
+		power:SetPoint('LEFT', self.Health, 2, -1)
+		power.frequentUpdates = 0.1
+		self:Tag(power, '[ppower][( )druidpower]')
+	else
+		local info = self.Health:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmallLeft')
+		info:SetPoint('LEFT', self.Health, 2, -1)
+		info:SetPoint('RIGHT', health, 'LEFT')
+		self:Tag(info, '[pname]|cff0090ff[( )rare]|r')
+	end
+
+	if(unit == 'pet') then
+		self:SetAttribute('initial-height', petheight)
+		self:SetAttribute('initial-width', petwidth)
+
+		self.Auras = CreateFrame('Frame', nil, self)
+		self.Auras:SetPoint('TOPRIGHT', self, 'TOPLEFT', -4, 0)
+		self.Auras:SetHeight(4)
+		self.Auras:SetWidth(256)
+		self.Auras.size = 22
+		self.Auras.spacing = 4
+		self.Auras.initialAnchor = 'TOPRIGHT'
+		self.Auras['growth-x'] = 'LEFT'
+		self.PostCreateAuraIcon = createAura
+	end
+
+	if(unit == 'player' or unit == 'target') then
+		self:SetAttribute('initial-height', playertargetheight)
+		self:SetAttribute('initial-width', playertargetwidth)
+
+		self.Buffs = CreateFrame('Frame', nil, self)
+		self.Buffs:SetPoint('TOPLEFT', self, 'TOPRIGHT', 4, 0)
+		self.Buffs:SetHeight(44)
+		self.Buffs:SetWidth(236)
+		self.Buffs.num = 20
+		self.Buffs.size = 20
+		self.Buffs.spacing = 4
+		self.Buffs.initialAnchor = 'TOPLEFT'
+		self.Buffs['growth-y'] = 'DOWN'
+		self.PostCreateAuraIcon = createAura
+
+		self.Castbar = CreateFrame('StatusBar', nil, self)
+		self.Castbar:SetWidth(playertargetwidth - 25)
+		self.Castbar:SetHeight(castbarheight)
+		self.Castbar:SetStatusBarTexture(minimalist)
+		self.Castbar:SetStatusBarColor(0.25, 0.25, 0.35)
+		self.Castbar:SetBackdrop(backdrop)
+		self.Castbar:SetBackdropColor(0, 0, 0)
+
+		self.Castbar.bg = self.Castbar:CreateTexture(nil, 'BORDER')
+		self.Castbar.bg:SetAllPoints(self.Castbar)
+		self.Castbar.bg:SetTexture(0.3, 0.3, 0.3)
+
+		self.Castbar.Text = self.Castbar:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmallLeft')
+		self.Castbar.Text:SetPoint('LEFT', 2, 1)
+
+		self.Castbar.Time = self.Castbar:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmallRight')
+		self.Castbar.Time:SetPoint('RIGHT', -2, 1)
+		self.Castbar.CustomTimeText = castTime
+
+		self.Castbar.Button = CreateFrame('Frame', nil, self.Castbar)
+		self.Castbar.Button:SetHeight(castbarbuttonsize)
+		self.Castbar.Button:SetWidth(castbarbuttonsize)
+		self.Castbar.Button:SetBackdrop(backdrop)
+		self.Castbar.Button:SetBackdropColor(0, 0, 0)
+
+		self.Castbar.Icon = self.Castbar.Button:CreateTexture(nil, 'ARTWORK')
+		self.Castbar.Icon:SetAllPoints(self.Castbar.Button)
+		self.Castbar.Icon:SetTexCoord(0.08, 0.92, 0.08, 0.92)
+
+		if(unit == 'target') then
+			self.PostCastStart = castIcon
+			self.PostChannelStart = castIcon
+			self.Castbar:SetPoint('TOPLEFT', self, 'BOTTOMLEFT', 0, castbaroffset)
+			self.Castbar.Button:SetPoint('BOTTOMLEFT', self.Castbar, 'BOTTOMRIGHT', 4, 0)
+		else
+			self.Castbar:SetPoint('TOPRIGHT', self, 'BOTTOMRIGHT', 0, castbaroffset)
+			self.Castbar.Button:SetPoint('BOTTOMRIGHT', self.Castbar, 'BOTTOMLEFT', -4, 0)
+		end
+
+		self.PostUpdatePower = updatePower
+	end
+
+	if(unit == 'target') then
+		self.Debuffs = CreateFrame('Frame', nil, self)
+		self.Debuffs:SetPoint('TOPLEFT', self, 'BOTTOMLEFT', 0, -4)
+		self.Debuffs:SetHeight(20 * 0.97)
+		self.Debuffs:SetWidth(playertargetwidth)
+		self.Debuffs.num = 20
+		self.Debuffs.size = 20 * 0.97
+		self.Debuffs.spacing = 4
+		self.Debuffs.initialAnchor = 'TOPLEFT'
+		self.Debuffs['growth-y'] = 'DOWN'
+		self.PostCreateAuraIcon = createAura
+		self.PostUpdateAuraIcon = updateDebuff
+
+		self.CPoints = self:CreateFontString(nil, 'OVERLAY', 'SubZoneTextFont')
+		self.CPoints:SetPoint('RIGHT', self, 'LEFT', -9, 0)
+		self.CPoints:SetTextColor(1, 1, 1)
+		self.CPoints:SetJustifyH('RIGHT')
+		self.CPoints.unit = PlayerFrame.unit
+		self:RegisterEvent('UNIT_COMBO_POINTS', updateCombo)
+	end
+
+	if(unit == 'player') then
+		if(select(2, UnitClass('player')) == 'DEATHKNIGHT') then
+			self.Runes = CreateFrame('Frame', nil, self)
+			self.Runes:SetPoint('TOPLEFT', self, 'BOTTOMLEFT', 0, -1)
+			self.Runes:SetHeight(4)
+			self.Runes:SetWidth(playertargetwidth)
+			self.Runes:SetBackdrop(backdrop)
+			self.Runes:SetBackdropColor(0, 0, 0)
+			self.Runes.anchor = 'TOPLEFT'
+			self.Runes.growth = 'RIGHT'
+			self.Runes.height = 4
+			self.Runes.width = playertargetwidth / 6 - 0.85
+
+			for index = 1, 6 do
+				self.Runes[index] = CreateFrame('StatusBar', nil, self.Runes)
+				self.Runes[index]:SetStatusBarTexture(minimalist)
+
+				self.Runes[index].bg = self.Runes[index]:CreateTexture(nil, 'BACKGROUND')
+				self.Runes[index].bg:SetAllPoints(self.Runes[index])
+				self.Runes[index].bg:SetTexture(0.3, 0.3, 0.3)
+			end
+		end
+        if(unit=="player" and IsAddOnLoaded("oUF_BarFader")) then
+            self.BarFade = true
+            self.BarFaderMinAlpha = minalpha
+            self.BarFaderMaxAlpha = maxalpha
+        end
+
+		self.Leader = self.Health:CreateTexture(nil, 'OVERLAY')
+		self.Leader:SetPoint('TOPLEFT', self, 0, 8)
+		self.Leader:SetHeight(16)
+		self.Leader:SetWidth(16)
+
+		self.Assistant = self.Health:CreateTexture(nil, 'OVERLAY')
+		self.Assistant:SetPoint('TOPLEFT', self, 0, 8)
+		self.Assistant:SetHeight(16)
+		self.Assistant:SetWidth(16)
+
+		local info = self.Health:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmall')
+		info:SetPoint('CENTER', 0, -1)
+		info.frequentUpdates = 0.25
+		self:Tag(info, '[pthreat]|cffff0000[pvptime]|r')
+
+		self.PostUpdateAuraIcon = updateBuff
+		self.CustomAuraFilter = customFilter
+	end
+
+	self.DebuffHighlightBackdrop = true
+	self.DebuffHighlightFilter = true
+    self.MoveableFrames = true
+end
+
+oUF:RegisterStyle('Cynyr', style)
+oUF:SetActiveStyle('Cynyr')
+
+oUF:Spawn('player', "oUF_Cynyr_player"):SetPoint('CENTER', UIParent, -220, -250)
+oUF:Spawn('target', "oUF_Cynyr_target"):SetPoint('CENTER', UIParent, 220, -250)
+oUF:Spawn('targettarget', "oUF_Cynyr_targettarget"):SetPoint('BOTTOMRIGHT', oUF.units.target, 'TOPRIGHT', 0, 5)
+oUF:Spawn('focus', "oUF_Cynyr_focus"):SetPoint('BOTTOMLEFT', oUF.units.player, 'TOPLEFT', 0, 5)
+oUF:Spawn('pet', "oUF_Cynyr_pet"):SetPoint('RIGHT', oUF.units.player, 'LEFT', -25, 0)
diff --git a/oUF_Cynyr.toc b/oUF_Cynyr.toc
new file mode 100644
index 0000000..b6b32cd
--- /dev/null
+++ b/oUF_Cynyr.toc
@@ -0,0 +1,9 @@
+## Interface: 30200
+## Author: Cynyr
+## Version: 0.1
+## Title: oUF Cynyr
+## Notes: Just another oUF layout
+## RequiredDeps: oUF
+## OptionalDeps: oUF_DebuffHighlight, oUF_Experience, oUF_MovableFrames, oUF_BarFader
+
+oUF_Cynyr.xml
diff --git a/oUF_Cynyr.wuuver b/oUF_Cynyr.wuuver
new file mode 100644
index 0000000..98ee6ea
--- /dev/null
+++ b/oUF_Cynyr.wuuver
@@ -0,0 +1 @@
+20090824
\ No newline at end of file
diff --git a/oUF_Cynyr.xml b/oUF_Cynyr.xml
new file mode 100644
index 0000000..6ef3410
--- /dev/null
+++ b/oUF_Cynyr.xml
@@ -0,0 +1,4 @@
+<Ui xmlns='http://www.blizzard.com/wow/ui/'>
+	<Script file='tags.lua'/>
+	<Script file='oUF_Cynyr.lua'/>
+</Ui>
diff --git a/tags.lua b/tags.lua
new file mode 100644
index 0000000..91321fd
--- /dev/null
+++ b/tags.lua
@@ -0,0 +1,71 @@
+local format = string.format
+local gsub = string.gsub
+
+local colors = setmetatable({
+	power = setmetatable({
+		['MANA'] = {0, 144/255, 1}
+	}, {__index = oUF.colors.power}),
+	reaction = setmetatable({
+		[2] = {1, 0, 0},
+		[4] = {1, 1, 0},
+		[5] = {0, 1, 0}
+	}, {__index = oUF.colors.reaction}),
+}, {__index = oUF.colors})
+
+local function shortVal(value)
+	if(value >= 1e6) then
+		return ('%.2fm'):format(value / 1e6):gsub('%.?0+([km])$', '%1')
+	elseif(value >= 1e4) then
+		return ('%.1fk'):format(value / 1e3):gsub('%.?0+([km])$', '%1')
+	else
+		return value
+	end
+end
+
+local function hex(r, g, b)
+	if(type(r) == 'table') then
+		if(r.r) then r, g, b = r.r, r.g, r.b else r, g, b = unpack(r) end
+	end
+	return ('|cff%02x%02x%02x'):format(r * 255, g * 255, b * 255)
+end
+
+oUF.Tags['[pvptime]'] = function(unit)
+	return UnitIsPVP(unit) and not IsPVPTimerRunning() and '*' or IsPVPTimerRunning() and ('%d:%02d'):format((GetPVPTimer() / 1000) / 60, (GetPVPTimer() / 1000) % 60)
+end
+
+oUF.TagEvents['[pthreat]'] = 'UNIT_THREAT_LIST_UPDATE'
+oUF.Tags['[pthreat]'] = function()
+	local _, _, perc = UnitDetailedThreatSituation('player', 'target')
+	return perc and ('%s%d%%|r'):format(hex(GetThreatStatusColor(UnitThreatSituation('player', 'target'))), perc)
+end
+
+oUF.Tags['[phealth]'] = function(unit)
+	local min, max = UnitHealth(unit), UnitHealthMax(unit)
+
+	local status = not UnitIsConnected(unit) and 'Offline' or UnitIsGhost(unit) and 'Ghost' or UnitIsDead(unit) and 'Dead'
+	local target = unit == 'target' and UnitCanAttack('player', unit) and ('%s (%d|cff0090ff%%|r)'):format(shortVal(min), min / max * 100)
+	local player = unit == 'player' and min ~= max and ('|cffff8080%d|r %d|cff0090ff%%|r'):format(min - max, min / max * 100)
+
+	return status and status or target and target or player and player or min ~= max and ('%s |cff0090ff/|r %s'):format(shortVal(min), shortVal(max)) or max
+end
+
+oUF.Tags['[ppower]'] = function(unit)
+	local _, str = UnitPowerType(unit)
+	return ('%s%d|r'):format(hex(colors.power[str] or {1, 1, 1}), oUF.Tags['[curpp]'](unit) or '')
+end
+
+oUF.TagEvents['[pname]'] = 'UNIT_NAME_UPDATE UNIT_REACTION UNIT_FACTION'
+oUF.Tags['[pname]'] = function(unit)
+	local colorString = hex((UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit)) and colors.tapped or
+		(not UnitIsConnected(unit)) and colors.disconnected or
+		(not UnitIsPlayer(unit)) and colors.reaction[UnitReaction(unit, 'player')] or
+		(UnitFactionGroup(unit) and UnitIsEnemy(unit, 'player') and UnitIsPVP(unit)) and {1, 0, 0} or {1, 1, 1})
+
+	return ('%s%s|r'):format(colorString, UnitName(unit))
+end
+
+oUF.TagEvents['[druidpower]'] = 'UNIT_MANA UPDATE_SHAPESHIFT_FORM'
+oUF.Tags['[druidpower]'] = function(unit)
+	local min, max = UnitPower(unit, 0), UnitPowerMax(unit, 0)
+	return unit == 'player' and UnitPowerType(unit) ~= 0 and min ~= max and ('|cff0090ff%d%%|r'):format(min / max * 100)
+end