WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Classic - AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=179)
-   -   Need help developing new addon: Classic Achievements (https://www.wowinterface.com/forums/showthread.php?t=57597)

Yukyuk 10-12-19 06:08 AM

Need help developing new addon: Classic Achievements
 
Am currently playing Wow classic and I like it.
But I do miss my achievements.

So am developing a new addon called Classic Achievements.
For this I would like to have a list of continent/zones/subzones.

Does anyone know of a way to get such a list?

Nimhfree 10-12-19 12:02 PM

There are all different types of maps in the new mapping system. You can basically iterate through the continents and get all the type of interest.

Here is code that should work in both Classic and Retail:
Code:

local currentMapId, TOP_MOST, ALL_DESCENDANTS = Grail.GetCurrentMapAreaID(), true, true
local cosmicMapInfo = MapUtil.GetMapParentInfo(currentMapId or 946, Enum.UIMapType.Cosmic, TOP_MOST)
if WOW_PROJECT_ID == WOW_PROJECT_CLASSIC then
        cosmicMapInfo = { mapID = 947 }
end
local continents = C_Map.GetMapChildrenInfo(cosmicMapInfo.mapID, Enum.UIMapType.Continent, ALL_DESCENDANTS)
for i, continentInfo in ipairs(continents) do
        -- access things like continentInfo.name, continentInfo.mapID
        local zones = C_Map.GetMapChildrenInfo(continentInfo.mapID, Enum.UIMapType.Zone, ALL_DESCENDANTS)
        for j, zoneInfo in ipairs(zones) do
                -- access things like zoneInfo.name, zoneInfo.mapID
        end
end

You can access the API in game to see the structures available in the map API.

Yukyuk 10-13-19 01:30 AM

Thank you Nimhfree.

Will try this out and will let you know the results.

Yukyuk 10-13-19 08:49 AM

With a bit of tinkering I got it to work (It has a dependency to Grail).
I now have a list of continents and the zones.

Unfortunately a list of subzones seems impossible.

Nimhfree 10-13-19 07:06 PM

Sorry about the Grail usage, I just copied sections of the code over.

I did not remember all the different map types there were. I remember Orphan which was insane as Stormsong Valley (in beta at least) was not a zone but an orphan.


All times are GMT -6. The time now is 05:56 PM.

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