BFA - Alpha tester - Page 2 - WoWInterface
Thread Tools Display Modes
04-26-18, 06:34 AM   #21
Featured Artist
Join Date: Aug 2012
Posts: 1,458
Good news, Dan confirmed in IRC last night that getplayermapposition is coming back in the next beta build.. so that's one half of the challenges eliminated.
  Reply With Quote
04-27-18, 12:01 AM   #22
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 266
If any of this helps, this works to get all the continents, their zones and dungeons in beta.

--	Attempt to get all the Continents by starting wherever you are and getting the Cosmic
--	map and then asking it for all the Continents that are children of it, hoping the API
--	will bypass the intervening World maps.
local currentMapId, TOP_MOST, ALL_DESCENDANTS = C_Map.GetBestMapForUnit('player'), true, true
--	Early in startup C_Map.GetBestMapForUnit('player') does not seem to work, so currentMapId is
--	nil so we use 946 which seems to be the mapId for Cosmic as a default.
local cosmicMapInfo = MapUtil.GetMapParentInfo(currentMapId or 946, Enum.UIMapType.Cosmic, TOP_MOST)
local continents = C_Map.GetMapChildrenInfo(cosmicMapInfo.mapID, Enum.UIMapType.Continent, ALL_DESCENDANTS)
self.continentMapIds = {}
for i, continentInfo in ipairs(continents) do
	local L = { name = continentInfo.name, zones = {}, mapID = continentInfo.mapID, dungeons = {} }
	local zones = C_Map.GetMapChildrenInfo(continentInfo.mapID, Enum.UIMapType.Zone, ALL_DESCENDANTS)
	for j, zoneInfo in ipairs(zones) do
		self:_AddMapId(L.zones, zoneInfo.name, zoneInfo.mapID, L.mapID)
	local dungeons = C_Map.GetMapChildrenInfo(continentInfo.mapID, Enum.UIMapType.Dungeon, ALL_DESCENDANTS)
	for j, dungeonInfo in ipairs(dungeons) do
		self:_AddMapId(L.dungeons, dungeonInfo.name, dungeonInfo.mapID, L.mapID)
	self.continents[L.mapID] = L
	tinsert(self.continentMapIds, L.mapID)
  Reply With Quote
04-27-18, 06:44 AM   #23
nUI Maintainer
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,619
Originally Posted by ircdirk View Post
UnitPosition works in BfA so if we know lengths of maps we could rewrite GetPlayerMapPosition...

Also there is https://github.com/tomrus88/Blizzard...dMapAreaID.lua which maps old mapids to new uimapids.
I don't know whether this function may help you but this is listed in the interface code

minX, maxX, minY, maxY = C_Map.GetMapRectOnMap(uiMapID,topUIMapID)

I would hazard a guess that this gives you the rect on the area within a higher map that relates to the mapID in question.
  Reply With Quote

WoWInterface » Featured Projects » Carbonite » Carbonite: General Discussion » BFA - Alpha tester

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off