Thread: Compass Events
View Single Post
07/28/14, 01:50 PM   #5
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by unLeashed3k View Post
Is there such a thing as compass events?

I've been desperately attempting to figure out a way to access the compass pins (quests, POI, anything and all) when they appear on the compass but I can not find an event to even begin writing my AddOn. Currently, the only thing I want to do is when a Pin becomes visible on the Compass I want to grab what the pin is (pinType perhaps?) and write it (the name) to the chat panel.

I thought this would be extremely simple being it would fire once (event?) but now several days in I'm just spinning in circles trying to put the puzzle together.

Is there any documentation on COMPASS.container or ZO_WorldMap_IsPinGroupShown? Or better yet is there an event fired when a pin shows on the compass?
There is no such event...

I was playing around with compass in my test addon Compass Distance (http://www.esoui.com/forums/showthread.php?p=9208).

I don't know if it is the best way, but have hooked OnUpdate function:
Lua Code:
  1. ZO_PreHookHandler(COMPASS.container, "OnUpdate",
  2.    function()
  3.       --do stuff
  4.    end)
And from there I'm calling:
Lua Code:
  1. for i = 1, COMPASS.container:GetNumCenterOveredPins() do
  2.    local description, pinType, distance, drawLayer, drawLevel, isSupressed = COMPASS.container:GetCenterOveredPinInfo(i)
  3.       if not isSupressed then
  4.          --do stuff
  5.       end
  6.    end
  7. end
  Reply With Quote