WoWInterface - View Single Post - LF help with UIErrorsFrame:AddMessage
View Single Post
07-04-20, 03:30 PM   #3
A Defias Bandit
Join Date: Jul 2020
Posts: 3
Thumbs up

Originally Posted by Kanegasi View Post
The text size is dictated by UIErrorsFrame itself, I don't think you can change the size of an individual line.

As for the icon, I don't think you can dynamically get the file path to use in the texture escape sequence if you were looking to code for any spell, but you can look up the file name on wowhead by finding the icon ID.

Cyclone spell ID is 33786:
Click on the icon and the popup shows 136022, so:
File name is "Spell_nature_earthbind", so:
    /run print("\124TInterface\\ICONS\\Spell_nature_earthbind:0\124t")
This command prints the icon autosized to your chat frame.
Now for the class color, you'll have to query UnitGUID("target"), then the second return of GetPlayerInfoByGUID(guid), then RAID_CLASS_COLORS[class].colorStr.

local guid,_,class,color=UnitGUID("target")
if guid then
if class then
Now put everything together:

Lua Code:
  1. local guid,name,_,class,color=UnitGUID("target"),UnitName("target")
  2. if guid then
  3.     _,class=GetPlayerInfoByGUID(guid)
  4. end
  5. if class then
  6.     color=RAID_CLASS_COLORS[class].colorStr
  7. end
  9. UIErrorsFrame:AddMessage("Casted \124TInterface\\ICONS\\Spell_nature_earthbind:0\124t on "..((color and "\124C"..color or "")..(name or "")..(color and "\124r" or "")).."!!",1.0,2.0,1.0,53,3)
Thanks so much.
  Reply With Quote