ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Trouble reading LibMapsPings (https://www.esoui.com/forums/showthread.php?t=9618)

Aaxc 03/10/21 06:26 AM

Trouble reading LibMapsPings
 
Hey,
I have set up a short mapPing event:

Quote:

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:

Quote:

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.

Baertram 03/11/21 12:21 PM

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).


All times are GMT -6. The time now is 10:05 AM.

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