-
Notifications
You must be signed in to change notification settings - Fork 91
Tag documentation
Tags in SUF are just pure Lua/World of Warcraft API calls with nothing special to them, you do not need to learn any special API’s that you don’t have to in order to create addons inside World of Warcraft.
If all you want to do is prefix or suffix a tag if they have text, you don’t need to create a new tag and you can use the existing features, for example:
You want to show the group number next to a players name but you want to wrap it in parenthesis, instead of doing ([group])
you would do [(()group())]
this will embed the parenthesis around the group number if there is one, another wise show nothing. Or maybe you want to put an AFK/DND tag next to a players name but you want to put a space after it if their is a flag, you would do [afk( )]
The basic syntax is [(_<text to prefix>_)_<tag>_(_<text to suffix>_)]
.
By default, SUF includes three API calls you can use in tags:
.h2 ShadowUF:Hex
(r, g, b) OR ({r = #, g = #, b = #}) | |
Returns a hex color code based on the 0 – 1.0 RGB value passed. | |
For example: ShadowUF:Hex(1.0, 1.0, 1.0) will return @ |
cff7f7f7f@ |
(unit) | |
Return’s the class color as a hex value if the unit is a player, otherwise returns nil. | |
For example: ShadowUF:GetClassColor("target") if your target is a druid will return @ |
cffff7c0a@ (The default orange color you see for Druids) |
(number) |
Formats a large number into a short one, this is what you see used in the health/power text by default |