Bull3t8140@legacy41529357 (talk | contribs) No edit summary |
m (trim bullet points) Tag: WoW API docs |
||
(19 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{wowapi}} |
||
− | Get the name of the title used by the player. |
||
+ | Returns the name of a player title. |
||
⚫ | |||
⚫ | |||
− | titleName = GetTitleName(titleId) |
||
+ | :;[[TitleId|titleId]]:{{apitype|number}} - Ranging from 1 to {{api|GetNumTitles}}. Not necessarily an index as there can be missing/skipped IDs in between. |
||
− | == Parameters == |
||
⚫ | |||
− | :(titleId) |
||
⚫ | |||
− | :;titleId : Number - The number of the title currently select by the player. |
||
⚫ | |||
⚫ | |||
+ | :;playerTitle:{{apitype|boolean}} - Seems to be true for all existing titles. |
||
− | :name |
||
+ | ==Details== |
||
⚫ | |||
+ | * If the name has a trailing space, then the title is prefixed, otherwise it's suffixed. |
||
− | == Example == |
||
+ | <syntaxhighlight lang="lua"> |
||
− | <!-- begin code --> |
||
+ | /dump GetTitleName(2) -- "Corporal " → "Corporal Bob" (prefix) |
||
− | local titleId = GetCurrentTitle(); |
||
+ | /dump GetTitleName(36) -- "Champion of the Naaru" → "Alice, Champion of the Naaru" (suffix) |
||
⚫ | |||
+ | </syntaxhighlight> |
||
− | <!-- end code --> |
||
− | __NOTOC__ |
||
− | == |
+ | ==Patch changes== |
+ | {{Patch 2.0.1|note=Added.}} |
||
− | Supported starting in build 20000 |
||
+ | |||
+ | ==See also== |
||
+ | * {{api|GetCurrentTitle}} |
||
+ | * {{api|IsTitleKnown}} |
Latest revision as of 06:07, 1 August 2022
Automated updating of API pages at this location, to reflect patch changes, has ceased from 10.1.7 onwards. |
Returns the name of a player title.
name, playerTitle = GetTitleName(titleId)
Arguments
- titleId
- number - Ranging from 1 to GetNumTitles. Not necessarily an index as there can be missing/skipped IDs in between.
Returns
- name
- string - Name of the title.
- playerTitle
- boolean - Seems to be true for all existing titles.
Details
- If the name has a trailing space, then the title is prefixed, otherwise it's suffixed.
/dump GetTitleName(2) -- "Corporal " → "Corporal Bob" (prefix)
/dump GetTitleName(36) -- "Champion of the Naaru" → "Alice, Champion of the Naaru" (suffix)
Patch changes
Patch 2.0.1 (2006-12-05): Added.