View Single Post
10/03/21, 10:40 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
Is there a parent of the world map containers? e.g. is ZO_WorldMapContainer the parent of ZO_WorldMapContainer1?

Then do:
Lua Code:
  1. local numChildren = <parentOfWorldmapContainers>:GetNumChildren()
  2. for i=1, numChildren, 1 do
  3.  local childOfParent = <parentOfWorldmapContainers>:GetChild(i)
  4.  childOfParent:setSomething(thing)
  5. end

Else do it like this:

Lua Code:
  1. local numWorldMapContainers = 81 --maybe there is a better way to ge the 81 dynamically from the active map's ID or similar?
  2. local templateName = "ZO_WorldMapContainer"
  3. local WM = WINDOW_MANAGER
  4. for i=1, numWorldMapContainers , 1 do
  5.  local worldMapContainer = WM:GetControlByName(templateName , i) --Will create a control with name "ZO_WorldMapContainer1" and so on
  6.  worldMapContainer :setSomething(thing)
  7. end


If you describe here (https://gitter.im/esoui/esoui) what you want to achieve I bet there will be even an easier/better way that devs like votan (who got a good knowledge of the worldmaps) can hep you with.

Last edited by Baertram : 10/03/21 at 10:44 AM.
  Reply With Quote