View Single Post
11-20-12, 02:27 AM   #1
nin
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Dec 2008
Posts: 213
Casters Classcolor.

Hey fellow Wowiers!

Im currently tracking buffs and debuffs on my raidframes, i would like to try and have my bufficons border colored by the class it is cast from, if that makes sense.

Currently the part of the code looks like this were i color the border..

Lua Code:
  1. local buffcolor = { r = 1.0, g = 1.0, b = 0 }
  2. local updateBuff = function(icon, texture, count, dtype, duration, expires, buff)
  3. local color = buffcolor
  4. icon.border:SetBackdropBorderColor(color.r, color.g, color.b,1)

Tried a couple things but getting errors and my lua knowledge is very limited..have a feeling i need to get this to work with the color function somehow?

Lua Code:
  1. local _, class = UnitClass(unit)
  2. local color = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[class]

Im probably really off here and it makes me feel really dumb :P.. so if anyone could point me in the right direction i'd be thankful!

EDIT: If you need more code to be able to help out let me know! thank you.
  Reply With Quote