Thread: Compass Events
View Single Post
07/28/14, 02:44 PM   #10
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by unLeashed3k View Post
Lua Code:
  1. YYZ = {}
  2.  
  3. YYZ.ModName = "ESOunLeashed"
  4.  
  5.  
  6.  
  7. function YYZ.doIt()
  8.     local str = ZO_CompassContainer
  9.     d(string.format("%s", str))
  10. end
  11.  
  12.  
  13. function YYZ.OnAddOnLoaded(event, str)
  14.     if str == YYZ.ModName then
  15.         EVENT_MANAGER:RegisterForUpdate(YYZ.ModName, 1000, YYZ.doIt)
  16.     end
  17. end
  18.  
  19.  
  20. EVENT_MANAGER:RegisterForEvent(YYZ.ModName, EVENT_ADD_ON_LOADED, YYZ.OnAddOnLoaded)

What does ZO_CompassContainer return? My error is something about userdata.
ZO_CompassContainer is not a function, its a control. So it does not return anything.

Fyrakin wrote that you have to check its children controls, it means something like:
Lua Code:
  1. for i = 1, ZO_CompassContainer:GetNumChildren() do
  2.    local control = ZO_CompassContainer:GetChild(i)
  3.    if control:GetName() == "whatever" then --I have no idea what is the name of compass pin, so...
  4.    end
  5. end

Last edited by Garkin : 07/28/14 at 02:50 PM.
  Reply With Quote