mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-12-02 02:34:07 +08:00
mici: speed dial icon for stock ACC (#39455)
This commit is contained in:
@@ -47,6 +47,12 @@ class PersonalityWidget:
|
||||
width, height = right - left, bottom - top
|
||||
rect = rl.Rectangle(left, top, width, height)
|
||||
draw_widget_frame(rect, state.customization, profile, 'following_distance')
|
||||
if profile == Profile.COMPACT and state.stock_cruise_active:
|
||||
self.reset()
|
||||
if routine:
|
||||
texture = gui_app.texture('icons_mici/longitudinal/speed_dial.png')
|
||||
self._draw_centered((texture, 56, 48), rect, 126, 0.9)
|
||||
return
|
||||
self.draw(rect, personality=state.personality, has_lead=state.lead_detected, longitudinal_active=state.cruise_active,
|
||||
traffic_mode=state.traffic_selected or state.traffic_mode, gas_override=state.gas_pressed_override, visible=routine)
|
||||
|
||||
|
||||
@@ -399,7 +399,8 @@ class OnroadInput:
|
||||
def _personality_target(self, state: OnroadState) -> tuple | None:
|
||||
if (not state.camera_available or state.quick_select_open or
|
||||
state.alert.size != AlertSize.NONE and not is_personality_notice(state.alert) or
|
||||
self.profile == Profile.COMPACT and state.reversing and state.appearance.camera_view != CameraViewChoice.NONE):
|
||||
self.profile == Profile.COMPACT and (state.stock_cruise_active or
|
||||
state.reversing and state.appearance.camera_view != CameraViewChoice.NONE)):
|
||||
return None
|
||||
return personality_bounds(self.profile, state)
|
||||
|
||||
|
||||
@@ -207,3 +207,12 @@ def test_invisible_art_avoids_gpu_submission_without_losing_faint_visible_art(di
|
||||
else:
|
||||
draw.assert_called_once()
|
||||
assert draw.call_args.args[-1].a == visible_alpha
|
||||
|
||||
def test_compact_active_stock_cruise_draws_dial_instead_of_personality(display):
|
||||
state = road(longitudinal_active=False, stock_cruise_active=True)
|
||||
display.render(state)
|
||||
display._draw_centered.assert_called_once()
|
||||
assert display._draw_centered.call_args.args[0][0].path.endswith('/speed_dial.png')
|
||||
display._draw_centered.reset_mock()
|
||||
display.render(road())
|
||||
assert display._draw_centered.call_count == 8
|
||||
|
||||
Reference in New Issue
Block a user