View Single Post
05/21/14, 09:13 AM   #4
thelegendaryof
 
thelegendaryof's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 161
Hm. Looking at the API itself:

You could parse them out of the API itself probably:

Lua Code:
  1. GetNumMaps()
  2. Returns: integer numMaps
  3.  
  4. GetMapInfo(luaindex index)
  5. Returns: string name, UIMapType mapType, MapContentType mapContentType
  6.  
  7. GetNumMapLocations()
  8. Returns: integer numMapLocations
  9.  
  10. GetMapLocation(luaindex locationIndex)
  11. _Uses variable returns..._
  12. Returns: string locationName, integer fontSize, number colorR, number colorG, number colorB, number normalizedX, number normalizedZ


Then try to get them like this (not tested, just written here quick n dirty):

Lua Code:
  1. local function GetAllLocationsFromAllMaps()
  2.     local locations = {}
  3.  
  4.     for mapid = 1, GetNumMaps(), 1 do
  5.    
  6.         locations[mapid] = {}
  7.        
  8.         for locid = 1, GetNumMapLocations(), 1 do
  9.             local name = GetMapLocation(locid)
  10.  
  11.             if(name) then locations[mapid][locid] = name end
  12.         end
  13.     end
  14.  
  15.     return locations
  16. end
  17.  
  18. -- switch game client to english
  19. ENGLISH_LOCATIONS = GetAllLocationsFromAllMaps()
  20.  
  21. -- this will probably overflow your Chat
  22. -- so better use /zgoo ENGLISH_LOCATIONS
  23. -- and comment that line out (*)
  24. d(ENGLISH_LOCATIONS)

(*) You can find Zgoo here: Zgoo

I'm not sure however - maybe it 's only working for the current map you're in. You could then dump that data with LibOrangUtils:CopyToClipboard(string text) from my library (well after converting it to a string instead of a table)

http://www.esoui.com/downloads/info4...rangUtils.html

and then supply both tables with your addon and translate them based on map/location ID.

You should get something like this as a result:

Lua Code:
  1. ENGLISH_LOCATIONS = {
  2.     [1] = { -- mapid
  3.         [592] = "The Herpderp Den of Derpert Herp", -- location id = name
  4.         [1029] = "The Lerb"
  5.     },
  6.     [502] = {
  7.         [1] = "Blargh"
  8.     }
  9. }

Last edited by thelegendaryof : 05/21/14 at 09:24 AM.
  Reply With Quote