Go Back   WowAce Forums > Addon Chat > Libraries
Libraries Threads for new libraries and mixins.

Reply
 
Thread Tools
Old 08-18-2013   #1
myrroddin
Amazing Member
 
Join Date: May 2006
Location: Edmonton, Canada
Posts: 1,147
Send a message via MSN to myrroddin
Default LibMapPins-1.0

LibMapPins-1.0 is a fresh, new alternative take on placing pins or icons on the world and mini maps.

Astrolabe-1.0 is good, but isn't actively maintained, only getting the occasional passive update. Further, the latest updates are on the developer stub, where the casual user has no idea how to find or use.

Therefore, I present to the community this library, which has the following differences:
  • Uses LibStub and CallbackHandler-1.0 rather than DongleStub
  • Embedded/mixed-in functions
  • Open source and community updated
  • Open SVN where anyone can commit updates, improvements, fixes, etc
  • Slimmer and more lightweight, not trying to do everything
  • Supports Metric and Imperial distances
  • Place icons in battlegrounds
The API and callbacks are a work in progress, and subject to change before final release. That said, anyone can work on LibMapPins-1.0; I don't have to be the only author, nor do I want to be the only author.

For example, the .docmeta is something I am not familiar with, and if someone beats me to getting it working, go for it! Likewise adding APIs or callbacks. Everyone is welcome!

Cross-post on WowInterface's forums.

Last edited by myrroddin; 08-18-2013 at 09:24 AM. Reason: add wowinterface forum link
myrroddin is offline   Reply With Quote
Old 08-18-2013   #2
funkydude
Administrator
 
funkydude's Avatar
 
Join Date: Nov 2005
Location: Scotland, UK
Posts: 2,989
Default Re: LibMapPins-1.0

I haven't looked at it but it's about time someone decided to make an Astrolabe alternative.
funkydude is offline   Reply With Quote
Old 08-19-2013   #3
myrroddin
Amazing Member
 
Join Date: May 2006
Location: Edmonton, Canada
Posts: 1,147
Send a message via MSN to myrroddin
Default Re: LibMapPins-1.0

Preliminary API is up. Keep in mind that it is a work in progress, and subject to change. But it will give you an idea of what I'm going for.
myrroddin is offline   Reply With Quote
Old 08-23-2013   #4
myrroddin
Amazing Member
 
Join Date: May 2006
Location: Edmonton, Canada
Posts: 1,147
Send a message via MSN to myrroddin
Default Re: LibMapPins-1.0

Still lots and lots to do. I haven't even thought about mini map code yet; there is still many APIs dealing with the world map that need adding or adjusting. Then there are the utility APIs like getting distance and direction to pin.

Anyway, I see a few people have downloaded this, and I'm curious if I'm on the right track. Feedback, or way too early?
myrroddin is offline   Reply With Quote
Old 09-02-2013   #5
Pelf
Junior Member
 
Pelf's Avatar
 
Join Date: May 2006
Posts: 55
Default Re: LibMapPins-1.0

I thought of a few questions:
  1. How about DeletePinsByMapID and DeleteAllPins functions to get the rest of the things in the TomTom pin/arrow right-click menu?
  2. What is the difference between a minimap pin and a world map pin? Wouldn't the minimap just be a window through which you'd see world map pins as you arrived near their location? I just see the CreateMinimapPin function in the mixins table, so I'm not sure what the signature was going to be like.
  3. As I just learned, just today, that libraries can't have saved variables, are you going to require consumers of the library to dedicate a section of their variables to dehydrated pin information (persisted, maybe, with some kind of Save/Load functions that they would need to call on ADDON_LOADED and PLAYER_LOGOUT or...)(...maybe the library would take a handle on the config section and update it constantly rather than loading once and saving once...)?
Pelf is offline   Reply With Quote
Old 09-03-2013   #6
myrroddin
Amazing Member
 
Join Date: May 2006
Location: Edmonton, Canada
Posts: 1,147
Send a message via MSN to myrroddin
Default Re: LibMapPins-1.0

  1. Both of those are going in; I just haven't written the code to handle them.
  2. I'm not sure, as I haven't started the minimap pin code. I would like to keep minimap pins and world map pins as separate APIs, but we'll see as I dig in.
  3. If you look at the code, LMP registers PLAYER_ENTERING_WORLD and re-places every pin. There is no need for AddOns to handle that sort of thing, as it should be done library-side.
  4. Libraries can have saved variables, although it is not recommended. DataStore is arguably a set of library files, and it has saved variables. Probably not the best example, however.
Nice to see some downloads, and people checking out the progress. Sorry for the lack of forward movement during the long weekend. I had company over.

I assume, since I have not done any in-game testing, there are bugs galore. I don't plan on testing until some more APIs are coded.

Speaking of author requirements, I do have hooks to CallbackHandler-1.0, but thus far haven't seen a need to fire any callbacks. Does anyone have suggestions, or does LibMapPins even need them? I know Astrolabe has callbacks, but I'm using it as an inspiration, not a code base.
myrroddin is offline   Reply With Quote
Old 09-03-2013   #7
myrroddin
Amazing Member
 
Join Date: May 2006
Location: Edmonton, Canada
Posts: 1,147
Send a message via MSN to myrroddin
Default Re: LibMapPins-1.0

Lots of new APIs added. Still no minimap code yet. I have a couple more world map pin APIs left to finish that section off, then the hard part.
myrroddin is offline   Reply With Quote
Old 09-03-2013   #8
Phanx
Seal Cub Clubbing Club
 
Phanx's Avatar
 
Join Date: May 2005
Location: United States
Posts: 8,151
Default Re: LibMapPins-1.0

Quote:
Originally Posted by myrroddin View Post
[LIST=1]
Libraries can have saved variables, although it is not recommended. DataStore is arguably a set of library files, and it has saved variables. Probably not the best example, however.
DataStore is not an embeddable library; what you're writing is, so it cannot have saved variables, and I can't really think of any reason why you'd need it to. Most addons that would use this kind of thing are going to be using a static database -- eg. the locations of mailboxes or herb nodes -- which would be pointless to duplicate in your saved variables. Plus, if you were saving all the data yourself, you'd need to introduce a lot of additional complexity to keep each addon's data separate, and allow arbitrary extra data to be stored with each location (for example, an herb node addon may want to store info on how many times you've seen an active node at each location), etc. Better just to let each addon handle its own business, and you just provide the tools.
__________________
Author/maintainer of Grid, PhanxChat, and many more. | PM me on CurseForge
Troubleshoot an addon | Turn any code into an addon | More addon resources
Need help with your code? Attach or paste your whole, real files.
Please don't PM me about addon bugs, requests, or code help. Post a comment, ticket, or thread instead!
Phanx is offline   Reply With Quote
Old 09-04-2013   #9
myrroddin
Amazing Member
 
Join Date: May 2006
Location: Edmonton, Canada
Posts: 1,147
Send a message via MSN to myrroddin
Default Re: LibMapPins-1.0

Phanx, you mistake me. LMP does not have saved variables, nor will it ever have them for exactly the reason you mentioned.

Any AddOns that use the lib will have to save their data themselves. All the lib does is control placement, visibility, and other tools. There is an internal table for pin data, but that is stuff the lib needs, and it is not saved to disc.
myrroddin is offline   Reply With Quote
Old 09-11-2013   #10
Tuhljin
Newbie
 
Join Date: Apr 2006
Posts: 1
Default Re: LibMapPins-1.0

My (sadly out-of-date) addon ZoneDefense used Astrolabe to place icons and animations on the world map but I had to build a sort of wrapper (which I called Astronomer) to facilitate actually displaying them in an intelligent manner. That is, I wanted a fire-and-forget function to place an icon on the world map at a given world location which stayed accurate even if the player changed maps. It had to notice when the selected map changed, automatically hiding the icon when its world location was no longer shown to the player, or move the icon to other positions on the map frame when the map was zoomed in or out so the desired world location was shown at a different relative position (coordinate translation). (Moving the icon like this was optional; you could also set it up so it was just hidden if the current map was not the specific one the icon was assigned to. I also put in some more advanced features, like changing the scale and transparency based on whether the current map was the one the icon was assigned to, so for instance, the icon could get smaller as you zoom out from the zone map to the continent map to the Azeroth map.)

Will this library handle anything like this? If so, I would request that some sort of callback be used when an icon is adjusted (allowing addon authors to use that to do the advanced things I mentioned above, for instance, should the library not do this natively -- or other "fancy" things if it does handle them).

If this is too much for this library, will it at least have the feature Astrolabe did which allowed me to translate a given coordinate on one map to a coordinate on another map? That's pretty much make or break when it comes to my purposes with addons like ZoneDefense.
Tuhljin is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:54 AM.