Rarity

Rarity

17M Downloads

Add a /rarity mapinfo slash command that displays the current zone ID and name

rdw-software opened this issue ยท 0 comments

commented

See #519

Even better: We could add a /rarity mapinfo slash command that can help them make sure the ID is actually correct, by going to the actual ingame location and checking if the ID is what they entered. I've used something like that for debugging and it's useful because there are many subzones with different IDs, but the same map name, so just going by the wowpedia list may yield the wrong result.

This would be trivial to add and quite useful even for developers. Here's what I've been using (not a full implementation):

local GetMapInfo = C_Map.GetMapInfo
local function GetMapNameByID(uiMapID)
	local UiMapDetails = GetMapInfo(uiMapID)
	return UiMapDetails and UiMapDetails.name or nil
end

-- /rarity mapname
local function SlashMapName(uiMapID)
	print(uiMapID .. " ~> " .. GetMapNameByID(uiMapID))
end

-- /rarity mapdump
local function SlashMapDump(uiMapID)
	dump(GetMapInfo(uiMapID))
end

-- /rarity getmap or /rarity getmapuid ?
local function SlashGetMapUID()
	local mapID = C_Map.GetBestMapForUnit("player")
	print("Current map: " .. mapID .. " ~ " .. GetMapNameByID(mapID))
end

-- Or just combine all of them into a single command, e.g. /rarity mapinfo