2 Commits

Author SHA1 Message Date
brianhansonxyz 0d1ceddad2 ui: restore ready_text.png splash sprite
ready.cc:75 loads /data/openpilot/selfdrive/clearpilot/theme/clearpilot/images/ready_text.png
to render the 'ready' text on the splash, but the asset never got copied
during the C++ UI port (b5a0b32). isNull() check meant it just silently drew
nothing. Copied verbatim from the broken tree.
2026-05-04 19:07:54 -05:00
brianhansonxyz 20ea43f317 nightrider: render lane-change UI (was hidden by disengaged-skip)
During a lane change controlsd writes no_lat_lane_change=true; OnroadWindow
forces edgeColor to STATUS_DISENGAGED so the bg color flips to the disengaged
hue. drawLaneLines's nightrider early-return ("hide all when disengaged")
was matching that and skipping the entire frame, so nightrider showed nothing
during the lane change.

Fixes:
- Hoist is_no_lat_lane_change above the early-return.
- Skip the early-return during lane change, so lane lines + road edges +
  blind-spot path still render in nightrider while the maneuver is active
  (matching how nightrider looks when normally engaged).
- In the outline-only track-polygon branch: when in lane change, draw the
  track as a 4 px outline of CHANGE_LANE_PATH_COLOR (the same yellow used
  to fill the polygon in normal mode) instead of the usual 3 px light-blue
  guide. Hollow shape, thicker stroke — matches Brian's spec.

Normal-mode rendering is unchanged.
2026-05-04 19:07:54 -05:00
2 changed files with 21 additions and 9 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

+19 -7
View File
@@ -851,8 +851,15 @@ void AnnotatedCameraWidget::drawLaneLines(QPainter &painter, const UIState *s) {
// CLEARPILOT: nightrider mode — outline only, no fill
bool outlineOnly = nightriderMode;
// CLEARPILOT: in nightrider mode, hide all lines when not engaged
if (outlineOnly && edgeColor == bg_colors[STATUS_DISENGAGED]) {
// CLEARPILOT: read here so the nightrider hide-when-disengaged check below
// can let lane-change frames through (controlsd forces edgeColor to
// STATUS_DISENGAGED while no_lat_lane_change is true).
bool is_no_lat_lane_change = paramsMemory.getBool("no_lat_lane_change");
// CLEARPILOT: in nightrider mode, hide all lines when not engaged — except
// during a lane change, where we still want lane lines + road edges drawn
// alongside the yellow lane-change outline.
if (outlineOnly && edgeColor == bg_colors[STATUS_DISENGAGED] && !is_no_lat_lane_change) {
painter.restore();
return;
}
@@ -893,8 +900,7 @@ void AnnotatedCameraWidget::drawLaneLines(QPainter &painter, const UIState *s) {
// paint center lane path
// QColor bg_colors[CHANGE_LANE_PATH_COLOR];
// CLEARPILOT: read from paramsMemory; controlsd writes "no_lat_lane_change".
bool is_no_lat_lane_change = paramsMemory.getBool("no_lat_lane_change");
// is_no_lat_lane_change was read at the top of this function.
QColor center_lane_color;
@@ -955,11 +961,17 @@ void AnnotatedCameraWidget::drawLaneLines(QPainter &painter, const UIState *s) {
}
if (outlineOnly) {
// CLEARPILOT: in nightrider, the tire path outline is light blue at 3px.
// Uses a fixed light-blue instead of center_lane_color (which is status-tinted) so
// the path reads as a neutral guide, not as engagement/status feedback.
// CLEARPILOT: in nightrider, the tire path is rendered as an outline.
// - Normal: light blue 3px (status-neutral guide)
// - Lane change: 4px outline of CHANGE_LANE_PATH_COLOR (the same yellow
// used to fill the polygon in normal mode), so the nightrider lane
// change reads as the same visual cue, just hollow.
if (is_no_lat_lane_change) {
painter.setPen(QPen(bg_colors[CHANGE_LANE_PATH_COLOR], 4));
} else {
QColor lightBlue(153, 204, 255, 220); // #99CCFF light blue, mostly opaque
painter.setPen(QPen(lightBlue, 3));
}
painter.setBrush(Qt::NoBrush);
} else {
painter.setPen(Qt::NoPen);