ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Player Interaction Hook (https://www.esoui.com/forums/showthread.php?t=9837)

Vaddi 07/14/21 06:10 PM

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

Baertram 07/15/21 02:23 AM

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.

Vaddi 07/23/21 08:07 PM

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.


All times are GMT -6. The time now is 05:46 PM.

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