Category: Miscellaneous
Addon Information
Works with 3.3
Download Latest Version.
To add favorites please register for a free account. If you already have one you need to login. How do I install this? (FAQ)
Phanx's Portal Bug Reports Feature Requests
Author:
Version:
3.3.0.26
Date:
01-11-2010 09:25 AM
Size:
7.57 Kb
Downloads:
3,953
Favorites:
102
MD5:
Pictures
Click to enlarge
Configuration panel
Class Colors
Find a bug? Do not post it in the comments section! See the "Reporting Problems" section below for information on how to correctly report bugs. I will no longer be responding to bugs posted in the comments section.

Description

Class Colors lets you change class colors without breaking the Blizzard UI.

Please post specific bug reports and feature requests in the ticket tracker using the links to the right (just below the big Download link).

General questions, comments, suggestions, and other feedback may be posted in the comments section on this page, or in the the discussion thread on wowace.com.

How can changing class colors break the Blizzard UI?

Addons like the ubiquitous !ReTeal change colors by changing the values in a table called RAID_CLASS_COLORS, which is created by Blizzard code. Doing so causes all other Blizzard code which reads from this table to become "tainted", and Blizzard's secure code restrictions mean that parts of the UI whose code is tainted stop working. Tainting the RAID_CLASS_COLORS table means that you can't see the raid panel while you're in combat, and can't set main tanks or main assists from the right-click menu in the raid panel.

How does Class Colors solve this problem?

Class Colors solves this problem by not touching RAID_CLASS_COLORS at all. Instead, it creates its own separate table called CUSTOM_CLASS_COLORS. Since this table isn't created by Blizzard code, and isn't used by any Blizzard code, it doesn't taint anything, and its values can be changed as much as you like. However, this does mean that any addons that read colors from RAID_CLASS_COLORS must be updated to read from CUSTOM_CLASS_COLORS instead if it exists.

In addition to solving the taint problem, Class Colors also provides an in-game UI for changing class colors. It also applies your custom colors to the Blizzard UI in a safe way that doesn't taint it. To access the configuration UI, type /classcolors or open the Blizzard Interface Options window, select the AddOns tab, and select the "Class Colors" entry in the left-hand column.

Frequently Asked Questions

Why don't my color changes show up in <insert addon name>?

There are three reasons why an addon might immediately not reflect the changes you make through Class Colors.

1) The addon might not support Class Colors at all. If this is the case, ask the author to add support. Supporting Class Colors requires only adding a few lines of code, so if you ask politely and include a link to this page so the author doesn't have to hunt for information, most authors are willing to do it.

2) If the addon has its own options to change the class colors it uses, you might need to reset its color options. Look for an option to reset class colors. Grid and Recount both fall into this category.

3) The addon might not listen for the announcements Class Colors can provide when a color has changed. If this is the case, you will need to reload your UI before it will use the new colors. You can also point the author at this page and ask them to add callback support.

Information For Addon Authors

Supporting this system is as easy as checking for the existence of a global table CUSTOM_CLASS_COLORS and reading from it instead of RAID_CLASS_COLORS if it exists.

If your addon creates a local cache of class colors, it is recommended that you also register for a callback when class colors are changed by the user (see API documentation below) and update your color cache when the callback is fired.

As not all users are on systems which load addon folders in alphabetical order, there is no guarantee that !ClassColors will be loaded before your addon. There are two ways you can account for this possibility.

1) Ideally, you should delay using any class colors until the PLAYER_LOGIN event. If this is not possible, you could just build your cache from RAID_CLASS_COLORS if CUSTOM_CLASS_COLORS is not yet available when your addon loads, and then update your cache and register for callbacks on PLAYER_LOGIN.

2) You can just add !ClassColors to your addon's OptionalDeps field, though this is not a recommended solution, as it will prohibit other implementations of CUSTOM_CLASS_COLORS and clutter up your TOC.

API documentation and information on alternative implementations can be found on my WoWInterface portal.

Reporting Problems

If you encounter a problem with Class Colors, first check the bug report tracker to see if the problem has already been reported. If it hasn't, try some basic troubleshooting steps. Then, submit a bug report, making sure to include:
  • the results of your troubleshooting,
  • which version of the addon you're using,
  • where you downloaded it from,
  • the text of any error messages generated in-game,
  • what you were doing when the error occurred, and
  • what the current version of WoW in your region is.
Most importantly, remember to check on your ticket after a few days, as I may need more information to solve the problem!

License

Please see my portal or the README file included in the addon's folder for the full license terms under which this addon is released. In particular, redistribution without prior permission is prohibited. Compilation creators, please show your support for addon authors by taking a few minutes to learn about the basic details of copyright law and software licensing before you upload. Thanks!

Note that I will almost certainly give you permission to include Class Colors in your compilation. Earlier versions were released under terms that did not require permission, but due to the actions of certain unscrupulous distributors, I have chosen to license it under stricter terms to thwart their efforts to make money by essentially stealing my addon. If you are a regular compliation creator, just ask!
  Change Log - Class Colors
Version 3.3.0.26
  • Added coloring of class names in the channel pane of the chat config window

Version 3.3.0.24
  • Added coloring of names in the LookingForRaid interface
  • Fixed drycode errors

Version 3.3.0.22
  • Updated for WoW 3.3
  • Removed coloring for parts of the UI that aren't normally colored. This functionality may or may not reappear in a separate addon at a later date.

Version 3.2.0.16
  • Added support for default UI's coloring player names in chat by class

Version 3.1.2.14
  • Added checks for cases where UnitClass fails to return values

Version 3.1.2.13
  • Fixed nil value error in coloring for arena team list

Version 3.1.2.12
  • Forgot to turn off debugging for the last release

Version 3.1.2.11
  • Add coloring for friends list (online friends only)
  • Add coloring for arena team list (untested)
  • Add coloring for trade frame (player names)
  • Add coloring for inspect frame (player name)
  • Add coloring for unit frames (player names only)

Version 3.1.1.8a
  • Update license terms (see README)

Version 3.1.0.8-beta
  • Fix LFG frame coloring for WoW 3.1

Version 3.0.9.5-beta
  • Fix deDE translation for "Death Knight"
  • Increase size allotted to description text in config panel to prevent truncation

Version 3.0.9.4-beta
  • Fix callbacks for handler[method] functions.

Version 3.0.9.3-beta
  • Fix metatable
  • Add reset button to config panel
  • Change config panel to apply color changes immediately instead of waiting until the panel is closed

Version 3.0.9.2-beta
  • Remove :IterateClasses method
  • Move :RegisterCallback and :UnregisterCallbacks to metatable __index
  • Add README
  Comments - Class Colors
Post A Reply Comment Options
Old 01-24-2010, 07:59 PM  
Phanx
A Frostmaul Preserver
 
Phanx's Avatar
Interface Author - Click to view interfaces

Forum posts: 263
File comments: 817
Uploads: 17
No. As I've said previously, !ClassColors is about changing player class colors; functionality to change other colors falls outside of the scope, and will never be added. Other colors, such as power bar colors, and reaction colors (what are used for NPC unit colors) can be changed by overriding values in the default tables created and used by Blizzard code, as altering these tables does not taint any secure code paths. If you want to change them, simply do what you're already doing -- add your overrides to any addon's Lua file, or create a separate personal addon and stick the overrides in there.
Phanx is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 01-23-2010, 08:35 AM  
Toran
A Cliff Giant

Forum posts: 74
File comments: 233
Uploads: 0
No errors, worked fine. I updated to latest. Any chance you can add a color picker for mana? For now, I added this code at the bottom of classcolors.lua to tweak the color and it's working:

Code:
PowerBarColor.MANA.r = 26/255
PowerBarColor.MANA.g = 139/255
PowerBarColor.MANA.b = 255/255
Also, is there a way to change the bar color for pets and NPCs? I have a warlock and my Felguard shows as a green health bar, but not sure technically which class he aligns to. Most NPCs show as a green bar too. Do you know what code would be needed to adjust that color (perhaps similar to above)?

Last edited by Toran : 01-23-2010 at 08:38 AM.
Toran is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 01-23-2010, 05:21 AM  
Phanx
A Frostmaul Preserver
 
Phanx's Avatar
Interface Author - Click to view interfaces

Forum posts: 263
File comments: 817
Uploads: 17
You're several versions out of date, then, and your copy should be generating tons of errors in WoW 3.3. That commented stuff was just left over from before the addon was developed for public release, and wasn't intended to stick around as long as it did. I do change the mana bar color in my UI, but not from !ClassColors, nor is that something !ClassColors will ever (intentionally) do.

Last edited by Phanx : 01-23-2010 at 05:22 AM.
Phanx is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 01-22-2010, 05:00 PM  
Toran
A Cliff Giant

Forum posts: 74
File comments: 233
Uploads: 0
Hi Phanx. Noticed a commented area at the bottom of classcolors.lua. I uncommented it out and it gave me a much softer blue for the mana bar, whicih I liked from !Lyncolors. I assume you left it there so we could uncomment it and use? Seems like a much better default color than the standard darker blue mana color.
Toran is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 01-12-2010, 12:30 AM  
Phanx
A Frostmaul Preserver
 
Phanx's Avatar
Interface Author - Click to view interfaces

Forum posts: 263
File comments: 817
Uploads: 17
Version 3.3.0.26
  • Added coloring of class names in the channel pane of the chat config window
Phanx is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 12-13-2009, 05:20 AM  
Dridzt
A Rage Talon Dragon Guard
Interface Author - Click to view interfaces

Forum posts: 308
File comments: 452
Uploads: 38
Bug report filed for 3.3.0.22.
Dridzt is online now Report comment to moderator   Edit/Delete Message Reply With Quote
Old 12-08-2009, 11:54 PM  
ElphieRAWR
A Deviate Faerie Dragon
 
ElphieRAWR's Avatar
Interface Author - Click to view interfaces

Forum posts: 10
File comments: 38
Uploads: 7
3.3

It appears 3.3 hasn't quite broken it, just made a lua error regarding LFMFrame_Update not existing appear on every reload/login.
Commenting out lines 244-266 of ClassColorsBlizz.lua "fixes" it.
Code:
--[[		hooksecurefunc("LFMFrame_Update", function()
			-- print("LFMFrame_Update")
			local button, class, color, _

			local n = GetNumLFGResultsProxy()
			local offset = FauxScrollFrame_GetOffset(LFMListScrollFrame)

			for i = 1, LFGS_TO_DISPLAY do
				if offset <= n then
					button = _G["LFMFrameButton"..i]
					if button:IsShown() then
						name, _, _, _, _, _, _, _, _, _, class = GetLFGResultsProxy(offset + i)
						if class then
							color = CUSTOM_CLASS_COLORS[class]
							if color then
								_G["LFMFrameButton"..i.."Class"]:SetTextColor(color.r, color.g, color.b)
							end
						end
					end
				end
			end
		end)
--]]
__________________
-- Elphie --
[Matanya of Arthas]
ElphieRAWR is online now Report comment to moderator   Edit/Delete Message Reply With Quote
Old 11-14-2009, 07:57 AM  
Phanx
A Frostmaul Preserver
 
Phanx's Avatar
Interface Author - Click to view interfaces

Forum posts: 263
File comments: 817
Uploads: 17
Re: healthbar

Quote:
Originally posted by questionn
can i active this addon for the default ui bar ?
i need the healthbar colored by class
The purpose of this addon is to change class colors. Applying class colors to parts of the UI that are not colored by default, and whose function may be significantly altered by such application, is outside the scope of this addon. It would be fairly simple for you (or a programmer friend) to write an addon to apply class coloring to the default health bars, but it isn't something I'll add to Class Colors.
Phanx is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 10-22-2009, 10:53 AM  
questionn
A Kobold Labourer

Forum posts: 0
File comments: 2
Uploads: 0
healthbar

hi,

