mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-22 07:23:53 +08:00
TV Set
This commit is contained in:
@@ -11,7 +11,6 @@ from openpilot.selfdrive.ui.ui_state import ui_state
|
||||
from openpilot.selfdrive.ui.lib.starpilot_status import (
|
||||
CEM_OVERRIDE_COLOR, ENGAGED_COLOR, EXPERIMENTAL_COLOR, TRAFFIC_COLOR
|
||||
)
|
||||
from openpilot.selfdrive.ui.lib.starpilot_visuals import get_border_roundness
|
||||
|
||||
|
||||
|
||||
@@ -221,7 +220,8 @@ def get_traffic_border_colors() -> tuple[rl.Color, rl.Color] | None:
|
||||
def render_background_effects(rect: rl.Rectangle, border_width: float):
|
||||
global _smoothed_steer
|
||||
sm = ui_state.sm
|
||||
border_roundness = get_border_roundness(rect, border_width)
|
||||
border_rect = rl.Rectangle(rect.x + border_width, rect.y + border_width,
|
||||
rect.width - 2 * border_width, rect.height - 2 * border_width)
|
||||
|
||||
# 1. Turn Signal and Blind Spot indicators
|
||||
colors = get_traffic_border_colors()
|
||||
@@ -229,11 +229,11 @@ def render_background_effects(rect: rl.Rectangle, border_width: float):
|
||||
left_color, right_color = colors
|
||||
if left_color.a > 0:
|
||||
rl.begin_scissor_mode(int(rect.x), int(rect.y), int(rect.width // 2), int(rect.height))
|
||||
rl.draw_rectangle_rounded(rect, border_roundness, 10, left_color)
|
||||
rl.draw_rectangle_rounded_lines_ex(border_rect, 0.12, 10, border_width, left_color)
|
||||
rl.end_scissor_mode()
|
||||
if right_color.a > 0:
|
||||
rl.begin_scissor_mode(int(rect.x + rect.width // 2), int(rect.y), int(rect.width // 2), int(rect.height))
|
||||
rl.draw_rectangle_rounded(rect, border_roundness, 10, right_color)
|
||||
rl.draw_rectangle_rounded_lines_ex(border_rect, 0.12, 10, border_width, right_color)
|
||||
rl.end_scissor_mode()
|
||||
|
||||
# 2. Steering Torque Border
|
||||
@@ -266,7 +266,7 @@ def render_background_effects(rect: rl.Rectangle, border_width: float):
|
||||
else:
|
||||
rl.begin_scissor_mode(int(rect.x + rect.width - border_width), y_pos, int(border_width), int(visible_height))
|
||||
|
||||
rl.draw_rectangle_rounded(rect, border_roundness, 10, col)
|
||||
rl.draw_rectangle_rounded_lines_ex(border_rect, 0.12, 10, border_width, col)
|
||||
rl.end_scissor_mode()
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ from openpilot.selfdrive.ui.onroad.starpilot.weather_icon import render_weather_
|
||||
from openpilot.selfdrive.ui.lib.starpilot_status import (
|
||||
get_screen_edge_color,
|
||||
)
|
||||
from openpilot.selfdrive.ui.lib.starpilot_visuals import get_border_roundness
|
||||
from openpilot.starpilot.common.favorite_slots import (
|
||||
build_favorite_slot_options,
|
||||
filter_favorite_slot_options,
|
||||
@@ -101,10 +100,6 @@ class StarPilotOnroadView(AugmentedRoadView):
|
||||
|
||||
def _render(self, rect: rl.Rectangle):
|
||||
border_width = self._get_border_width()
|
||||
border_roundness = get_border_roundness(rect, border_width)
|
||||
border_color = get_pulse_glide_border_color(ui_state.sm, get_screen_edge_color(ui_state))
|
||||
rl.draw_rectangle_rounded(rect, border_roundness, 10, border_color)
|
||||
render_background_effects(rect, border_width)
|
||||
|
||||
# The favorite menu has first claim on the lower-left gesture. Filtering
|
||||
# its events before the inherited HUD/widgets render prevents a corner tap
|
||||
@@ -161,10 +156,12 @@ class StarPilotOnroadView(AugmentedRoadView):
|
||||
|
||||
def _draw_border(self, rect: rl.Rectangle):
|
||||
border_width = self._get_border_width()
|
||||
border_roundness = get_border_roundness(rect, border_width)
|
||||
rl.draw_rectangle_rounded_lines_ex(rect, border_roundness, 10, border_width, rl.BLACK)
|
||||
rl.draw_rectangle_lines_ex(rect, border_width, rl.BLACK)
|
||||
border_rect = rl.Rectangle(rect.x + border_width, rect.y + border_width,
|
||||
rect.width - 2 * border_width, rect.height - 2 * border_width)
|
||||
border_color = get_pulse_glide_border_color(ui_state.sm, get_screen_edge_color(ui_state))
|
||||
rl.draw_rectangle_rounded_lines_ex(border_rect, 0.12, 10, border_width, border_color)
|
||||
render_background_effects(rect, border_width)
|
||||
render_overlay(border_rect, border_width)
|
||||
|
||||
def _render_slc(self):
|
||||
|
||||
Reference in New Issue
Block a user