Quantcast
EnhancedColourPicker and using it with kgpanels - WoWInterface
Thread Tools Display Modes
11-20-08, 12:31 AM   #1
Mordaki987
A Fallenroot Satyr
Join Date: Oct 2006
Posts: 22
Question EnhancedColourPicker and using it with kgpanels

I'm in need of some help if anyone is knowledgable in this arena i would most appreciate the help. What i'm trying to do is use different color backgrounds for different characters through kgpanels but i am seeing no way of saving the various different profiles and in turn i'm stuck with the same color for all panels regardless of changes made on other or different characters. Example of what i am talking about is i want to use red for all the panels on my death knight then when i log into say my priest i want the colors of the panels to be either blue or purple instead of red. how would i go about accomplishing this? if anyone out there would be able to help i would be forever gratefull.
  Reply With Quote
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
11-20-08, 10:04 AM   #3
Mordaki987
A Fallenroot Satyr
Join Date: Oct 2006
Posts: 22
I got it now thanks to your answer it was just a matter of exporting the layout of that panels i was using then importing the layout as a new layout and switching the colors to what i wanted. your answer was very helpful in figuring it out so thank you for the assistance you were able to provide
  Reply With Quote
11-20-08, 10:07 AM   #4
Psoewish
A Scalebane Royal Guard
 
Psoewish's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 447
*slaps self on head*

Yeah ... exporting and importing is indeed a much easier way to do it!
  Reply With Quote
11-20-08, 10:34 AM   #5
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,704
Originally Posted by Psoewish View Post
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.
If you want to use the default raid class colors, you can use the following code instead
Code:
local _, rclass = UnitClass('player')
local color = RAID_CLASS_COLORS[rclass]
self:SetBackdropColor(color.r, color.g, color.b)
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » EnhancedColourPicker and using it with kgpanels

Thread Tools
Display Modes

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