Thread Tools Display Modes
10-12-19, 06:08 AM   #1
Yukyuk
A Chromatic Dragonspawn
 
Yukyuk's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2015
Posts: 179
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?
__________________
Better to fail then never have tried at all.
  Reply With Quote
10-12-19, 12:02 PM   #2
Nimhfree
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 267
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.
  Reply With Quote
10-13-19, 01:30 AM   #3
Yukyuk
A Chromatic Dragonspawn
 
Yukyuk's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2015
Posts: 179
Thank you Nimhfree.

Will try this out and will let you know the results.
__________________
Better to fail then never have tried at all.
  Reply With Quote
10-13-19, 08:49 AM   #4
Yukyuk
A Chromatic Dragonspawn
 
Yukyuk's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2015
Posts: 179
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.
__________________
Better to fail then never have tried at all.
  Reply With Quote
10-13-19, 07:06 PM   #5
Nimhfree
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 267
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.
  Reply With Quote

WoWInterface » Classic - AddOns, Compliations, Macros » Classic - AddOn Help/Support » Need help developing new addon: Classic Achievements

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