I've started work on a new library that allows icons to be placed on the world and mini maps. Yes, I know Astrolabe does this, but there are things I want that it doesn't do, or at least not well.
Anyway, looking at the mapIDs, a few places all share "-1", which leads to confusion. Astrolabe remaps the World Frame as 0 for its purposes, but taking the arenas into account along with Azeroth and the World Frame just won't do.
As seen from the link above, if I use 466, -1, that is either Outland, Blade's Edge Arena, or Outland, Nagrand Arena. Not cool, Blizzard. Not cool.
What I would like is a remapped table that allows the programmer to start at -100 for the World Frame, -99 for Azeroth, -98 for Blade's Edge Arena, etc, which will convert to -1 internally for icon placement, but I can't quite figure out how to create the table and make it work.
-- Place an icon in Outland, Blade's Edge Arena, at coords 22.47 x 18.21
function MyAddOn:CreateWorldMapPin(icon, 466, -98, 22.47, 18.21)
-- do something
After some digging in the FrameXML, I found WORLDMAP_COSMIC_ID, which works as a check, but I still can't find a constant for the arena maps. How do map AddOns know if you are looking at an arena map, and which one if you are? I'm poking at Mapster's code and am not finding what I need.
A lot of research later, and I have the very basic idea down. Currently, I am trying to work with tables, attempting to find a pin if it exists, and if not, create the pin. I've been poking at metatables (never used one, shaky ground here) and normal tables. Given that there will be APIs to remove a single pin or all pins, what suggestions or ideas should I go with?
If anyone is wondering "why write this when Astrolabe works", the answers are near the top in the comments section.
Followed your advice and let TomTom lead the way. Still a lot of work to do on this lib. And losing hair fast trying to figure out docmeta. I've read its docs, looked at a dozen or more addons that use it, and I still haven't got it to work yet.
Thank you for the suggestion, Pelf. It really helped!
Awesome. I'll have to check out the TomTom code sometime.
Issues with stuff not being documented at all has frustrated me so much in my life that I consider documentation of outward-facing functionality as essential to the product as the code that drives it. I know how you feel :(.