Is there Event for jump request?
When you accept invite to group there is request to jump to leader of the group. Is where Event for that request and function to decline it? I'd like to auto decline.
Didn't find anything like that in here https://wiki.esoui.com/Events |
Nope there isn't you'need to check the esoui source code for groups, find the invitation stuff and check how the code shows the jump to leader stuff, then try to find a "hook point" where you could auto decline it.
Should be maybe somewhere around here: https://github.com/esoui/esoui/tree/...i/ingame/group Or search for "jump" in the sources, like this: https://github.com/esoui/esoui/searc...nscoped_q=jump You'll find the function here https://github.com/esoui/esoui/blob/...hared.lua#L108 JumpToGroupLeader Then search where it is used and try to find the space where "your popup" occurs. Maybr it's not at the lua side of code and you cannot intercept or hook nor find it... |
Quote:
https://github.com/esoui/esoui/blob/...ertoplayer.lua 743 line I'm new to lua and plugins. Could you explain how to hook a function? I have to create local variable that contains the function, right? And then override original function? |
You can't as the function is local!
local function OnTravelToLeaderPromptReceived() And the local function OnGroupMemberJoined() as well in line 790 And overwriting wouldn't be good at all. You could use ZO_PreHook or ZO_PostHook/SecurePostHook (chekc the wiki for them), but this is also not possible here. So you cannot overwrite it properly and if you would do it you'd most probabyl kill other addons and ZOs vanilla UI :rolleyes: The real call to the popup is done in line 758 btw. https://github.com/esoui/esoui/blob/...layer.lua#L758 But it queues the prompt so if you hook or try to hook here you most probably will kill the queue of all popups. So unfortunately: No chance afai can see |
Quote:
Code:
local function DeclineCallback() How do you think, can I do smth like that... Register EVENT_GROUP_MEMBER_JOINED Set callback that waits for example 100 ms (because it says in comments (line 737) that "-- The location of the group leader may not be available immediately", so prompt doesn't appear immediately too. And then call ZO_PlayerToPlayer:RemoveFromIncomingQueue(INTERACT_TYPE_TRAVEL_TO_LEADER)? |
There are actually several ways to achieve that, but the most simple one is:
Lua Code:
I commented ZO_PreHook, because it will produce lua error, since zos code doesn't check if the prompt was added and will just try to access nil value. Also INTERACT_TYPE_TRAVEL_TO_LEADER = 19 is a local variable, so have to use a raw value... But it does its job :D |
I would like to mention that this will block ALL of the "jump to leader" popups, and not only if you are joining a group.
Not sure if it happens at other spots as well though. If you only want it to happen after you have joined a group you could use the EVENT_GROUP_MEMBER_JOINED, then chck if YOU have joined (via the name e.g.), or use event filters to filter on the unitag "player" (if the group join event uses that), and set a local addon variable = true. Inside the PreHook / overwritten function check if the variable is true and only then block the port to group leader request. Don't forget to set the variable = false again. |
Quote:
I didn't understand how to use prehook and EVENT_GROUP_MEMBER_JOINED at the same time. If I prehook something it would stay that way? So for now I did it like this. Have to test though. Lua Code:
Quote:
|
Quote:
Then it needs to be reapllied by your addon's code, what the addon will automatically do once you have defined it to apply the PreHook in e.g. event_add_on_loaded. Quote:
Lua Code:
In your callback function for the event group member joined set it to groupMemberJoinedFlag = true then. > And remove all your other code there if you want to use Andy.s' code! Lua Code:
And in the code that andy.s gave you can use the var like this then: Lua Code:
btw: ZO_PlayerToPlayer won't work! It's the "kind of" class you try to use there, not the created object from that class. The created object will be something like VARIABLE_NAME = ZO_PlayerToPlayer:New() and is either defined in the XML files or in the lua files, most time near the bottom. I think it's PLAYER_TO_PLAYER or similar and not ZO_PlayerToPlayer https://github.com/esoui/esoui/blob/...ayer.lua#L1927 |
Quote:
The actual object is PLAYER_TO_PLAYER |
All times are GMT -6. The time now is 09:21 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI