Compass Events
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? |
Quote:
|
Would you be kind enough to show me in simple code sample?
Do I make an <OnUpdate> function and poll the GUI for what's actively displayed? |
Quote:
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:
Lua Code:
|
Quote:
and call that function via registration EVENT_MANAGER:RegisterForUpdate("OnUpdateSomethingYouMade", [number in miliseconds how often to call your function], [your function name]) |
Quote:
|
Quote:
|
Hopefully I'll figure this out and I appreciate the help.
My final goal, which is incredible simple (not for me apparently ~laughs~), is to output text to a message box <Label> that a "Quest Giver is near," thus why I am looking to find all compass pins then somehow distinguish between MAP_PIN_TYPE_QUEST_OFFER and all_the_rest. Again, thank you for a starting point and I hope I'll get it some day. =) |
Lua Code:
What does ZO_CompassContainer return? My error is something about userdata. |
Quote:
Fyrakin wrote that you have to check its children controls, it means something like: Lua Code:
|
Lua Code:
So happy! Got this outputting what I want to get started. Thank you a million times for getting me on track. I'll try to keep the amateur questions to a minimum now that I have one foothold on this mountain. ha! Edit: just wish there was a function to gather all marker pins on the compass rather than just the markers the avatar is directly facing; something like ZO_CompassContainer:GetAllPinInfo() |
Quote:
|
Quote:
What I truly need is a method to try all these functions and controls within an basic/universal example program. I'm extremely frustrated because I believe I'm looking at how everything works completely backwards. Looking at http://wiki.esoui.com/Userdata_in_100007_API I can't figure out what they return (or contain). Are these all objects? If so, how do I look at them? Every function I use on them returns nil or an error (userdata). Edit: How about that. Getting output now of ZO_MapPin1 through 50. Now to figure out how to map the globals to what they really are. |
Quote:
http://wiki.esoui.com/Controls Working code: Lua Code:
|
Quote:
|
Quote:
|
1 Attachment(s)
Attachment 373
I have to resign attempting to accomplish what I want to do. There is no way, I know of, to capture pins on the compass unless I directly "faced" the pin (and even then I have to run a pretty heavy polling function). The pin does exists on the compass before "facing" it (picture shows it off to the right side) but it's far beyond me how to iterate through all pins on the compass. I kept banging my head against this problem solely because the fact that "if it's displayed on my compass it must be somewhere in the GUI elements." Anyways, I started writing a new addon, successfully! (lol), that tracks player coordinates and displays a "Road Sign" (just a ToolTip, actually) on [s]keyPress[/s] slash_cmd when the user enters a polygon. I check all vertices and notifications are sent to the user there's a Road Sign ahead if they are within the polygons boundaries. I still need to make the slash_cmd hotKeyed for the ToolTip/Road Sign. I have feeling my road_sign_tbl is going to be gigantic. =) |
Quote:
In /zgoo "GetChild(index)" for ZO_CompassContainer says it's BLACKLISTED. Does that mean it's private? |
Quote:
if there are ZO_CompassContainer:GetNumChildren() > 0 then you can do the following: Code:
local numChildren = ZO_CompassContainer:GetNumChildren() |
Lua Code:
Result: Code:
The number of children: 67 |
All times are GMT -6. The time now is 01:16 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI