Ship Routes: zone maps show only their own docks' lanes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
db73c215bb
commit
e2f18f5fd6
2 changed files with 16 additions and 3 deletions
|
|
@ -394,6 +394,8 @@ function provider:RefreshAllData()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local info = C_Map.GetMapInfo(mapID)
|
||||||
|
local zoneMap = info and info.mapType and info.mapType >= Enum.UIMapType.Zone
|
||||||
local exits = {}
|
local exits = {}
|
||||||
for _, route in ipairs(ns.routes) do
|
for _, route in ipairs(ns.routes) do
|
||||||
if Visible(route) then
|
if Visible(route) then
|
||||||
|
|
@ -418,12 +420,15 @@ function provider:RefreshAllData()
|
||||||
if leg.smooth then
|
if leg.smooth then
|
||||||
pts = Smooth(pts)
|
pts = Smooth(pts)
|
||||||
end
|
end
|
||||||
self.drawn[#self.drawn + 1] = { route = route, pts = pts }
|
|
||||||
|
|
||||||
-- a leg with one end on this map gets a marker where it leaves
|
|
||||||
local n = #pts
|
local n = #pts
|
||||||
local startIn = Inside(pts[1] / W, pts[2] / H)
|
local startIn = Inside(pts[1] / W, pts[2] / H)
|
||||||
local endIn = Inside(pts[n - 1] / W, pts[n] / H)
|
local endIn = Inside(pts[n - 1] / W, pts[n] / H)
|
||||||
|
-- a zone map only shows legs that sail from one of its own docks
|
||||||
|
if not zoneMap or startIn or endIn then
|
||||||
|
self.drawn[#self.drawn + 1] = { route = route, pts = pts }
|
||||||
|
end
|
||||||
|
|
||||||
|
-- a leg with one end on this map gets a marker where it leaves
|
||||||
if startIn ~= endIn then
|
if startIn ~= endIn then
|
||||||
local walk, far = pts, leg.to
|
local walk, far = pts, leg.to
|
||||||
if endIn then
|
if endIn then
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ local RECTS = {
|
||||||
[1415] = { inst = 0, top = 7467, bottom = -16000, left = 16000, right = -19200, type = 2 },
|
[1415] = { inst = 0, top = 7467, bottom = -16000, left = 16000, right = -19200, type = 2 },
|
||||||
[1414] = { inst = 1, top = 12800, bottom = -11733, left = 17067, right = -19733, type = 2 },
|
[1414] = { inst = 1, top = 12800, bottom = -11733, left = 17067, right = -19733, type = 2 },
|
||||||
[1437] = { inst = 0, top = -1500, bottom = -4800, left = 200, right = -4800, type = 3 }, -- "Wetlands"
|
[1437] = { inst = 0, top = -1500, bottom = -4800, left = 200, right = -4800, type = 3 }, -- "Wetlands"
|
||||||
|
[1431] = { inst = 0, top = -9716, bottom = -11516, left = 833, right = -1866, type = 3 }, -- "Duskwood"
|
||||||
[2521] = { inst = 2991, top = 4956, bottom = 1248, left = 4231, right = -1331, type = 3 },
|
[2521] = { inst = 2991, top = 4956, bottom = 1248, left = 4231, right = -1331, type = 3 },
|
||||||
}
|
}
|
||||||
-- how each continent's world area sits on the Azeroth map (947): u0, u1, v0, v1, xmin, xmax, ymin, ymax
|
-- how each continent's world area sits on the Azeroth map (947): u0, u1, v0, v1, xmin, xmax, ymin, ymax
|
||||||
|
|
@ -315,6 +316,13 @@ provider:RefreshAllData()
|
||||||
check(find("dock", "Menethil Harbor") ~= nil, "Menethil on its zone map")
|
check(find("dock", "Menethil Harbor") ~= nil, "Menethil on its zone map")
|
||||||
check(find("dock", "Stormwind Harbor") == nil, "Stormwind not on the Wetlands map")
|
check(find("dock", "Stormwind Harbor") == nil, "Stormwind not on the Wetlands map")
|
||||||
check(find("exit", "Theramore Isle") ~= nil and find("exit", "Southshore") ~= nil, "Wetlands edge markers toward Theramore and Southshore")
|
check(find("exit", "Theramore Isle") ~= nil and find("exit", "Southshore") ~= nil, "Wetlands edge markers toward Theramore and Southshore")
|
||||||
|
check(visibleLines() > 0, "Wetlands draws the lanes from its docks")
|
||||||
|
|
||||||
|
-- a zone with no docks shows no lanes, even the ones flying over it
|
||||||
|
mapID = 1431
|
||||||
|
provider:RefreshAllData()
|
||||||
|
check(count("dock") == 0 and count("exit") == 0, "no markers on a zone without docks")
|
||||||
|
check(visibleLines() == 0, "no lanes over a zone without docks, got " .. visibleLines())
|
||||||
|
|
||||||
-- faction filter
|
-- faction filter
|
||||||
faction = "Horde"
|
faction = "Horde"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue