Thread Tools Display Modes
03/10/21, 06:26 AM   #1
Aaxc
 
Aaxc's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2019
Posts: 19
Trouble reading LibMapsPings

Hey,
I have set up a short mapPing event:

local LMP = LibMapPing

function CombatCallbacks(...)
if (...) then
LMP:SetMapPing(MAP_PIN_TYPE_PING, MAP_TYPE_LOCATION_CENTERED, 50, 50)
end
end
I have also registered the events:

function PingAdded(pingType, pingTag, offsetX, offsetY, isLocalPlayerOwner)
d(pingType)
d(pingTag)
d(offsetX)
d(offsetY)
d(isLocalPlayerOwner)
end

EVENT_MANAGER:RegisterForEvent(AddonName, EVENT_COMBAT_EVENT, CombatCallbacks)
-- EVENT_MANAGER:RegisterForEvent(AddonName, EVENT_MAP_PING, PingAdded) -- Does not trigger
LMP:RegisterCallback("AfterPingAdded", PingAdded)

Now, the event does trigger if I'm the one initializing it, but how do I read this from another account? As a group member of course.

Last edited by Aaxc : 03/10/21 at 07:41 AM.
  Reply With Quote
03/11/21, 12:21 PM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
I think you are looking for this library then:
https://www.esoui.com/downloads/info...oupSocket.html

LibMapPing is different and not only for group communication.

The lib provides it's own callbacks in order to react on map pings.

See the description of the library:
https://www.esoui.com/downloads/info...ibMapPing.html

RegisterCallback
Register to callbacks from the library.
Valid events are BeforePingAdded, AfterPingAdded, BeforePingRemoved and AfterPingRemoved.
These are fired at certain points during handling EVENT_MAP_PING.
Code:
lib:RegisterCallback(string eventName, function callback)

UnregisterCallback
Unregister from callbacks. See lib:RegisterCallback.
Code:
lib:UnregisterCallback(string eventName, function callback)

And you can use GetMapPing to get info about the pig, or any of the other api functions provided
Wrapper for the different get ping functions. Returns coordinates regardless of their suppression state.
The game API functions return 0, 0 when the ping type is suppressed.
pingType is the same as for SetMapPing.
pingTag is optionally used if another group member's MAP_PIN_TYPE_PING should be returned (possible values: group1 .. group24).

Last edited by Baertram : 03/11/21 at 12:27 PM.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Trouble reading LibMapsPings

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