ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   AddOn Help/Support (https://www.esoui.com/forums/forumdisplay.php?f=164)
-   -   Get character name from whisper (https://www.esoui.com/forums/showthread.php?t=9828)

maximoz 07/09/21 06:46 AM

Get character name from whisper
 
Hi,

Is there a way to find out the character name for someone who whisper me? So far the EVENT_CHAT_MESSAGE_CHANNEL returns both @account name for the fromName and fromDisplayName even tho the wiki states fromName is suppose to be character name?

https://wiki.esoui.com/EVENT_CHAT_MESSAGE_CHANNEL

Thanks!

Shadowfen 07/09/21 10:26 AM

Not really. The only way to get the character name from a whisper is if the whisperer is in a group or a guild with you. You can use the group or guild to find out the character name from the account name.

M0R 07/09/21 11:10 AM

If you wish to display it to the user, I believe you can pipe the @ name into ZO_LinkHandler_CreatePlayerLink and that will create a link to the player, which you then may be able to retrieve character name from? either that or maybe zo_strformat("<<1>>", player)

I have no idea if this works, this is just how I saw Kill counter do it, but they are calling from an event, so idk

Baertram 07/09/21 11:39 AM

zo_strformat("<<1>>", player) is just removing any special gender suffix ^f e.g. at the end of the character name.
And I guess the ZO_LinkHandler will just use the @displayName in the link and if you click it use the @displayName as well.
As you can see here:
https://github.com/esoui/esoui/blob/...ndler.lua#L100

Lua Code:
  1. function ZO_LinkHandler_CreatePlayerLink(displayOrCharacterName)
  2.     if(IsDecoratedDisplayName(displayOrCharacterName)) then
  3.         return ZO_LinkHandler_CreateDisplayNameLink(displayOrCharacterName)
  4.     else
  5.         return ZO_LinkHandler_CreateCharacterLink(displayOrCharacterName)
  6.     end
  7. end
It would be using ZO_LinkHandler_CreateDisplayNameLink then as the @ is given in the name.

Afai found out Shadowfen is completely correct here.
You would need any kind of "lookup" tables which are given if you are in the same group/guild.
Else you'd have to build and safe your own lookup tables for the server and enhance it each time someone writs with a charactername in chat.
And I would not recommand doing/building such a big table. It will grow your SavedVariables and make every loading screen slow after a short time already, as the filesize would grow constantly and would need a transfer to file/read from file on each reloadui/zone change/login/logout.

maximoz 07/09/21 10:10 PM

Thnak you all for the insight.

Much appreciated!


All times are GMT -6. The time now is 04:10 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI