Thread Tools Display Modes
06-05-10, 11:43 AM   #1
Kendian
A Molten Giant
 
Kendian's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 614
KG Panels custom class colored borders

I'm trying to figure out a way to insert a custom class color table for KG Panels borders. I've figured out how to class color the panels themselves, but the borders are beyond me, just can't figure out how to make it color my borders . Any/all help is appreciated I am stumped >.<

Last edited by Kendian : 06-05-10 at 02:16 PM. Reason: Spelling~
  Reply With Quote
06-05-10, 02:17 PM   #2
Kendian
A Molten Giant
 
Kendian's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 614
Class colored borders KG Panels

local _,class = UnitClass("player")

self:SetBackdropBorderColor if class == "WARRIOR" then
self.bg:SetVertexColor(0.95, 0.23, 0.23, self.bg:GetAlpha())
elseif class == "PRIEST" then
self.bg:SetVertexColor(1, 0.96, 0.98, self.bg:GetAlpha())
elseif class == "MAGE" then
self.bg:SetVertexColor(0.00, 1, 1, self.bg:GetAlpha())
elseif class == "DRUID" then
self.bg:SetVertexColor(1, 0.49, 0.04, self.bg:GetAlpha())
elseif class == "PALADIN" then
self.bg:SetVertexColor(0.92, 0.22, 0.46, self.bg:GetAlpha())
elseif class == "HUNTER" then
self.bg:SetVertexColor(0.33, 0.86, 0.00, self.bg:GetAlpha())
elseif class == "ROGUE" then
self.bg:SetVertexColor(1, 0.94, 0.16, self.bg:GetAlpha())
elseif class == "SHAMAN" then
self.bg:SetVertexColor(0.13, 0.42, 1, self.bg:GetAlpha())
elseif class == "WARLOCK" then
self.bg:SetVertexColor(0.36, 0.18, 1, self.bg:GetAlpha())
end
This is what I have, and it does no work, (obviously, lol)
  Reply With Quote
06-05-10, 03:00 PM   #3
Dainton
A Flamescale Wyrmkin
 
Dainton's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 115
Can you not do something like this?

Code:
local classColor = RAID_CLASS_COLORS[select(2, UnitClass("player"))]
self.bg:SetVertexColor(classColor.r, classColor.g, classColor.b)
This could be done different ways depending on the border you want to color (textured/solid/etc.).

Last edited by Dainton : 06-05-10 at 05:27 PM. Reason: SetVertexColor is between 0 and 1 :X
  Reply With Quote
06-05-10, 04:58 PM   #4
Kendian
A Molten Giant
 
Kendian's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 614
Awesome

Worked Perfectly Thanks!
  Reply With Quote
06-11-10, 03:12 PM   #5
jeffy162
A Pyroguard Emberseer
 
jeffy162's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 2,364
Actually, you're original is very close to what is shown on the kgPanels example script page. All it says is "OnLoad", so I'm guessing that's where it would all go.
Code:
local _, class = UnitClass("player");
	if class == "WARRIOR" then
        self.bg:SetVertexColor(0.95, 0.23, 0.23, self.bg:GetAlpha())
	elseif class == "PRIEST" then
        self.bg:SetVertexColor(1, 0.96, 0.98, self.bg:GetAlpha())
	elseif class == "MAGE" then
        self.bg:SetVertexColor(0.00, 1, 1, self.bg:GetAlpha())
	elseif class == "DRUID" then
        self.bg:SetVertexColor(1, 0.49, 0.04, self.bg:GetAlpha())
	elseif class == "PALADIN" then
        self.bg:SetVertexColor(0.92, 0.22, 0.46, self.bg:GetAlpha())
	elseif class == "HUNTER" then
        self.bg:SetVertexColor(0.33, 0.86, 0.00, self.bg:GetAlpha())
	elseif class == "ROGUE" then
        self.bg:SetVertexColor(1, 0.94, 0.16, self.bg:GetAlpha())
	elseif class == "SHAMAN" then
        self.bg:SetVertexColor(0.13, 0.42, 1, self.bg:GetAlpha())
	elseif class == "WARLOCK" then
        self.bg:SetVertexColor(0.36, 0.18, 1, self.bg:GetAlpha())
	end
Haven't tried it, so don't know if it works. The example is posted here.

Last edited by jeffy162 : 06-11-10 at 03:19 PM.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » KG Panels custom class colored borders


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