SetChatCategoryColor Problem
So I'm developing my first Addon that changes all of the chat colors found under Settings -> Social
I saw in the API theres a command called SetChatCategoryColor (integer category, number red, number green, number blue) that enables you to do this. The problem I'm having is that the RGB values seem to not work. For every category, it either sets it as black or white in the Social settings. However, when I actually chat, it semi-works. Example: SetChatCategoryColor(2, 255, 64, 64); - Should change the yell chat color to slightly different shade of red When I look at the social settings, the color appears as white. However, if I test the yell command it shows up as white while typing, but after entering, it appears red with the code c03fc0 infront of my text: Is the API bugged, or is my Addon just setup wrong? My .lua file is just a series of SetChatCategoryColor calls. Also, I have my .txt file with the addon information. Edit: According to GetChatCategoryColor() the RGB value is properly saved. Thanks for any help |
Functions that take separate r, g, b arguments (as oposed to hex string) work with floating-point values between 0.0 and 1.0. For example (1.0, 0.6, 0.1) is orange, (0.8, 0.8, 1.0) is soft blue (or something like it, I made the numbers up now :)) Simply divide your values / 255.
|
Quote:
|
Ok.. I think I found a legitimate API bug
Category 1 and 5 are both assigned to /say. As a result, there doesn't seem to be a way to to change the "NPC" color. |
Quote:
You are a bit too fast to asume mistakes on Zenimax side. First check if you aren't making themistake yourself. It is best to show us your code so we can take a look at it. |
Quote:
With it, I figured out "NPC" is category 41 for some reason, so this fixes my original issue. I'm not even sure what category 5 is. I think it doesn't exist, so it defaults to 1 Ex: SetChatCategoryColor(1,0,0,0) - say is black SetChatCategoryColor(5, .05, .05 , .05) - category 5 doesn't exist? So it defaults to chat? You're right it's not a bug with the API, but it's not very user friendly designed. The categories are in order of the GUI up to a certain point, then deviate, then one hugely deviates. |
On a side note, storing them by thier INT index is not a good idea. If the order changes between patches this could break the assignment.
However there is a way to get internal constant names instead that allow proper mapping of Category Number and Saved Values if the order should change: http://www.esoui.com/forums/showthread.php?t=1878 I just need to finally work that into UCT. Still using old int-based storage. |
Quote:
Not sure how to directly get the category number. Also, I updated the wiki with all the category numbers I determined by manually testing: http://wiki.esoui.com/SetChatCategoryColor |
Quote:
You should use for example: Lua Code:
Categories are listed here: http://wiki.esoui.com/Globals#ChatChannelCategories |
All times are GMT -6. The time now is 11:28 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI