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
        
- 
            
                
                View User Profile
     
            
            
            
       
 
 
       - 
            
                
                Send Message
     
            
            
            
       
 
 
Posted Jul 9, 2011- 
            
                
                View User Profile
     
            
            
            
       
 
 
       - 
            
                
                Send Message
     
            
            
            
       
 
 
Posted Jul 7, 2011Hey kagaro, can I get permission to use your library in my addon TotemRadius? Your license is All Rights Reserved so though I'd ask first.
- 
            
                
                View User Profile
     
            
            
            
       
 
 
       - 
            
                
                Send Message
     
            
            
            
       
 
 
Posted Jul 2, 2011wait blizz hot fixed it? sigh.
- 
            
                
                View User Profile
     
            
            
            
       
 
 
       - 
            
                
                Send Message
     
            
            
            
       
 
 
Posted Jul 1, 2011Issue solved, they didnt flag the map in the dbc files as being mixed outdoors mode and had the floors in backwards. extractor now accounts for that
- 
            
                
                View User Profile
     
            
            
            
       
 
 
       - 
            
                
                Send Message
     
            
            
            
       
 
 
Posted Jul 1, 2011Mysticalos can you double check the area I'd isn't swapping on those floors
- 
            
                
                View User Profile
     
            
            
            
       
 
 
       - 
            
                
                Send Message
     
            
            
            
       
 
 
Posted Jul 1, 2011i say try to find something closely resembling 1587.0, 1058.0
i remember ulduar for example, was also goofy in this way, the staging area was listed under a diff zone, and rest of sizes were listed with wrong area ids. something similar could be at work here, i'm sure the sizes are just at the wrong numbers because of the spit. 1587.0, 1058.0 is probably not perfect exact and i'd like more precise, still can't open mpq files on my mac though :( mpq extractors haven't worked since format was changed in 4.x
- 
            
                
                View User Profile
     
            
            
            
       
 
 
       - 
            
                
                Send Message
     
            
            
            
       
 
 
Posted Jul 1, 2011I'll update to reflect mysticalos, the dbc data is way wrong I'm nit sure why. The dbc files only shows 2 floors period not 3 but the map drop down shows 3 floors. I wasn't able to get into the zone myself either last night I was using data provided by others as to size
- 
            
                
                View User Profile
     
            
            
            
       
 
 
       - 
            
                
                Send Message
     
            
            
            
       
 
 
Posted Jun 30, 2011firelands sizes are still wrong, the blizz api also reported wrong sizes sigh i used /dumb GetMapInfo() and those are sizes it reportegd and i plugged into dbm but they are way way WAY off in areas 2 and 3 still.
here are real ones for area 1 and 2 at least verified in game using actual calculations and mage blink (20 yards)
http://www.deadlybossmods.com/phpbb3/viewtopic.php?f=1&t=2269&p=12062#p12062
oldschool methods!
1, 1587.0, 1058.0, -- The Firelands (this one is as cose to accurate as i could get it
2, 1440.0, 960) -- Sulfuron Keep (looks like this one actually was right)
I could not find area 3 yet cause i cannot access it in game until. maybe that's the one that's 375.0, 250.0? that's what i'm gonna assume for now. WTF is up with blizzards invalid sizes in data files AND GetMapInfo() api anyways?
- 
            
                
                View User Profile
     
            
            
            
       
 
 
       - 
            
                
                Send Message
     
            
            
            
       
 
 
Posted Jun 30, 2011i updated the code to now cache, need to test before i drop it in, in either case there are no errors in game any more
- 
            
                
                View User Profile
     
            
            
            
       
 
 
       - 
            
                
                Send Message
     
            
            
            
       
 
 
Posted Jun 30, 2011It should be fine, i just forgot to tag it so plugins got the data.
- 
            
                
                View User Profile
     
            
            
            
       
 
 
       - 
            
                
                Send Message
     
            
            
            
       
 
 
Posted Jun 30, 2011Perhaps you could cache the fact that a message has been displayed and avoid displaying it more than once. I think that would be an improvement.
- 
            
                
                View User Profile
     
            
            
            
       
 
 
       - 
            
                
                Send Message
     
            
            
            
       
 
 
Posted Jun 30, 2011There has got to be a better way to handle missing data than spamming chat with thousands of messages. Please find it.
- 
            
                
                View User Profile
     
            
            
            
       
 
 
       - 
            
                
                Send Message
     
            
            
            
       
 
 
Posted Jun 30, 2011Missing for 800 in firelands
- 
            
                
                View User Profile
     
            
            
            
       
 
 
       - 
            
                
                Send Message
     
            
            
            
       
 
 
Posted Jul 2, 2011- 
            
                
                View User Profile
     
            
            
            
       
 
 
       - 
            
                
                Send Message
     
            
            
            
       
 
 
Posted Jun 29, 2011- 
            
                
                View User Profile
     
            
            
            
       
 
 
       - 
            
                
                Send Message
     
            
            
            
       
 
 
Posted Jun 29, 2011Missing for 800
- 
            
                
                View User Profile
     
            
            
            
       
 
 
       - 
            
                
                Send Message
     
            
            
            
       
 
 
Posted Jun 29, 2011- 
            
                
                View User Profile
     
            
            
            
       
 
 
       - 
            
                
                Send Message
     
            
            
            
       
 
 
Posted Jun 29, 2011At line 965, add this
mapData[800] = {
['floors'] = 3, ['name'] = "Firelands", ['rzti'] = 0, ['map_type'] = 2, ['continent'] = 0, ['transform'] = 0,
[1] = {0,0,1,1}, [2] = {0,0,1,1}, [3] = {0,0,1,1},
}
It will shut up the error at least, until we can get actual data and have it updated.
- 
            
                
                View User Profile
     
            
            
            
       
 
 
       - 
            
                
                Send Message
     
            
            
            
       
 
 
Posted Jun 29, 2011- 
            
                
                View User Profile
     
            
            
            
       
 
 
       - 
            
                
                Send Message
     
            
            
            
       
 
 
Posted Jun 29, 2011