LibMapData-1.0
Note: LibMapData-1.0 is unmaintained, a suggested replacement library is HereBeDragons-1.0
Small library that provides mapfile data. it include width,height, upper left x,y and lower right x,y. This data includes multi-floor maps such as the new instances.
To get the mapfile names use GetMapInfo() on the current map. Filenames are constant across localizations.
Sample usage:
mapfiles = LibStub("LibMapData-1.0"); -- get the size of Coth defaulting to the first floor size local width,height = mapfiles:MapArea('CoTStratholme') -- get the size of the 8th floor of icc width,height = mapfiles:MapArea('IcecrownCitadel',8) -- get the size of the Arati mapfile. width,height = mapfiles:MapArea('Arathi')
The floors are optional and if a given floor is not found 0,0 will be returned. This lib came about as a result of several addons needing the data, and simply copying and pasting them in each copy occupies around 44k of memory.
LibMapData now supports Mapchanged callback event. Sample usage:
mapfiles = LibStub("LibMapData-1.0"); mapfiles:RegisterCallback("MapChanged",function(event,map,floor,w,h) print("Map is now "..map) end
ill add it in mysticalos
missing eye of the storm
areaID
483
unless someone find an error, gona tab as release.
Ive added some distance and direction functions as well
may add that olog, right now it does use any events so its 0 cpu just a little memory
Having the coordinates in a library is very useful in itself already but what's often needed with them is to keep track of the current zone. It's mostly just listening to the zone changed events but there are a few peculiarities in it. Might be useful to have that built in the library as well.
Nice. I've wondered why nobody did this before.
Alpha lib ready for testing slaren Ive added area_id to all maps as well
MapAreaId(mapfile) it should match the in-game value.
ill have a lib ready shortly
Yay, finally a library for this. Can't wait for a release!