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,836
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 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: 12
File comments: 71
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 Cobalt Mageweaver
 
Phanx's Avatar
Interface Author - Click to view interfaces

Forum posts: 201
File comments: 729
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: 12
File comments: 71
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 Cobalt Mageweaver
 
Phanx's Avatar
Interface Author - Click to view interfaces

Forum posts: 201
File comments: 729
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: 10
File comments: 94
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 Frostmaul Preserver
Interface Author - Click to view interfaces

Forum posts: 277
File comments: 407
Uploads: 37
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 offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 05-24-2009, 07:33 PM  
Phanx
A Cobalt Mageweaver
 
Phanx's Avatar
Interface Author - Click to view interfaces

Forum posts: 201
File comments: 729
Uploads: 17
Fixed, along with the nil value error related to coloring the arena team list.
Phanx is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 05-24-2009, 12:52 AM  
raskul
A Kobold Labourer

Forum posts: 0
File comments: 4
Uploads: 0
FriendsList_Update constantly being spammed in my chat box with the new update. Anyone else?
raskul is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 05-24-2009, 12:16 AM  
Phanx
A Cobalt Mageweaver
 
Phanx's Avatar
Interface Author - Click to view interfaces

Forum posts: 201
File comments: 729
Uploads: 17
Quote:
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)
Went ahead and finished up some extra goodies I've been working on. Note that arena team list coloring is untested, since I'm not on any arena teams. Please report any issues with it.
Phanx is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 05-23-2009, 08:19 PM  
Phanx
A Cobalt Mageweaver
 
Phanx's Avatar
Interface Author - Click to view interfaces

Forum posts: 201
File comments: 729
Uploads: 17
Quote:
3.1.1.8a
  • Update license terms (see README)
This change was made primarily to prevent WoWMatrix from distributing my addon. If you are a compilation uploader whose compilation currently includes !ClassColors, please send an email "addons AT phanx DOT net" with the URL(s) where your compilation is available for permission to continue distributing my addon.
Phanx is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 02-15-2009, 02:31 PM  
Phanx
A Cobalt Mageweaver
 
Phanx's Avatar
Interface Author - Click to view interfaces

Forum posts: 201
File comments: 729
Uploads: 17
Quote:
Originally posted by Zergreth
Edit: By the way, there's a locale error in the deDE table. The proper translation of death knight is Todesritter, not Todestritter.
Hah. I guess Babble has it wrong, then. Will fix soon.
Phanx is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 02-15-2009, 06:12 AM  
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 Phanx
You can no longer view the raid panel while in combat, and you can no longer set main tanks or main assists from the raid panel right-click menu, for example. This occurs because all of the raid panel code is "secure", and in order for it to remain secure, everything that touches it must also be secure. RAID_CLASS_COLORS comes from Blizzard code, and is thus secure by default, but if an addon touches it, it becomes tainted, and taints anything else that's secure that uses it.

Addons that modify the friends frame can cause the same kind of taint, because they touch the social window (which the raid panel is part of). Basically, that whole part of Blizzard's code is written rather poorly, and is extremely susceptible to taint from a multitude of greatly varied sources.

I suspect that modifying RAID_CLASS_COLORS may also have something to do with the "action blocked" errors people receive that name random addons as having attempted to call the protected function LFGQuery()... since I haven't been modifying RAID_CLASS_COLORS, I haven't seen a single occurrence, while previously they occurred quite regularly at a rate of several per hour.
Ah, quite interesting. Thanks for the information. Guess I will use Class Colors instead of ReTeal then (:

Edit: By the way, there's a locale error in the deDE table. The proper translation of death knight is Todesritter, not Todestritter.

Last edited by Zergreth : 02-15-2009 at 07:02 AM.
Zergreth is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 02-14-2009, 06:14 PM  
Phanx
A Cobalt Mageweaver
 
Phanx's Avatar
Interface Author - Click to view interfaces

Forum posts: 201
File comments: 729
Uploads: 17
Quote:
Originally posted by Zergreth
I would like to have some details here. What does it break, and why (if possible)?
You can no longer view the raid panel while in combat, and you can no longer set main tanks or main assists from the raid panel right-click menu, for example. This occurs because all of the raid panel code is "secure", and in order for it to remain secure, everything that touches it must also be secure. RAID_CLASS_COLORS comes from Blizzard code, and is thus secure by default, but if an addon touches it, it becomes tainted, and taints anything else that's secure that uses it.

Addons that modify the friends frame can cause the same kind of taint, because they touch the social window (which the raid panel is part of). Basically, that whole part of Blizzard's code is written rather poorly, and is extremely susceptible to taint from a multitude of greatly varied sources.

I suspect that modifying RAID_CLASS_COLORS may also have something to do with the "action blocked" errors people receive that name random addons as having attempted to call the protected function LFGQuery()... since I haven't been modifying RAID_CLASS_COLORS, I haven't seen a single occurrence, while previously they occurred quite regularly at a rate of several per hour.

Last edited by Phanx : 02-14-2009 at 06:18 PM.
Phanx is offline Report comment to moderator   Edit/Delete Message Reply With Quote
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
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.