Thread: Compass Events
View Single Post
07/28/14, 01:56 PM   #6
Fyrakin
 
Fyrakin's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 129
Originally Posted by Garkin View Post
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
That would also work. Just don't forget to return false or compass will not update.
  Reply With Quote