Thread Tools Display Modes
07/14/21, 06:10 PM   #1
Vaddi
Join Date: Jun 2016
Posts: 14
Player Interaction Hook

FISHING_MANAGER.StartInteraction can be used to hook into environment interactions (by default the interactions that begin with the E key). Is there a similar thing to hook into player interactions? These interactions begin with the F key (again the default).

Vaddi
  Reply With Quote
07/15/21, 02:23 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
Could be this one:
https://github.com/esoui/esoui/blob/...ayer.lua#L1981

PLAYER_TO_PLAYER is the global and the function would e.g. be:
https://github.com/esoui/esoui/blob/...ayer.lua#L1850

ShowPlayerInteractMenu(isIgnored)
To get the target's character and displayname you can use:
Lua Code:
  1. local currentTargetCharacterName = self.currentTargetCharacterName
  2.         local currentTargetCharacterNameRaw = self.currentTargetCharacterNameRaw
  3.         local currentTargetDisplayName = self.currentTargetDisplayName
where self is PLAYER_TO_PLAYER


But PLEASE: Do NOT override this function but just use a ZO_PreHook or SecurePostHook (called after original code then) instead.
If you want to suppress the menu to show a ZO_PreHook could be used, do your checks and if the menu should not be shown return true then so the original func won't be called anymore.

Last edited by Baertram : 07/15/21 at 02:29 AM.
  Reply With Quote
07/23/21, 08:07 PM   #3
Vaddi
Join Date: Jun 2016
Posts: 14
Yikes! I thought I replied to this a week ago. I guess I didn't hit the send button.

Baertram, thanks so much for your response. I ended up using a simpler solution that didn't require this hook. But I learned a lot from this.

Thanks again.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Player Interaction Hook

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