Category: Miscellaneous
Addon Information
Works with 3.2
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.2.0.16
Date:
08-07-2009 09:27 AM
Size:
11.62 Kb
Downloads:
2,905
Favorites:
90
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
3.2.0.16
  • Added support for default UI's coloring player names in chat by class

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

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

3.1.2.12
  • Forgot to turn off debugging for the last release

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)

3.1.1.8a
  • Update license terms (see README)

3.1.0.8-beta
  • Fix LFG frame coloring for WoW 3.1

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

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

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

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 02-14-2009, 04:34 PM  
Zergreth
A Deviate Faerie Dragon
 
Zergreth's Avatar
Interface Author - Click to view interfaces

Forum posts: 12
File comments: 71
Uploads: 12
Quote:
Originally posted by Seerah
Yes, changing RAID_CLASS_COLORS taints the raid UI immensely. Which is precisely why this addon was developed (so that you're not doing that).
I would like to have some details here. What does it break, and why (if possible)?
Zergreth is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 02-14-2009, 12:24 PM  
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Moderator
Interface Author - Click to view interfaces

Forum posts: 6209
File comments: 315
Uploads: 18
Yes, changing RAID_CLASS_COLORS taints the raid UI immensely. Which is precisely why this addon was developed (so that you're not doing that).
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

Seerah is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 02-14-2009, 10:22 AM  
Zergreth
A Deviate Faerie Dragon
 
Zergreth's Avatar
Interface Author - Click to view interfaces

Forum posts: 12
File comments: 71
Uploads: 12
Still not completely sure about this. Would changing the RAID_CLASS_COLORS global break any Blizzard UI elements?

Last edited by Zergreth : 02-14-2009 at 10:22 AM.
Zergreth is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 02-14-2009, 09:39 AM  
MoonWitch
A Cliff Giant
Interface Author - Click to view interfaces

Forum posts: 70
File comments: 130
Uploads: 8
Very much so.

MoonWitch is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 02-13-2009, 06:11 PM  
eiszeit
A Fallenroot Satyr
 
eiszeit's Avatar
Interface Author - Click to view interfaces

Forum posts: 29
File comments: 200
Uploads: 9
awesome <3
__________________
IF HOME IS WHERE THE HEART IS... WHERE DO YOU GO WHEN YOU DON'T HAVE A HEART?
ALSO KNOWN AS: LYN
eiszeit is offline 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 - 2009, Jelsoft Enterprises Ltd.