Thread Tools Display Modes
05-10-10, 04:44 PM   #1
azsh
A Fallenroot Satyr
Join Date: May 2010
Posts: 21
Aura bars - how to change color

HI i use oUF with Aura bars and I don't no how to change color's on bars, i wish to have violet on skill faerie fire and green on insect swarm.



my code from aura bars:

Code:
local AuraBarFilter
do
	local whitelist = {}
	for k, v in pairs({
		48463,	--Moonfire
		48468,	--IS
		48518,  --eclipse
		48517,	--eclipse2
		770,
		46916,
	}) do
		whitelist[GetSpellInfo(v)] = true
	end

	local myunits = {
		player = true,
		target = true
	}
	
	function AuraBarFilter(name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable)
		if not myunits[unitCaster] then return end
		if whitelist[name]
			or not (duration == 0 and expirationTime == 0) 
			and duration <= 3 then
			return true
		end
	end
end


	if unit=='player' or unit=='target' then
		local abars = CreateFrame("Frame", nil, self)
		abars:SetHeight(1)
		abars.auraBarHeight = 10
		abars.auraBarWidth = 225
		abars.auraBarTexture = HPtex
		abars.bgalpha = 1
		abars.spacing = 3
		abars.gap = 3
		abars.spellNameFont = NumbFont
		abars.spellTimeFont = NumbFont
		abars.filter = AuraBarFilter
		abars.sort = true
		abars.scaleTime = 12
		abars.PostCreateBar = PostCreateAuraBar
		if unit=='player' then
		abars:SetPoint('BOTTOMLEFT', self, 'TOPLEFT', -0, 55)
		abars:SetPoint('BOTTOMLEFT', self.Power, 'TOPLEFT', 433, 160)
		abars:SetPoint('BOTTOMRIGHT', self.Power, 'TOPRIGHT', 5000, 5000)
		end
		if unit=='target' then
		abars:SetPoint('BOTTOMLEFT', self.Power, 'TOPLEFT', 0, 160)
		abars:SetPoint('BOTTOMLEFT', self.Power, 'TOPLEFT', 0, 190)
		abars:SetPoint('BOTTOMRIGHT', self.Power, 'TOPRIGHT', 5000, 5000)
                end
		self.AuraBars = abars
	end
Please help me if anybody can.
  Reply With Quote
05-11-10, 01:47 AM   #2
Rostok
A Flamescale Wyrmkin
Join Date: Jul 2008
Posts: 127
it seems you have a PostCreateAuraBar function in your layout, use it to do a SetStatusBarColor in it with your whitelist of spells.
  Reply With Quote
05-11-10, 09:39 AM   #3
azsh
A Fallenroot Satyr
Join Date: May 2010
Posts: 21
i have another solution:

Code:
		-- Colour bars
		local r, g, b = .2, .6, 1 -- Colour for buffs (This is Magic Blue)
		local bgMod = 0.5
		if helpOrHarm == 'HARMFUL' then
			local debuffType = bar.aura.debuffType and bar.aura.debuffType or 'none'
			r, g, b = DebuffTypeColor[debuffType].r, DebuffTypeColor[debuffType].g, DebuffTypeColor[debuffType].b
			local name = bar.aura.name
			if name == "Insect Swarm" then
			r, g, b = 186/255,0/255,211/255
			end
		end
		bar:SetStatusBarColor(r, g, b)
		bar.bg:SetVertexColor(r * bgMod, g * bgMod, b * bgMod)
		bar:Show()
in oUF_aurabars i write

Code:
			local name = bar.aura.name
			if name == "Insect Swarm" then
			r, g, b = 186/255,0/255,211/255
			end
I'm wondering why this 2 lines doesn't work ;/
Code:
			local debuffType = bar.aura.debuffType and bar.aura.debuffType or 'none'
			r, g, b = DebuffTypeColor[debuffType].r, DebuffTypeColor[debuffType].g, DebuffTypeColor[debuffType].b

Last edited by azsh : 05-11-10 at 09:44 AM.
  Reply With Quote
05-11-10, 03:16 PM   #4
Rostok
A Flamescale Wyrmkin
Join Date: Jul 2008
Posts: 127
You should not have to modify the plug in if you have a PostCreate function.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Aura bars - how to change color


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off