View Single Post
08/04/21, 02:45 PM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,991
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
You can search the esoui sources for that constant then:
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
ANCE_PROMPT or SI_JUMP_TO_GROUP_LEADER_WORLD_PROMPT)

lines 785ff shows where this local function is used:

Lua Code:
  1. local function OnUnitCreated(unitTag)
  2.         if ZO_Group_IsGroupUnitTag(unitTag) then
  3.             OnTravelToLeaderPromptReceived()
  4.         end
  5.     end
  6.         local function OnZoneUpdate(unitTag, newZone)
  7.         if ZO_Group_IsGroupUnitTag(unitTag) then
  8.             OnTravelToLeaderPromptReceived()
  9.         end
  10.     end
  11.     local function OnGroupMemberJoined(characterName, displayName, isLocalPlayer)
  12.         if isLocalPlayer then
  13.             local groupLeaderUnitTag = GetGroupLeaderUnitTag()
  14.             if not AreUnitsEqual(groupLeaderUnitTag, "player") then
  15.                 pendingJumpToGroupLeaderPrompt = true
  16.                 OnTravelToLeaderPromptReceived()
  17.             end
  18.         end
  19.     end
  20.     local function OnPlayerActivateOrLeaderUpdate()
  21.         if pendingJumpToGroupLeaderPrompt then
  22.             OnTravelToLeaderPromptReceived()
  23.         end
  24.     end

As the funcs are local you cannot hack into them directly

But they are registered as event callbacks:
Lua Code:
  1. self.control:RegisterForEvent(EVENT_UNIT_CREATED, function(event, ...) OnUnitCreated(...) end)
  2.     self.control:RegisterForEvent(EVENT_ZONE_UPDATE, function(event, ...) OnZoneUpdate(...) end)
  3.     self.control:RegisterForEvent(EVENT_GROUP_MEMBER_JOINED, function(event, ...) OnGroupMemberJoined(...) end)
  4.     self.control:RegisterForEvent(EVENT_LEADER_UPDATE, function(event, ...) OnGroupMemberJoined(...) end)
  5.     self.control:RegisterForEvent(EVENT_GROUP_MEMBER_LEFT, function(event, ...) OnGroupMemberLeft(...) end)

self = ZO_PlayerToPlayer -> object created is PLAYER_TO_PLAYER in func
Lua Code:
  1. function ZO_PlayerToPlayer_Initialize(control)
  2.     PLAYER_TO_PLAYER = ZO_PlayerToPlayer:New(control)
  3. end

Try the following in chat as script:
Code:
/script PLAYER_TO_PLAYER.control:UnregisterForEvent(EVENT_GROUP_MEMBER_JOINED)
Or try one of the others like EVENT_UNIT_CREATED

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:
  1. function ZO_PlayerToPlayer:AddPromptToIncomingQueue(interactType, characterName, displayName, targetLabel, acceptCallback, declineCallback, deferDecisionCallback)

Just add something like

Lua Code:
  1. ZO_PreHook(PLAYER_TO_PLAYER, "AddPromptToIncomingQueue", function(interactType, characterName, displayName, targetLabel, acceptCallback, declineCallback, deferDecisionCallback)
  2.  if interactType == INTERACT_TYPE_TRAVEL_TO_LEADER then return true end
  3. --return true will exit here adn NOT call the original code after that
  4. end)

Last edited by Baertram : 08/04/21 at 02:53 PM.
  Reply With Quote