View Single Post
11-20-08, 08:09 AM   #2
Psoewish
A Scalebane Royal Guard
 
Psoewish's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 447
You should be able to create a new layout, then create the panels you want, and copy the layout of the specific panel you need to the newly created one.

Example to clarify:

I have a layout named "example1", this layout holds all my panels for my Death Knight in red.

Now if I want to have the exact same layout for my Priest, but with different colors, there are 2 things I can do. The first one is more to answer your question in general, the second is an answer specific to this question (having different colors for different classes)

1) I would then create a new layout and call it "example2". Under panels create a new panel, and then go to the options of that panel you just created. There should be 2 dropdown menus at the top now. One to choose wich settings you want to copy, the second to choose what panel you wish to copy the settings from. So if I would have for example a left chatbox panel, I would select "all" from the first dropdown menu, and "leftchatbox" from the right one. This will copy all settings between the panels, and then you can modify the colors for that panel for that layout, while the other one will be intact.

I know it sounds quite complicated, but just read it while being in the kgpanels config window and you'll be able to figure it out I think.

This solution is good for having small differences between layouts that you want to use, or simply if you have mutliple UI settings saved :P


2) An easier solution for this specific problem would be the following:

In the specific panel that you want to change color based in class, go to scripts, and then go to OnLoad. Paste the following code in there:
Code:
local _, class = UnitClass("player");
	if class == "WARRIOR" then
        self:SetBackdropColor(0.95, 0.23, 0.23, 0.00)
	elseif class == "PRIEST" then
        self:SetBackdropColor(1, 0.96, 0.98, 0.00)
	elseif class == "MAGE" then
        self:SetBackdropColor(0.00, 1, 1, 0.00)
	elseif class == "DRUID" then
        self:SetBackdropColor(1, 0.49, 0.04, 0.00)
	elseif class == "PALADIN" then
        self:SetBackdropColor(0.92, 0.22, 0.46, 0.00)
	elseif class == "HUNTER" then
        self:SetBackdropColor(0.33, 0.86, 0.00, 0.00)
	elseif class == "ROGUE" then
        self:SetBackdropColor(1, 0.94, 0.16, 0.00)
	elseif class == "SHAMAN" then
        self:SetBackdropColor(0.13, 0.42, 1, 0.00)
	elseif class == "WARLOCK" then
        self:SetBackdropColor(0.36, 0.18, 1, 0.00)
	end
And edit to the colors you want to use (the codes here are the class colors). The format is (R, G, B, A). I suppose you know what RGB is, and the A is alpha

I hope this answers your question.
  Reply With Quote