Thread Tools Display Modes
01/12/23, 09:03 PM   #1
Toirealach
AddOn Author - Click to view addons
Join Date: Sep 2020
Posts: 22
displayName from characterName?

Is there an API for me to take a characterName (raw or otherwise) that is passed to my function and get that character's display name from it to make a decorated display name?
  Reply With Quote
01/13/23, 02:13 AM   #2
Masteroshi430
 
Masteroshi430's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2020
Posts: 185
Originally Posted by Toirealach View Post
Is there an API for me to take a characterName (raw or otherwise) that is passed to my function and get that character's display name from it to make a decorated display name?
GetUnitDisplayName(*string* _unitTag_)
  Reply With Quote
01/13/23, 03:51 AM   #3
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,960
afaik there is no such API function to get that data without actually interacting with some player, or having at least the crosshair above the player.


Check some helper functions here:
https://github.com/esoui/esoui/blob/...yername.lua#L1

GetUnitDisplayName awaits as parameter a unittag which would be player, group1, group2, groupn, reticleover, boss1, boss2, bossn, etc.
If you are grouped you can use that one to get the displayname via the groupN tags, and check the group's charactername via GetUnitName(unitTag).

Maybe the functions will work too if you move the crosshair above the player you want to get the data from, and use it with
the unitTag "reticleover".
You can use an event to detect the change of a reticle target:
https://github.com/esoui/esoui/blob/...plete.lua#L146

Last edited by Baertram : 01/13/23 at 03:55 AM.
  Reply With Quote
01/13/23, 02:52 PM   #4
Toirealach
AddOn Author - Click to view addons
Join Date: Sep 2020
Posts: 22
Originally Posted by Baertram View Post
afaik there is no such API function to get that data without actually interacting with some player, or having at least the crosshair above the player.
Thanks! Yeah that's the conclusion I came to myself, but I thought I'd check.

I already put character names in a temp list which get converted to display names when you put the reticle over a toon. It works. It's just annoying.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » displayName from characterName?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off