can i active this addon for the default ui bar ?
i need the healthbar colored by class
questionn is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 09-07-2009, 08:38 AM  
Zergreth
A Deviate Faerie Dragon
 
Zergreth's Avatar
Interface Author - Click to view interfaces

Forum posts: 15
File comments: 80
Uploads: 12
Quote:
Originally posted by Phanx
Replied to your bug report. Also, if you're expecting someone to change something for your sake, beginning your request with an insult is probably not the best approach.
I'm sorry, I wasn't aware it is seen that rude. English is not my first language.
Zergreth is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 09-06-2009, 09:16 PM  
Phanx
A Frostmaul Preserver
 
Phanx's Avatar
Interface Author - Click to view interfaces

Forum posts: 263
File comments: 817
Uploads: 17
Replied to your bug report. Also, if you're expecting someone to change something for your sake, beginning your request with an insult is probably not the best approach.
Phanx is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 09-06-2009, 05:40 AM  
Zergreth
A Deviate Faerie Dragon
 
Zergreth's Avatar
Interface Author - Click to view interfaces

Forum posts: 15
File comments: 80
Uploads: 12
The implementation of the unit frame coloring is a bit poor, don't you think? By using SetTextColor() and only executing that bit of code when the unit is a player, you change the color to a class color permanently, resulting in random class colors if you target an NPC, depending on the class of your last player target.

Edit: Also submitted it as a bug.

Last edited by Zergreth : 09-06-2009 at 05:44 AM.
Zergreth is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 08-08-2009, 06:52 PM  
Phanx
A Frostmaul Preserver
 
Phanx's Avatar
Interface Author - Click to view interfaces

Forum posts: 263
File comments: 817
Uploads: 17
@Strongbow:

Please test with all other addons disabled; I see Factionizer at least mentioned in the error's stack trace, and Blizzard code shouldn't be calling the relevant function without parameters. If the error persists, post a bug report using the Bug Report button underneath the Download button. Otherwise, track down which addon is causing the problem by enabling addons until the problem comes back, and ask its author to fix it.

Last edited by Phanx : 08-08-2009 at 06:54 PM.
Phanx is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 08-08-2009, 04:18 PM  
Strongbow
A Deviate Faerie Dragon
 
Strongbow's Avatar

Forum posts: 11
File comments: 99
Uploads: 0
Getting this error with the latest version

Date: 2009-08-08 22:13:04
ID: 2
Error occured in: Global
Count: 20
Message: ..\AddOns\!ClassColors\ClassColorsBlizz.lua line 171:
Usage: GetPlayerInfoByGUID("playerGUID")
Debug:
[C]: ?
[C]: GetPlayerInfoByGUID()
!ClassColors\ClassColorsBlizz.lua:171: GetColoredName()
..\FrameXML\ChatFrame.lua:2490:
..\FrameXML\ChatFrame.lua:2471
[C]: ChatFrame_MessageEventHandler()
..\FrameXML\ChatFrame.lua:2288: FIZ_Orig_ChatFrame_OnEvent()
Factionizer\Factionizer.lua:5007: ChatFrame_OnEvent()
[string "*:OnEvent"]:1:
[string "*:OnEvent"]:1


I'm using Chatter as my addon but I think it has to do with the new name colouring that blizz put in 3.2.

-Strongbow-
Strongbow is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 05-25-2009, 06:55 AM  
Dridzt
A Rage Talon Dragon Guard
Interface Author - Click to view interfaces

Forum posts: 308
File comments: 452
Uploads: 38
Used the "Report Bug" feature to file a bug for the recent v3.1.2.13

Related to unitframe coloring when accepting a party invite.

Edit: 3.1.2.14 fixed this error.

Last edited by Dridzt : 05-28-2009 at 04:45 AM.
Dridzt is online now Report comment to moderator   Edit/Delete Message Reply With Quote
Post A Reply



Category Jump:




The Network:
EQInterface | EQ2Interface | LoTROInterface | MMOInterface | War.MMOUI | WoWInterface | VGInterface | Allakhazam | Thottbot | Wowhead | Zam


©2009 MMOUI / ZAM Network
vBulletin - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.