Raid target in strings
Hi all
I am the author of a small addon Swarm. I am looking for help in how to use the wow api to insert a target marker icon into a chat string; eg Lua Code:
I can do it easily in a macro but have yet to crack doing the same within my addon. I have worked out how to add a texture to a frame or button but not how to add a raid target icon to a string. Any help with this would be great. |
You have to use the escape sequence to put the texture in the string, I believe.
https://wow.gamepedia.com/UI_escape_sequences |
Adding on to what Seerah said:
The |T ... |t format is already partly populated in a table called ICON_LIST, so you can do something like this: Lua Code:
Source: https://authors.curseforge.com/forum...chat?comment=4 |
Quote:
What do you mean? You can just put {skull} or {rt8} (locale-independent) in your string Lua Code:
|
Quote:
|
FYI: The server won't let you send the |T escape sequence. The only escape codes that can be sent are valid links (must include color code too).
|
Hi all.
Thanks for your suggestions, I still have not been able to make it work but I have not given up just yet. The print solution only prints it into my chat, it does not broadcast it to general. From reading the escape sequences page it seems it should be as easy as Lua Code:
Lua Code:
I tried a number combinations yet each time I got the same Invalid escape code in chat message error I also tried just using the naked {rt8} Lua Code:
Lua Code:
Any further help or suggestions would be greatly appreciated. |
{rt8} is not a string, it is a table. You need to surround it with quotes to make it a string.
Lua Code:
|
You send the string "{rt8}" and the client on the receiving end converts it into the appropriate texture. In Classic, this is done by ChatFrame_ReplaceIconAndGroupExpressions(). In Modern, this was moved into C code and is handled by C_ChatInfo.ReplaceIconAndGroupExpressions().
Here's a list of these icon tags. https://wow.gamepedia.com/Chat_substitutions |
Hi All
Thanks for the further help, however, I am still stuck. Kusya12 your comment indicates that you did manage to send an icon to general chat; how did you get it to work? I have tried all of the following statements without success, Lua Code:
Any further help and advice would be great. |
The functions that SDPhantom mentioned aren't functions you use, they are what transform the special {} strings into icons in clients that receive your message.
All you need to send a raid icon in chat is a certain string, no functions or anything special. Copy any of these and use them directly in your chat with nothing else to test them out: Code:
{rt1} Lua Code:
|
Hi Kanegasi
Your solution did not work for me, all it did was print the string itself. Lua Code:
Did you get it working in-game? |
Apparently the 17th payload value supressRaidIcons of CHAT_MSG_CHANNEL is true for General and Trade
So raid target icons will not be shown there. Which is good actually |
Just imagining it makes me shudder...
:D:):confused::o Did :confused: someone :mad: say [Thunderfury, Blessed Blade of the Windseeker]:D?:):confused::confused: Just replace smilies with raid markers. Yikes! |
Hi Ketho
I see, that is why I couldn't get it working; thanks for letting me know, at least I now know I wasn't totally stupid :) The answer is not the one I would like but now I know for sure; and I can see how it is probably a good thing that we cannot send icons to chat, as DahkCeles proves. Thanks to everyone for the help and suggestions. I love this forum; as a self-taught noob I really appreciate the great help and explanations. Cheers all :) |
You can send them to chat. Just not trade or general. Did you test it in a whisper to yourself?
|
Hi Seerah
Yes, when I send to whisper it works. Once again thanks for the help.:) |
All times are GMT -6. The time now is 09:12 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI