Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
(upgraded copper template)
 
 
Line 1: Line 1:
  +
{{uitech}}
−
<!-- [[Image:Uthrar Threx.jpg|thumb|[[{{PAGENAME}}]]]]
 
  +
Many UI elements that display text on the screen support a special escape sequences starting with the pipe character (|).
−
-->{{npcbox
 
−
| name = Uthrar Threx
 
−
| image = Uthrar Threx.jpg
 
−
| title =
 
−
| level = 24
 
−
| type =
 
−
| faction = Alliance
 
−
| city =
 
−
| race = Dwarf
 
−
| creature = Humanoid
 
−
| sex =
 
−
| location = [[Ironforge]]
 
}}
 
−
'''Uthrar Threx''' is a level 24 [[journeyman]] [[tailoring trainer]] located in [[the Great Forge]] in the [[dwarf]] city of [[Ironforge]].
 
−
<br><br>
 
−
See [[List of Ironforge NPCs]].
 
   
  +
== Supported Escape Sequences ==
−
== Recipes ==
 
  +
=== Coloring ===
−
* [1] [[White Linen Shirt]] {{gsc|||50}}
 
  +
;<tt>|c''AA<font color=red>RR</font><font color=green>GG</font><font color=blue>BB</font>''</tt>: Sets text color. Text following this escape sequence will be drawn in this color. Each pair of digits represents a color value (plus the alpha value, however the alpha value is currently ignored and should always be FF) as a hexadecimal number.
−
* [10] [[Brown Linen Vest]] {{gsc|||50}}
 
  +
:* |cFFFF0000 - Red text
−
* [15] [[Linen Belt]] {{gsc|||50}}
 
  +
:* |cFF00FF00 - Green text
−
* [20] [[Simple Linen Boots]] {{gsc|||50}}
 
  +
:* |cFF0000FF - Blue text
−
* [30] [[Brown Linen Pants]] {{gsc|||50}}
 
  +
:* |cFFFFFF00 - Yellow text
−
* [30] [[Brown Linen Robe]] {{gsc|||50}}
 
  +
;<tt>|r</tt>: Ends the current color change. The color will return to the previously set color (e.g. |cFFFF0000<span style="color: #ff0000">Red</span> |cFF00FF00<span style="color: #00ff00">green</span>|r <span style="color: #ff0000">and back to red.</span>|r).
−
* [30] [[White Linen Robe]] {{gsc|||50}}
 
−
* [35] [[Heavy Linen Gloves]] {{gsc||1}}
 
−
* [40] [[Blue Linen Shirt]] {{gsc|||50}}
 
−
* [40] [[Red Linen Shirt]] {{gsc|||50}}
 
−
* [40] [[Simple Dress]] {{gsc|||50}}
 
−
* [45] [[Linen Bag]] {{gsc||1}}
 
−
* [60] [[Green Linen Bracers]] {{gsc||2}}
 
−
* [60] [[Reinforced Linen Cape]] {{gsc||2}}
 
−
* [65] [[Linen Boots]] {{gsc||2}}
 
−
* [70] [[Barbaric Linen Vest]] {{gsc||3}}
 
−
* [70] [[Green Linen Shirt]] {{gsc||2}}
 
−
* [70] [[Handstitched Linen Britches]] {{gsc||3}}
 
−
* [75] [[Bolt of Woolen Cloth]] {{gsc||1}}
 
−
* [75] [[Simple Kilt]] {{gsc||3}}
 
−
* [75] [[Woolen Cape]] {{cost||2|50}}
 
   
  +
=== Links ===
−
[[Category:Dwarves|Threx]]
 
  +
;<tt>|H''linktype'':''linkstring''|h''Linktext''|h</tt>: for hyperlinks: when linktext is clicked, a widget handler is invoked.
−
[[Category:Tailoring Trainers|Threx]]
 
  +
−
[[Category:City:Ironforge|Threx]]
 
  +
;<tt>|Hitem&#x003A;''ItemString''|h''Linktext''|h</tt>: for Item Links (ItemString must be the full [[ItemString]], ie. d:d:d:d:d:d:d:d style)
  +
  +
;<tt>|Henchant&#x003A;''EnchantID''|h''Linktext''|h</tt>: for Enchant links
  +
  +
;<tt>|Hplayer&#x003A;''Name'':''ChatID''|h''Linktext''|h</tt>: for Player links (Click to whisper, CTRL-click to select and shift-click to do a <tt>/who ''Name''</tt>. ChatID here refers to spam reporting
  +
  +
;<tt>|HBNplayer&#x003A;''??''|h</tt>: Placeholder
  +
  +
;<tt>|Hunit&#x003A;''GUID''|h:''Name''|h</tt>: for Unit links (Left-click opens the '''ItemRefTooltip''' frame, similar as with the '''Blizzard CombatLog''' and [[API_SetItemRef]])
  +
:* GUID = [[API_UnitGUID]]; It accepts both with or without the hex prefix '''"0x"'''.
  +
:* Name = [[API_UnitName]]; You can change '''"Name"''' to anything you want without breaking the link.
  +
:* Right-clicking will return an error, "because it will try to call ''Blizzard_CombatLog_CreateUnitMenu()'' and ''unitName'' is not given to it, so ''displayName'' == nil".
  +
  +
;<tt>|Hquest&#x003A;''QuestID'':''QuestLevel''|h''Linktext''|h</tt>: for Quest links.
  +
  +
;<tt>|Hspell&#x003A;''SpellID''</tt>: for spell links.
  +
  +
;<tt>|Htalent&#x003A;''TooltipID'':''Points''</tt>: for talent links.
  +
:* TooltipID seems to be a global talent id, not quite sure how it's encoded or stored.
  +
:* Points is how many points you've spent in that talent, zero based (3 points in it means '2') and -1 for no points.
  +
  +
;<tt>|Htrade:''TradeSpellID'':''CurrentLevel'':''MaxLevel'':''PlayerID'':''Recipes''|h''Linktext''|h</tt>: for Trade links. Note that the '''TradeSpellID''' corresponds to the spell id from the spell found in the spellbook (e.g. "Cooking" has id 33359). See also [[TradeSkillLink]].
  +
:* CurrentLevel: the current level of the player in the given trade-skill
  +
:* MaxLevel: the highest currently achievable skill (an apprentice will have 75 as max level, a grand master 450)
  +
:* PlayerID: [[API_UnitGUID]] of the player, stripped of all the leading zeroes (unlike GUID for Achievement below where the leading zeroes are included).
  +
:* Recipes: Base64-encoded list of learned recipes.
  +
  +
;<tt>|Hachievement:''AchievementID'':''GUID'':''Completed'':''Month'':''Day'':''Year'':''Unknown1'':''Unknown2'':''Unknown3'':''Unknown4''|h''Linktext''|h</tt>: for achievement links.
  +
:* GUID is the [[API_UnitGUID]] of the player, without the starting '0x'.
  +
:* Completed is 0 for uncompleted achievements and 1 for completed.
  +
:* Month/Day/Year is the date the achievement was completed or 0 if not completed. ''Year'' is -1 if not completed.
  +
:* Unknown1-4 are unknown fields. They're often 0 for non-completed achievements.
  +
  +
;<tt>|Hinstancelock:guid:mapID:difficulty:defeatedEncounters|hName|h</tt>: Instance lock links
  +
:* GUID: [[API_UnitGUID|Unit GUID]] of the player
  +
:* Map ID: self explainatory - 650 for ToCh, 649 for ToCr ETC.
  +
:* Difficulty: Difficulty id of the instance lock (heroic/nonheroic, 10/25)
  +
:* Defeated Encounters: Bitfield indicating the encounters that have been defeated. E.g. 7 means that the first 3 encounters have been done but the subsequent ones have not.
  +
  +
=== Grammar ===
  +
;<tt>''number'' |1''singular'';''plural'';</tt>: Will choose a word depending on whether the ''digit'' preceding it is 0/1 or not (i.e. 1,11,21 return the first string, as will 0,10,40). Note that unlike |4 singular and plural forms are separated by semi-colon.
  +
;<tt>|2''text''</tt>: Before vowels outputs <i>d'</i> (with apostrophe) and removes any leading spaces from ''text'', otherwise outputs <i>de </i> (with trailing space)
  +
;<tt>|3-''formid''(''text'')</tt>: Displays ''text'' [[wikipedia:Declension|declined]] to the specified form (index ranges from 1 to {{api|GetNumDeclensionSets}}()). Processed by C code, data used for parsing isn't available to UI, all events fire with the data already processed.
  +
;<tt>''number'' |4''singular'':''plural'';</tt> -or- <tt>''number'' |4''singular'':''plural1'':''plural2'';</tt>: Will choose a form based on the ''number'' preceding it. Client locale dependant. More than two forms (separated by colons) may be required by some locales (i.e. Russian requires 3 forms), if too many forms provided they are ignored, if needed form isn't provided empty string will be used instead. Note that unlike |1 singular and plural forms are separated by colon. (added with 2.4.2)
  +
  +
=== Textures ===
  +
;<tt>|T''TexturePath'':''<span style="color:#80ff80;">size1</span>'':''<span style="color:#8080ff;">size2</span>'':''<span style="color:#ff8080;">xoffset</span>'':''<span style="color:#ff8080;">yoffset</span>''|t</tt>
  +
  +
;<tt>|T''TexturePath'':''size1'':''size2'':''xoffset'':''yoffset'':''dimx'':''dimy'':''coordx1'':''coordx2'':''coordy1'':''coordy2''|t</tt>
  +
: Will insert a texture into a font string. Parameter <tt>'''<span style="color:#8080ff;">size2</span>'''</tt> is optional (see below). The offsets are optional and will shift the texture from where it would normally be placed. <tt>'''''<span style="color:#ffff80;">TextHeight</span>'''''</tt> is based on size of the font used - this is used to automatically scale icons based on the size of the text.
  +
:*<tt>'''<span style="color:#80ff80;">size1</span>''' == 0; '''<span style="color:#8080ff;">size2</span>''' omitted: '''Width''' = '''Height''' = '''''<span style="color:#ffff80;">TextHeight</span>'''''</tt> (always square!)
  +
:*<tt>'''<span style="color:#80ff80;">size1</span>''' > 0; &nbsp;'''<span style="color:#8080ff;">size2</span>''' omitted: '''Width''' = '''Height''' = <span style="color:#80ff80;">size1</span></tt> (always square!)
  +
:*<tt>'''<span style="color:#80ff80;">size1</span>''' == 0; '''<span style="color:#8080ff;">size2</span>''' == 0&nbsp; &nbsp;: '''Width''' = '''Height''' = '''''<span style="color:#ffff80;">TextHeight</span>'''''</tt> (always square!)
  +
:*<tt>'''<span style="color:#80ff80;">size1</span>''' > 0; &nbsp;'''<span style="color:#8080ff;">size2</span>''' == 0&nbsp; &nbsp;: '''Width''' = '''''<span style="color:#ffff80;">TextHeight</span>'''''; '''Height''' = <span style="color:#80ff80;">size1</span></tt> (size1 is height!!!)
  +
:*<tt>'''<span style="color:#80ff80;">size1</span>''' == 0; '''<span style="color:#8080ff;">size2</span>''' > 0 &nbsp; &nbsp;: '''Width''' = <span style="color:#8080ff;">size2</span> * '''''<span style="color:#ffff80;">TextHeight</span>'''''; '''Height''' = '''''<span style="color:#ffff80;">TextHeight</span>'''''</tt> (size2 is an aspect ratio and defines width!!!)
  +
:*<tt>'''<span style="color:#80ff80;">size1</span>''' > 0; &nbsp;'''<span style="color:#8080ff;">size2</span>''' > 0 &nbsp; &nbsp;: '''Width''' = <span style="color:#80ff80;">size1</span>; '''Height''' = <span style="color:#8080ff;">size2</span></tt>
  +
:*<tt>'''dimx dimy''':</tt> Size of the source image, in pixels
  +
:*<tt>'''coordx1 coordx2 coordy1 coordy2''':</tt> Number of pixels to crop the texture by from each edge
  +
:''Notes:''
  +
:* When you need to display square icon in the string (spell/item icon), use only <tt>|T''TexturePath'':''<span style="color:#80ff80;">0</span>''|t</tt>
  +
:* When you need to display rectangular image in the string (Blizzard logo), use aspect ratio version: <tt>|T''TexturePath'':''<span style="color:#80ff80;">0</span>'':''<span style="color:#8080ff;">aspectRatio</span>''|t</tt>
  +
:* ''To prevent potential abuse, raw texture links cannot be sent to other players.''<ref name="Blue: Embedded textures">http://forums.worldofwarcraft.com/thread.html?topicId=2968233433&postId=44930053081&sid=1#293 Embedded Textures in FontStrings</ref>
  +
  +
;<tt>{''tag''}</tt>: This markup offers the only way to send textures to other players. There is however a limited set of parsed values. Currently you can only send [[Raid target icons]] using texture tags:
  +
:* {star}, {rt1} - [[Image:IconSmall RaidStar.png]]
  +
:* {circle}, {rt2} - [[Image:IconSmall RaidCircle.png]]
  +
:* {diamond}, {rt3} - [[Image:IconSmall RaidDiamond.png]]
  +
:* {triangle}, {rt4} - [[Image:IconSmall RaidTriangle.png]]
  +
:* {moon}, {rt5} - [[Image:IconSmall RaidMoon.png]]
  +
:* {square}, {rt6} - [[Image:IconSmall RaidSquare.png]]
  +
:* {cross}, {rt7} - [[Image:IconSmall RaidCross.png]]
  +
:* {skull}, {rt8} - [[Image:IconSmall RaidSkull.png]]
  +
: Note that the named raid target markup (star, circle, diamond, etc.) is localized, so {star} for example will not be replaced by the star texture on a german client, but {rtX}-style markup works on all clients.
  +
  +
=== Other ===
  +
;<tt>|K[gsf][0-9]+|k[0]+|k</tt>: New in 4.0 - Represents a Battle.net friend's name. The 3rd character indicates '''g'''iven name, '''s'''urname, or '''f'''ull name. The number which follows it represents the friend's Bnet Presence ID. The zeros between the |k form a string of the same length as the name which will replace it. E.g. if your first name is John and your presence id is 30, your given name (John) would be represented by the string <tt>|Kg30|k0000|k</tt> .
  +
  +
;<tt>|n</tt>: Newline, if the widget supports it.
  +
  +
;<tt>||</tt>: Output "|" regardless of if whatever follows it looks like a valid escape.
  +
  +
;<tt>|</tt>: A "|" followed by something that is not a valid escape sequence will be displayed as-is.
  +
  +
==Examples==
  +
{| class="darktable"
  +
! Sequence !! Result
  +
|-
  +
| <nowiki>|cFFFF0000This is red text |rthis is normal color</nowiki>
  +
| <font color=red>This is red text</font> this is normal color
  +
|-
  +
| <nowiki>|TInterface\\Icons\\INV_Misc_Coin_01:16|t Coins</nowiki>
  +
| [[Image:INV_Misc_Coin_01.png|16px]] Coins
  +
|-
  +
| <nowiki>|TInterface\\...:16:16:0:0:64:64:4:60:4:60|t Coins</nowiki>
  +
| [[Image:INV_Misc_Coin_01_(Cropped).png|16px]] Coins (Cropped 56x56)
 
|}
  +
  +
==Gotchas==
  +
If you are using an in-game text editor, it is not wholly unlikely that the editor is trying to being "helpful" by replacing "|" with "||" for you without you seeing it. If you are trying to use escape sequences and just keep getting pipe chars, that's why. Try using <tt>"\124"</tt> instead of <tt>"|"</tt>. 124 is the ascii code escape for the pipe character, and will work regardless of what your editor is trying to do.
  +
  +
== References ==
  +
{{Reflist}}

Revision as of 14:04, 29 October 2010

Many UI elements that display text on the screen support a special escape sequences starting with the pipe character (|).

Supported Escape Sequences

Coloring

|cAARRGGBB
Sets text color. Text following this escape sequence will be drawn in this color. Each pair of digits represents a color value (plus the alpha value, however the alpha value is currently ignored and should always be FF) as a hexadecimal number.
  • |cFFFF0000 - Red text
  • |cFF00FF00 - Green text
  • |cFF0000FF - Blue text
  • |cFFFFFF00 - Yellow text
|r
Ends the current color change. The color will return to the previously set color (e.g. |cFFFF0000Red |cFF00FF00green|r and back to red.|r).

Links

|Hlinktype:linkstring|hLinktext|h
for hyperlinks: when linktext is clicked, a widget handler is invoked.
|Hitem:ItemString|hLinktext|h
for Item Links (ItemString must be the full ItemString, ie. d:d:d:d:d:d:d:d style)
|Henchant:EnchantID|hLinktext|h
for Enchant links
|Hplayer:Name:ChatID|hLinktext|h
for Player links (Click to whisper, CTRL-click to select and shift-click to do a /who Name. ChatID here refers to spam reporting
|HBNplayer:??|h
Placeholder
|Hunit:GUID|h:Name|h
for Unit links (Left-click opens the ItemRefTooltip frame, similar as with the Blizzard CombatLog and API_SetItemRef)
  • GUID = API_UnitGUID; It accepts both with or without the hex prefix "0x".
  • Name = API_UnitName; You can change "Name" to anything you want without breaking the link.
  • Right-clicking will return an error, "because it will try to call Blizzard_CombatLog_CreateUnitMenu() and unitName is not given to it, so displayName == nil".
|Hquest:QuestID:QuestLevel|hLinktext|h
for Quest links.
|Hspell:SpellID
for spell links.
|Htalent:TooltipID:Points
for talent links.
  • TooltipID seems to be a global talent id, not quite sure how it's encoded or stored.
  • Points is how many points you've spent in that talent, zero based (3 points in it means '2') and -1 for no points.
|Htrade:TradeSpellID:CurrentLevel:MaxLevel:PlayerID:Recipes|hLinktext|h
for Trade links. Note that the TradeSpellID corresponds to the spell id from the spell found in the spellbook (e.g. "Cooking" has id 33359). See also TradeSkillLink.
  • CurrentLevel: the current level of the player in the given trade-skill
  • MaxLevel: the highest currently achievable skill (an apprentice will have 75 as max level, a grand master 450)
  • PlayerID: API_UnitGUID of the player, stripped of all the leading zeroes (unlike GUID for Achievement below where the leading zeroes are included).
  • Recipes: Base64-encoded list of learned recipes.
|Hachievement:AchievementID:GUID:Completed:Month:Day:Year:Unknown1:Unknown2:Unknown3:Unknown4|hLinktext|h
for achievement links.
  • GUID is the API_UnitGUID of the player, without the starting '0x'.
  • Completed is 0 for uncompleted achievements and 1 for completed.
  • Month/Day/Year is the date the achievement was completed or 0 if not completed. Year is -1 if not completed.
  • Unknown1-4 are unknown fields. They're often 0 for non-completed achievements.
|Hinstancelock:guid:mapID:difficulty:defeatedEncounters|hName|h
Instance lock links
  • GUID: Unit GUID of the player
  • Map ID: self explainatory - 650 for ToCh, 649 for ToCr ETC.
  • Difficulty: Difficulty id of the instance lock (heroic/nonheroic, 10/25)
  • Defeated Encounters: Bitfield indicating the encounters that have been defeated. E.g. 7 means that the first 3 encounters have been done but the subsequent ones have not.

Grammar

number |1singular;plural;
Will choose a word depending on whether the digit preceding it is 0/1 or not (i.e. 1,11,21 return the first string, as will 0,10,40). Note that unlike |4 singular and plural forms are separated by semi-colon.
|2text
Before vowels outputs d' (with apostrophe) and removes any leading spaces from text, otherwise outputs de (with trailing space)
|3-formid(text)
Displays text declined to the specified form (index ranges from 1 to GetNumDeclensionSets()). Processed by C code, data used for parsing isn't available to UI, all events fire with the data already processed.
number |4singular:plural; -or- number |4singular:plural1:plural2;
Will choose a form based on the number preceding it. Client locale dependant. More than two forms (separated by colons) may be required by some locales (i.e. Russian requires 3 forms), if too many forms provided they are ignored, if needed form isn't provided empty string will be used instead. Note that unlike |1 singular and plural forms are separated by colon. (added with 2.4.2)

Textures

|TTexturePath:size1:size2:xoffset:yoffset|t
|TTexturePath:size1:size2:xoffset:yoffset:dimx:dimy:coordx1:coordx2:coordy1:coordy2|t
Will insert a texture into a font string. Parameter size2 is optional (see below). The offsets are optional and will shift the texture from where it would normally be placed. TextHeight is based on size of the font used - this is used to automatically scale icons based on the size of the text.
  • size1 == 0; size2 omitted: Width = Height = TextHeight (always square!)
  • size1 > 0;  size2 omitted: Width = Height = size1 (always square!)
  • size1 == 0; size2 == 0   : Width = Height = TextHeight (always square!)
  • size1 > 0;  size2 == 0   : Width = TextHeight; Height = size1 (size1 is height!!!)
  • size1 == 0; size2 > 0    : Width = size2 * TextHeight; Height = TextHeight (size2 is an aspect ratio and defines width!!!)
  • size1 > 0;  size2 > 0    : Width = size1; Height = size2
  • dimx dimy: Size of the source image, in pixels
  • coordx1 coordx2 coordy1 coordy2: Number of pixels to crop the texture by from each edge
Notes:
  • When you need to display square icon in the string (spell/item icon), use only |TTexturePath:0|t
  • When you need to display rectangular image in the string (Blizzard logo), use aspect ratio version: |TTexturePath:0:aspectRatio|t
  • To prevent potential abuse, raw texture links cannot be sent to other players.[1]
{tag}
This markup offers the only way to send textures to other players. There is however a limited set of parsed values. Currently you can only send Raid target icons using texture tags:
  • {star}, {rt1} - IconSmall RaidStar
  • {circle}, {rt2} - IconSmall RaidCircle
  • {diamond}, {rt3} - IconSmall RaidDiamond
  • {triangle}, {rt4} - IconSmall RaidTriangle
  • {moon}, {rt5} - IconSmall RaidMoon
  • {square}, {rt6} - IconSmall RaidSquare
  • {cross}, {rt7} - IconSmall RaidCross
  • {skull}, {rt8} - IconSmall RaidSkull
Note that the named raid target markup (star, circle, diamond, etc.) is localized, so {star} for example will not be replaced by the star texture on a german client, but {rtX}-style markup works on all clients.

Other

|K[gsf][0-9]+|k[0]+|k
New in 4.0 - Represents a Battle.net friend's name. The 3rd character indicates given name, surname, or full name. The number which follows it represents the friend's Bnet Presence ID. The zeros between the |k form a string of the same length as the name which will replace it. E.g. if your first name is John and your presence id is 30, your given name (John) would be represented by the string |Kg30|k0000|k .
|n
Newline, if the widget supports it.
||
Output "|" regardless of if whatever follows it looks like a valid escape.
|
A "|" followed by something that is not a valid escape sequence will be displayed as-is.

Examples

Sequence Result
|cFFFF0000This is red text |rthis is normal color This is red text this is normal color
|TInterface\\Icons\\INV_Misc_Coin_01:16|t Coins INV Misc Coin 01 Coins
|TInterface\\...:16:16:0:0:64:64:4:60:4:60|t Coins File:INV Misc Coin 01 (Cropped).png Coins (Cropped 56x56)

Gotchas

If you are using an in-game text editor, it is not wholly unlikely that the editor is trying to being "helpful" by replacing "|" with "||" for you without you seeing it. If you are trying to use escape sequences and just keep getting pipe chars, that's why. Try using "\124" instead of "|". 124 is the ascii code escape for the pipe character, and will work regardless of what your editor is trying to do.

References