Ship Routes: routes rest faded, hover brings one to full opacity

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-11-11 15:38:46 +00:00
parent 216e6f90b8
commit 40add57ba9
2 changed files with 16 additions and 6 deletions

View file

@ -11,12 +11,12 @@ local COLORS = {
Horde = { 1.00, 0.32, 0.24 },
Neutral = { 1.00, 0.82, 0.25 },
}
-- line width in screen pixels, and opacity
-- line width in screen pixels, and resting opacity: routes sit faded until hovered
local STYLE = {
boat = { width = 3, alpha = 0.95 },
air = { width = 2.5, alpha = 0.8 },
boat = { width = 3, alpha = 0.4 },
air = { width = 2.5, alpha = 0.35 },
}
local DIMMED = 0.2 -- opacity of other routes while one is highlighted
local LIT = 1 -- opacity of a route while its marker is hovered; the rest stay at their resting opacity
local WORLD_MAP = 947 -- Azeroth: the shared space that legs between continents are drawn in
local WORLD = -1 -- instance marker in Data.lua for a point given on the world map
-- the zone or continent map each instance is placed on the world map by
@ -351,7 +351,7 @@ function provider:DrawLines()
local route = item.route
local style = STYLE[route.kind]
local c = Color(route)
local alpha = (hl and not hl[route]) and DIMMED or style.alpha
local alpha = (hl and hl[route]) and LIT or style.alpha
local px = style.width + ((hl and hl[route]) and 1.5 or 0)
local pts = item.pts
for i = 1, #pts - 3, 2 do

View file

@ -230,6 +230,11 @@ check(toTheramore and toTheramore.Label.point[1] == "LEFT", "west edge label rea
check(find("exit", "Zephras Isle") == nil, "no edge marker toward Zephras Isle")
check(find("exit", "Grom'gol") == nil, "no edge marker for a route that stays on the map")
check(visibleLines() > 50, "route lines drawn on EK, got " .. visibleLines())
local resting = true
for _, l in ipairs(allLines) do
if l.shown and l.layer == "ARTWORK" and l.color[4] >= 0.5 then resting = false end
end
check(resting, "routes rest faded")
check(provider.overlay.level == 100, "overlay frame level set")
for _, l in ipairs(allLines) do
if l.shown then
@ -258,7 +263,12 @@ for _, l in ipairs(allLines) do
if l.color[4] < 0.5 then dim = dim + 1 else bright = bright + 1 end
end
end
check(dim > 0 and bright > 0, "other routes dim while one is highlighted")
check(dim > 0 and bright > 0, "hovered route stands out from the faded rest")
local full = false
for _, l in ipairs(allLines) do
if l.shown and l.layer == "ARTWORK" and l.color[4] == 1 then full = true end
end
check(full, "hovered route is fully opaque")
menethil:OnMouseLeave()
check(provider.highlight == nil, "leaving clears the highlight")