WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Carbonite: General Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=118)
-   -   BFA - Alpha tester (https://www.wowinterface.com/forums/showthread.php?t=56150)

Rythal 04-26-18 06:34 AM

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.

Nimhfree 04-27-18 12:01 AM

If any of this helps, this works to get all the continents, their zones and dungeons in beta.

Code:

--        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)
        end
        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)
        end
        self.continents[L.mapID] = L
        tinsert(self.continentMapIds, L.mapID)
end


Xrystal 04-27-18 06:44 AM

Quote:

Originally Posted by ircdirk (Post 327666)
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.


All times are GMT -6. The time now is 08:06 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI