From d44a8a48cede3e2125a8c3f8f4a8d703254afb25 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 6 May 2026 02:50:04 -0700 Subject: [PATCH] feat(editor): patrol path waypoints color-coded by traversal order Path direction was ambiguous from a static screenshot: ribbon and waypoints were uniform orange/white. Now ribbons fade from bright at the start to dim at the end, and waypoints go green (NPC home) -> yellow/orange (intermediate) -> red (last) so direction of travel reads at a glance. --- tools/editor/editor_viewport.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tools/editor/editor_viewport.cpp b/tools/editor/editor_viewport.cpp index 0916b285..f56e04ba 100644 --- a/tools/editor/editor_viewport.cpp +++ b/tools/editor/editor_viewport.cpp @@ -487,12 +487,23 @@ void EditorViewport::setPatrolPath(const std::vector& points, float w pushV(bot); pushV(n); pushV(w); }; + // Ribbons fade from bright orange at the start to dim orange at the end + // so direction of travel is visually obvious. for (size_t i = 0; i + 1 < points.size(); i++) { - addRibbon(points[i], points[i+1], 1.0f, 0.7f, 0.2f, 0.55f); + float t = points.size() > 1 ? static_cast(i) / (points.size() - 1) : 0.0f; + float bright = 1.0f - t * 0.5f; + addRibbon(points[i], points[i+1], bright, 0.7f * bright, 0.2f * bright, 0.55f); } for (size_t i = 0; i < points.size(); i++) { - bool isStart = (i == 0); - addWaypoint(points[i], isStart ? 0.2f : 1.0f, isStart ? 1.0f : 0.85f, isStart ? 0.3f : 0.2f); + // Start (NPC home) green, intermediate yellow→orange, last red. + if (i == 0) { + addWaypoint(points[i], 0.2f, 1.0f, 0.3f); + } else if (i == points.size() - 1 && points.size() >= 2) { + addWaypoint(points[i], 1.0f, 0.3f, 0.2f); + } else { + float t = points.size() > 1 ? static_cast(i) / (points.size() - 1) : 0.0f; + addWaypoint(points[i], 1.0f, 1.0f - t * 0.6f, 0.2f); + } } patrolVertCount_ = static_cast(verts.size());