Thread Tools Display Modes
Prev Previous Post   Next Post Next
07/06/21, 09:28 PM   #1
taugrim
AddOn Author - Click to view addons
Join Date: Jul 2020
Posts: 4
How to get a PreHook or PostHook to work?

So I have a simple problem I'd like to solve.

When in Battlegrounds, I'd like the scoreboard to show both the account name and the character name, not just one or the other.

So a player would show up in the scoreboard as:
@someplayer (Some Character)

The battleground LUA code (https://esoapi.uesp.net/100035/src/i...board.lua.html) contains the following:
Code:
function Battleground_Scoreboard_Player_Row:UpdateRow()
    local data = self.data
    local primaryName = ZO_GetPrimaryPlayerName(data.displayName, data.characterName)
    local formattedName = zo_strformat(SI_PLAYER_NAME, primaryName)
That ZO_GetPrimaryPlayerName returns either the account name or the character name. That function is used in a lot of places, so I don't want to hook that.

If I wanted to just hook the Battleground_Scoreboard_Player_Row:UpdateRow function so that I could replace the call to ZO_GetPrimaryPlayerName with my own function, how do I do that?

Specifically, what I'm unclear on is in my function that is called, how do I have access to the data that the real Battleground_Scoreboard_Player_Row:UpdateRow function has? Because my function would replace that call to ZO_GetPrimaryPlayerName with my own code.

I hope this makes sense. This is opaque as there isn't much documentation.

Thanks.
  Reply With Quote
 

ESOUI » Developer Discussions » General Authoring Discussion » How to get a PreHook or PostHook to work?


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