View Single Post
07-19-18, 02:02 PM   #1
eoblaed
A Murloc Raider
 
eoblaed's Avatar
Join Date: Jul 2018
Posts: 7
Add New Code in New File to Existing Addon

I have several addons that still use the old GetMapNameByID() API call. This is now a 'nil'.

I wrote a thin wrapper function that looks up the old worldID, converts it to the new style UiMapID, and returns C_Map.GetMapInfo(newid).name. The code works when I embed it directly into the various .lua files of the addon (but, that's not a great solution).

What I'm trying to do is create a new file, MapCompat.lua, in such a way that will allow the other pre-existing lua files in the addon to see the GetMapNameByID() call in that new .lua file.

Not having authored an addon before, there's a seemingly labyrinthine combination of .xml, .toc, etc, and I haven't quite hit on the right combination of things to do what I want to do.

Any pointers?

Thanks!
  Reply With Quote