Skip to content

Commit

Permalink
Use Routes GetZoneName function to apply proper continent distinction…
Browse files Browse the repository at this point in the history
… to all maps
  • Loading branch information
Nevcairiel committed Dec 22, 2022
1 parent 7615f22 commit bd3e8c6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Plugins/GatherLite.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ end

local function InsertNode(event, node)
local newCoord = Routes:getID(node.posX, node.posY)
local zoneLocalized = GatherLite:MapLocalize(node.mapID)
local zoneLocalized = Routes.GetZoneName(node.mapID)
if not zoneLocalized then return end

local object = GatherLite:GetNodeObject(node.object);
local translatednode = GatherLite:translate("node." .. object.name)
Expand Down
6 changes: 4 additions & 2 deletions Plugins/GatherMate2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ local function InsertNode(event, zone, nodeType, coord, node_name)
local x, y, l = GatherMate2:DecodeLoc(coord) -- ignore level for now
local newCoord = Routes:getID(x, y)
-- Convert zone
local zoneLocalized = GatherMate2:MapLocalize(zone)
local zoneLocalized = Routes.GetZoneName(zone)
if not zoneLocalized then return end
Routes:InsertNode(zoneLocalized, newCoord, node_name)
end

Expand All @@ -109,7 +110,8 @@ local function DeleteNode(event, zone, nodeType, coord, node_name)
local x, y, l = GatherMate2:DecodeLoc(coord) -- ignore level for now
local newCoord = Routes:getID(x, y)
-- Convert zone
local zoneLocalized = GatherMate2:MapLocalize(zone)
local zoneLocalized = Routes.GetZoneName(zone)
if not zoneLocalized then return end
Routes:DeleteNode(zoneLocalized, newCoord, node_name)
end

Expand Down
2 changes: 2 additions & 0 deletions Routes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ local function GetZoneNameSafe(uiMapID)
return name or ("Zone #%s"):format(tostring(uiMapID))
end

Routes.GetZoneName = GetZoneName

Routes.LZName = setmetatable({}, { __index = function() return 0 end})
local function processMapChildrenRecursive(parent)
local children = C_Map.GetMapChildrenInfo(parent)
Expand Down

0 comments on commit bd3e8c6

Please sign in to comment.