LibMapData-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.

API Documentation

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

You must login to post a comment. Don't have an account? Register to get one!

  • Avatar of kagaro kagaro May 31, 2010 at 15:03 UTC - 0 likes

    Alpha lib ready for testing slaren Ive added area_id to all maps as well

    MapAreaId(mapfile) it should match the in-game value.

  • Avatar of kagaro kagaro May 31, 2010 at 13:38 UTC - 0 likes

    ill have a lib ready shortly

  • Avatar of slaren slaren May 31, 2010 at 13:11 UTC - 0 likes

    Yay, finally a library for this. Can't wait for a release!

Facts

Date created
May 30, 2010
Categories
Last update
Sep 12, 2013
Development stage
Release
Language
  • enUS
License
All Rights Reserved
Curse link
LibMapData-1.0
Reverse relationships
1
Downloads
152,620
Recent files
  • A: r141 for 5.4.0 Sep 12, 2013
  • A: r140 for 5.4.0 Sep 12, 2013
  • R: 0.30-release for 5.4.0 Sep 10, 2013
  • A: r138 for 5.4.0 Sep 10, 2013
  • A: r137 for 5.3.0 Jul 07, 2013

Authors

Relationships

Tool used
DataTools
Embedded library
CallbackHandler-1.0
LibStub