Getting rid of a popup (zone instance)
Hello everyone,
First off, thanks for all your work in documenting the ESO Lua system. I used it a great deal in making up our Addons. :) But, I have a problem that has me stumped. I made a group invite addon for our family. It works well, it makes up a group of our currently logged in characters, removes ones that have logged out and that sort of thing. But, if I invite a character that is in the same zone but a different instance, I get a message that says: Code:
I have "IsGroupMemberInSameInstanceAsPlayer(inviterAccount)", which detects the issue properly, but I can't seem to get rid of the popup itself. It also doesn't time-out and go away. It's probably something obvious, but I just don't see it :o |
The text can be found in the ingamelocalization/localizegeneratestrings.lua files -> constant is :SI_JUMP_TO_GROUP_LEADER_OCCURANCE_PROMPT
Code:
"This group's leader is located in a different version of |cffffff<<1>>|r.\n\nWould you like to travel to their version, which will place you at the wayshrine nearest to them?", -- SI_JUMP_TO_GROUP_LEADER_OCCURANCE_PROMPT SI_JUMP_TO_GROUP_LEADER_OCCURANCE_PROMPT -> playertoplayer.lua, local function OnTravelToLeaderPromptReceived() lines 767 ff Code:
promptData.messageFormat = GetString(GetUnitZone("player") == groupLeaderZoneName and SI_JUMP_TO_GROUP_LEADER_OCCUR lines 785ff shows where this local function is used: Lua Code:
As the funcs are local you cannot hack into them directly But they are registered as event callbacks: Lua Code:
self = ZO_PlayerToPlayer -> object created is PLAYER_TO_PLAYER in func Lua Code:
Try the following in chat as script: Code:
/script PLAYER_TO_PLAYER.control:UnregisterForEvent(EVENT_GROUP_MEMBER_JOINED) But beware: This might damage the grouping tools and other addons! Another approach would be to prehook the function self:AddPromptToIncomingQueue which is used in OnTravelToLeaderPromptReceived() self = PLAYER_TO_PLAYER again The function starts in line 1075 Lua Code:
Just add something like Lua Code:
|
Could try to prehook AddPromptToIncomingQueue and cancel the call when the interact type is INTERACT_TYPE_TRAVEL_TO_LEADER:
Lua Code:
|
Oh siri found the same as I was editing my message :p
|
Thanks!
Thanks soooo much -- I will definitely try all this out. And thanks for the explanation of where/how to find it, as well as how quickly you posted all that :)
|
Just an update on this.
The following code did not fix the issue. It was called, as expected. It returned true, as it should. But it did not suppress or cancel the prompt popup. Code:
ZO_PreHook(PLAYER_TO_PLAYER, "AddPromptToIncomingQueue", function(interactType, characterName, displayName, targetLabel, acceptCallback, declineCallback, deferDecisionCallback) I also tried the suggestion to use: Code:
/script PLAYER_TO_PLAYER.control:UnregisterForEvent(EVENT_GROUP_MEMBER_JOINED) I assume that I just won't have the option to teleport to the leader from now on, and that is fine. Anyway, thanks again for the help. I never would have gotten to this on my own. :) |
Try to change the function code to this, like siri wrote (first param = self). Could be that my exmaple would not work properly as my first param was the interactType but it actually fileld with the values of "self" instead and thus the check on interactType == INTERACT_TYPE_TRAVEL_TO_LEADER was actually if self == INTERACT_TYPE_TRAVEL_TO_LEADER and thus never was met.
Code:
ZO_PreHook(PLAYER_TO_PLAYER, "AddPromptToIncomingQueue", function(self, interactType) Lua Code:
So if the first code example above did not work you can try this: Code:
ZO_PreHook(PLAYER_TO_PLAYER, "AddPromptToIncomingQueue", function(self, interactType) |
All times are GMT -6. The time now is 07:59 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI