Thread Tools Display Modes
02-16-23, 11:49 AM   #1
Platine
A Cliff Giant
AddOn Author - Click to view addons
Join Date: Dec 2010
Posts: 72
Retrieving chat message color code

I would like to download from the system the color code of messages in the chat window, e.g. the color of WHISPER or YELL messages. I think in the function GetCVar() it can do it, just I don't know the right parameter. Can anyone help?
  Reply With Quote
02-16-23, 06:18 PM   #2
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,359
Originally Posted by Platine View Post
I would like to download from the system the color code of messages in the chat window, e.g. the color of WHISPER or YELL messages. I think in the function GetCVar() it can do it, just I don't know the right parameter. Can anyone help?
ChatTypeInfo.WHISPER.r[g|b]
  Reply With Quote
02-19-23, 03:59 AM   #3
Platine
A Cliff Giant
AddOn Author - Click to view addons
Join Date: Dec 2010
Posts: 72
Yes, it is helpful. Thank you.

How about determining the color of the player's link?


Last edited by Platine : 02-19-23 at 04:46 AM.
  Reply With Quote
02-19-23, 11:51 AM   #4
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,359
Code:
colorChatNamesByClass
is the CVar controlling class colors on player names.

The actual color information you can get for any player unit where you can get to their baseClass
through
Code:
_, baseClass = GetPlayerInfoByGUID(guid)
or
Code:
 _, baseClass = UnitClass(unit)
then
Code:
local classColorTable = RAID_CLASS_COLORS[baseClass]
So when you have a valid UnitId or GUID you can get their class information and from that the color information.
  Reply With Quote
02-20-23, 12:54 PM   #5
Platine
A Cliff Giant
AddOn Author - Click to view addons
Join Date: Dec 2010
Posts: 72
Thank you, Dridzt. It's work.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Retrieving chat message color code

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